| Message |
OK, seems better now. I still get this warning:
build.c
g:\cygwin\home\nick\smaugfuss\src\boards.c(1447) : warning C4715: 'read_note' : not all control paths return a value
This is in:
NOTE_DATA *read_note( char *notefile, FILE *fp )
{
NOTE_DATA *pnote;
char *word;
// ... stuff omitted ...
bug ( "read_note: bad key word." );
exit( 1 );
}
See, although exit (1) would stop the program, that is a function call, and not, strictly speaking, returning a value. It should really be:
NOTE_DATA *read_note( char *notefile, FILE *fp )
{
NOTE_DATA *pnote;
char *word;
// ... stuff omitted ...
bug ( "read_note: bad key word." );
exit( 1 );
return NULL;
}
The other warning is:
mud_comm.c
g:\cygwin\home\nick\smaugfuss\src\mud_comm.c(1513) : warning C4305: 'function' : truncation from 'const int ' to 'short '
The definition of add_timer is:
void add_timer( CHAR_DATA *ch, sh_int type, sh_int count, DO_FUN *fun, int value )
The warning occurs at:
void do_mpnuisance( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
char arg1[MAX_STRING_LENGTH];
// ... stuff omitted ...
victim->pcdata->nuisance->max_time = mktime(now_time);
add_timer( victim, TIMER_NUISANCE, (28800*2), NULL, 0 );
return;
}
The 3rd argument (sh_int count) is being passed the value 28800*2 which is 57,600. This is higher than the maximum possible in a short, which is 32767. This is therefore wrong.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|