|
|
There is a bug in the treatment of COLOUR vs EXPRESS and various conversions
between those two. The default definition for the data below is (from
frame.h):
#define COLC float
#define DBL double
typedef COLC COLOUR [5];
typedef DBL EXPRESS [5];
#define Assign_Colour(d,s) memcpy((d),(s),sizeof(COLOUR))
In function Parse_RValue in parse.c the following happens:
// definition
void **DataPtr; // treated as COLOUR*
EXPRESS Local_Express;
...
case 5: // line 5019 in 3.1g source code
*NumberPtr = COLOUR_ID_TOKEN;
Test_Redefine(Previous,NumberPtr,*DataPtr);
*DataPtr = (void *) Create_Colour();
Assign_Colour(*DataPtr, Local_Express);
break;
With the default definition of COLOUR and EXPRESS, the memcpy in
Assign_Colour will copy 5 * sizeof(float) bytes, but as usually
sizeof(double) != sizeof(float), the assignment does not work.
How to fix this problem:
#define Assign_Colour(d,s) (d)[RED] = (s)[RED]; (d)[GREEN] = (s)[GREEN];
(d)[BLUE] = (s)[BLUE]; (d)[FILTER] = (s)[FILTER]; (d)[TRANSM] = (s)[TRANSM];
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|