Fix an assortment of compiler warnings.

A few potential bugs were removed in the process.  Much code cleanup
remains to be done.
This commit is contained in:
John "Elwin" Edwards 2019-11-22 21:18:27 -05:00
parent de95b19cee
commit 7d459d7d36
47 changed files with 608 additions and 591 deletions

View file

@ -63,7 +63,8 @@ void showpack(bool winner, char *howso);
void
death(char monst)
{
reg char dp, *killer;
reg char *killer;
int dp;
struct tm *lt;
time_t date;
char buf[LINLEN];
@ -180,21 +181,21 @@ score(int amount, int aflag, char monst)
for (scp = top_ten; scp <= &top_ten[9]; scp++)
if (amount > scp->sc_score)
break;
if (scp <= &top_ten[9]) {
for (sc2 = &top_ten[9]; sc2 > scp; sc2--)
*sc2 = *(sc2-1);
scp->sc_score = amount;
strcpy(scp->sc_name, whoami);
scp->sc_flags = aflag;
if (aflag == WINNER)
scp->sc_level = max_level;
else
scp->sc_level = level;
scp->sc_monster = monst;
scp->sc_uid = playuid;
scp->sc_explvl = him->s_lvl;
scp->sc_exppts = him->s_exp;
time(&scp->sc_date);
if (scp <= &top_ten[9]) {
for (sc2 = &top_ten[9]; sc2 > scp; sc2--)
*sc2 = *(sc2-1);
scp->sc_score = amount;
strcpy(scp->sc_name, whoami);
scp->sc_flags = aflag;
if (aflag == WINNER)
scp->sc_level = max_level;
else
scp->sc_level = level;
scp->sc_monster = monst;
scp->sc_uid = playuid;
scp->sc_explvl = him->s_lvl;
scp->sc_exppts = him->s_exp;
time(&scp->sc_date);
}
}
ignore();
@ -228,7 +229,7 @@ void writelog(int amount, int aflag, char monst)
#ifdef LOGFILE
if (logfile == NULL)
return;
sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami,
sprintf(logmessage, "%ld %d %s %d ", time(NULL), amount, whoami,
him->s_lvl);
if (amulet)
sprintf(mlev, " [max %d] with the Amulet", max_level);