Mail Archives: djgpp/1997/04/06/18:14:10
Jeff Weeks wrote:
>
> for(i = 0; i < 256; i++) {
> sine[i] = sin(i*2*3.1415926/256.0)*256;
> cosine[i] = cos(i*2*3.1415926/256.0)*256;
> }
>
> In other words, it's calculating the sin/cos values and putting them
> into a 24.8 fixed math int. But, ofcourse, DJGPP complains about
> converting a double to an int... but if I typecast to an int with
>
> sine[i] = (int)...
>
> It does calculate the sine/cosine tables right (they all seem to be 0).
> So I'd like to turn off warnings for this little block. Is it possible?
Try putting the whole thing in parentheses, like so:
sine[i] = (int) ( sin( i * 2 * M_PI / 256.0 ) * 256 );
>
> If not, what's the command line switch to disable this warning globally?
I'm not sure, but you can probably find it by looking in the gcc
documentation ("info gcc invoking warning").
--
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------
- Raw text -