Re: time and sprintf

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 08/12/00


Jason Stortz wrote:
>
> act.imp.c: In function 'do_timecmd':
> act.imp.c:377 warning: int format, __time_t arg (arg3)
> act.imp.c:377: warning: int format, __time_t arg (arg 4)
>
> sprintf(report,"Timeing took %d.%06d
> seconds.\r\n",etime.tv_sec,etime.tv_usec);
> send_to_char(report,ch);
>
> Anyway, the whole things WORKS, but I
> hate having any warnings at all when I compile.  Warning now, error later as
> we all know. =)

To get rid of the warnings just caste the variables that the compiler's
complaining about, so you would end up with (int)etime.tv_sec and
(int)etime.tv_usec.

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT