From: Ian S. A. R. <ia...@ae...> - 2009-03-27 20:06:06
|
On linux it's very easy to test compiling in ANSI C, with the new build system ../configure [whatever options you use] CFLAGS="-ansi" OR: ../configure [whatever] CFLAGS="-std=c99" ...depending on which standard we want to uphold the code to. '-Wall' is already specified in the makefile, so we don't need to worry about that one. Also, add '-pedantic' to CFLAGS if you want to cause non-comformity warnings to turn into errors. Ian doug sanden wrote: > John, > Great thanks. For those working downstream that's going to be a big help. > in the Mar27_2009 folder I put 3 SVN-style diff files > - _all.diff - has all win32 porting related diffs from 1.22 rc2 - not > what you asked for > - _culled.diff - ANSI-C related diffs ... but I don't have a good diff > editor so I went with a text editor. But I didn't edit within a hunk, > so there are a few non-ANSI C (ie win32 port) things mixed in with a > few hunks > - _mainloop.diff - I did this one separately - I had trouble with line > endings. I assume OSX is LF. > > http://cid-4a0d5f15141a58d5.skydrive.live.com/browse.aspx/GPUGroupX3D?authkey=4bdDXsKjZ2k%24 > > > I looked for a strict=off option for the ms compiler -none. I wonder > if gcc has a strict=on so you could see what we see. > -Doug > > > From: ale...@cr... > > To: fre...@li... > > Date: Fri, 27 Mar 2009 13:14:59 -0400 > > Subject: [FreeWRL] win32, pointer maths. was Re: Win32 - glut > > > > Doug; > > > > > PLUS: ANSI C differences: > > > 1. variable definitions at top of scope - in ANSI C you define all > > > your variables at the top of scope before using any of them. there > > > were a couple of dozen places I had to change to get it to compile. > > > I didn't try gcc - I was using the MS compiler. > > > > Send along the differences, and I'll try them in OSX. As Mufti can > > confirm; I sometimes add code that other compilers balk at; not > > intentionally, but it does happen by accident. > > > > > 2. initializing struct - you can't go like this > > > struct pthread_t bigthread = 0; > > > instead, lets say pthread_t is a struct with 2 ints, you go > > > struct pthread_t bigthread = {0,0}; > > > > Send the diffs along, too. > > > > > > > 3. void * pointer arithmetic - a no-no. so I had to guess at the > > > intentions of the author. > > > Did they mean 4-byte pointer size or just size in bytes > > > AddRemoveChildren(me->ptr, me->ptr+me->ofs, &node, 1, 1); > > > AddRemoveChildren(me->ptr, (void *)(((char*)(me->ptr))+me->ofs), > > > (uintptr_t *)&node, 1, 1); > > > > Yes, that is some of my code, from the days where FreeWRL was Perl > > based, and functions called via perl "XS" calls, so the casting got a > > bit convoluted. > > > > Anything dealing with the internals of nodes (90% of pointer maths) > > uses bytes. Code does get cleaned up when it gets re-worked. > > > > > I put the last version I did for win32 - it runs and shows 1.wrl > > > cone - in the usual place > > > > http://cid-4a0d5f15141a58d5.skydrive.live.com/browse.aspx/GPUGroupX3D?authkey=4bdDXsKjZ2k%24 > > > directory freeWrlwin32> Mar25_2009. The keys work but not the mouse, > > > and not jpeg textures and who knows what else. > > > > Wow! Good work. If you want to try simple routing, take 2.wrl, and > > remove the texture stuff. (Ie, remove: > > texture MultiTexture { > > mode [ "MODULATE" "ADD" ] > > texture [ > > ImageTexture { url > > "helpers/MTimage002.gif" } > > ImageTexture { url > > "helpers/MTimage004.jpg" } > > ] > > } > > ) > > > > This will test a lot of pointer maths for you. ;-) > > > > JohnS. > > > > _______________________________________________ > > FreeWRL mailing list > > Fr...@cr... > > ------------------------------------------------------------------------ > Make your Messenger window look the way you want. Express Yourself! > <http://go.microsoft.com/?linkid=9650733> > ------------------------------------------------------------------------ > > _______________________________________________ > FreeWRL mailing list > Fr...@cr... |