comparison srogue/rip.c @ 300:0250220d8cdd

Fix an assortment of compiler warnings. A few potential bugs were removed in the process. Much code cleanup remains to be done.
author John "Elwin" Edwards
date Fri, 22 Nov 2019 21:18:27 -0500
parents 70aa5808c782
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
299:74351bf23e5e 300:0250220d8cdd
61 61
62 #include <time.h> 62 #include <time.h>
63 void 63 void
64 death(char monst) 64 death(char monst)
65 { 65 {
66 reg char dp, *killer; 66 reg char *killer;
67 int dp;
67 struct tm *lt; 68 struct tm *lt;
68 time_t date; 69 time_t date;
69 char buf[LINLEN]; 70 char buf[LINLEN];
70 struct tm *localtime(); 71 struct tm *localtime();
71 72
178 */ 179 */
179 if (!waswizard) { 180 if (!waswizard) {
180 for (scp = top_ten; scp <= &top_ten[9]; scp++) 181 for (scp = top_ten; scp <= &top_ten[9]; scp++)
181 if (amount > scp->sc_score) 182 if (amount > scp->sc_score)
182 break; 183 break;
183 if (scp <= &top_ten[9]) { 184 if (scp <= &top_ten[9]) {
184 for (sc2 = &top_ten[9]; sc2 > scp; sc2--) 185 for (sc2 = &top_ten[9]; sc2 > scp; sc2--)
185 *sc2 = *(sc2-1); 186 *sc2 = *(sc2-1);
186 scp->sc_score = amount; 187 scp->sc_score = amount;
187 strcpy(scp->sc_name, whoami); 188 strcpy(scp->sc_name, whoami);
188 scp->sc_flags = aflag; 189 scp->sc_flags = aflag;
189 if (aflag == WINNER) 190 if (aflag == WINNER)
190 scp->sc_level = max_level; 191 scp->sc_level = max_level;
191 else 192 else
192 scp->sc_level = level; 193 scp->sc_level = level;
193 scp->sc_monster = monst; 194 scp->sc_monster = monst;
194 scp->sc_uid = playuid; 195 scp->sc_uid = playuid;
195 scp->sc_explvl = him->s_lvl; 196 scp->sc_explvl = him->s_lvl;
196 scp->sc_exppts = him->s_exp; 197 scp->sc_exppts = him->s_exp;
197 time(&scp->sc_date); 198 time(&scp->sc_date);
198 } 199 }
199 } 200 }
200 ignore(); 201 ignore();
201 fseek(scoreboard, 0L, 0); 202 fseek(scoreboard, 0L, 0);
202 for(i = 0; i < 10; i++) 203 for(i = 0; i < 10; i++)
226 if (waswizard) 227 if (waswizard)
227 return; 228 return;
228 #ifdef LOGFILE 229 #ifdef LOGFILE
229 if (logfile == NULL) 230 if (logfile == NULL)
230 return; 231 return;
231 sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami, 232 sprintf(logmessage, "%ld %d %s %d ", time(NULL), amount, whoami,
232 him->s_lvl); 233 him->s_lvl);
233 if (amulet) 234 if (amulet)
234 sprintf(mlev, " [max %d] with the Amulet", max_level); 235 sprintf(mlev, " [max %d] with the Amulet", max_level);
235 else 236 else
236 mlev[0] = '\0'; 237 mlev[0] = '\0';