----- Original Message -----
From: Hrvoje Niksic <[EMAIL PROTECTED]>
Date: Tuesday, March 28, 2006 7:23 pm

> > in progress.c line 880:
> >
> >    eta_hrs = (int)(eta / 3600, eta %= 3600);
> >    eta_min = (int)(eta / 60, eta %= 60);
> >    eta_sec = (int)(eta);
> 
> This is weird.  Did you compile the code yourself, or did you get it

Yes that is strange. I got the code from one of the GNU mirrors, but 
I'm afraid I can't remember which one.

> from a Windows download site?  I'm asking because the code in
> progress.c doesn't look like that; it in fact looks like this:
> 
>      eta_hrs = eta / 3600, eta %= 3600;
>      eta_min = eta / 60,   eta %= 60;
>      eta_sec = eta;
> 
> The cast to int looks like someone was trying to remove a warning and
> botched operator precedence in the process.  If you must insert the
> cast, try:
> 
> eta_hrs = (int) (eta / 3600), eta %= 3600;

Yes that also works. The cast is needed on Windows x64 because eta is 
a wgint (which is 64-bit) but a regular int is 32-bit so otherwise a 
warning is issued. Oh well. Perhaps it would be better changed to use 
a semicolon for clarity anyway?

cheers,

Reply via email to