From: Jason G. <ja...@gm...> - 2007-01-31 02:31:02
|
That's a very common warning in MSVC that is often just gotten rid of in cross-platform code with a #pragma disable.. 4244, maybe? I think other parts of ClanLib might have that pragma setting? On 1/30/07, Seth A. Robinson <se...@rt...> wrote: > Hi Ben, > > Sorry for the slow reply and thanks for the patch. > > Anyway, I applied it, but figured I'd better not commit right away because I > noticed I was still getting compiler warnings for many things that were > changed, for instance: > > The old float offx1 = cos(M_PI * 2.0 * (e / numsegments))*radius; > > And the new > > float offx1(cos(M_PI * 2.0 * (e / numsegments))*radius); > > give the same warning under VS8: > > .\Display\Collision\collision_outline.cpp(333) : warning C4244: > 'initializing' : conversion from 'double' to 'float', possible loss of data > > I can fix it by doing this: > > float offx1 = (float)cos(M_PI * 2.0 * (e / numsegments))*radius; > > so I wanted to ask, what compiler(s) are you using on your side? GCC 4.X? Is > it possible for you to also test under MS VS8? Probably not but hey, > thought I'd ask :) > > -Seth > > > -----Original Message----- > From: Ben Chambers [mailto:bdc...@ya...] > Sent: Thursday, December 21, 2006 5:31 AM > To: ClanLib Devel > Subject: [Clanlib-devel] Patch for warnings > > Since warnings bug me, I've patched a number of files to get rid of them. > > Mostly, I've included explicit type castes where the casting was done > implicitly. > > Also, in collision_outline.cpp, on lines 300, 339, 366, I changed > truncate-by-caste (requires two castes) to floor(). > > Note that, in collision_outline.cpp, on lines 456, 457, 519, 520, 588, > 589: Changing what's included in the parenthesis could affect rounding. > > ...Chambers > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > clanlib-devel mailing list > cla...@li... > https://lists.sourceforge.net/lists/listinfo/clanlib-devel > |