lorenz.c: use of uninitialized variable color
Hi, If you look at orbit2dlong() and orbit2dfloat(), they don't initialize the color variable. orbit3dlongcalc() and orbit3dfloatcalc() initialize color to 2. So I have followed the same method. I have added this change on the HEAD as well. If it should be something else, let me know. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Rich,
If you look at orbit2dlong() and orbit2dfloat(), they don't initialize the color variable. orbit3dlongcalc() and orbit3dfloatcalc() initialize color to 2. So I have followed the same method. I have added this change on the HEAD as well. If it should be something else, let me know.
Good catch! I believe the code relies on variables being initialized to 0 when no initialization value is supplied. Not always guaranteed to happen. Although, from looking at the images, I can't see how anyone would notice. 8-)) Jonathan
In article <1168810601.3514.26.camel@linux.site>, Jonathan Osuch <osuchj@avalon.net> writes:
Good catch!
I confess that the compiler caught it :-). I got a runtime trap when trying the lorenz type. I'm not sure how its doing it, but I suspect it inserts some code where the variable is first used to check for a magic value that is used to initialize the part of the stack containing local variables. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
participants (2)
-
Jonathan Osuch -
Richard