Opening Macro definitions: tdfx_span.c: lvalue required as left operand of assignment
Posted
by
anttir
on Stack Overflow
See other posts from Stack Overflow
or by anttir
Published on 2011-01-02T13:03:51Z
Indexed on
2011/01/02
17:53 UTC
Read the original article
Hit count: 262
Hi,
I'm trying to compile X11R6-7.0 under Ubuntu maverick and got some weird compilation errors I'm unable to resolve myself.
I needed X11R6-7.0 as ati catalyst drivers don't support newer xorg and oss drivers don't support 3d acceleration of my hardware.
Anyone know what this error message means? I know some C but I got a bit confused. Does it mean GET_FB_DATA macro returned NULL or some method/property not set?
Any further insight how to "debug" preprocessor definitions at this point would be great. I don't think I can print anything useful with #error.
The error I get:
tdfx_span.c: In function ‘tdfxDDWriteDepthPixels’:
tdfx_span.c:976: error: lvalue required as left operand of assignment
tdfx_span.c:1008: error: lvalue required as left operand of assignment
tdfx_span.c: In function ‘write_stencil_pixels’:
tdfx_span.c:1242: error: lvalue required as left operand of assignment
the Code:
958- switch (depth_size) {
959- case 16:
960- GetBackBufferInfo(fxMesa, &backBufferInfo);
961- /*
962- * Note that the _LOCK macro adds a curly brace,
963- * and the UNLOCK macro removes it.
964- */
965- WRITE_FB_SPAN_LOCK(fxMesa, info,
966- GR_BUFFER_AUXBUFFER, GR_LFBWRITEMODE_ANY);
967- {
968- LFBParameters ReadParams;
969- GetFbParams(fxMesa, &info, &backBufferInfo,
970- &ReadParams, sizeof(GLushort));
971- for (i = 0; i < n; i++) {
972- if (mask[i] && visible_pixel(fxMesa, x[i], y[i])) {
973- xpos = x[i] + fxMesa->x_offset;
974- ypos = bottom - y[i];
975- d16 = depth[i];
976: PUT_FB_DATA(&ReadParams, GLushort, xpos, ypos, d16);
977- }
978- }
979- }
980- WRITE_FB_SPAN_UNLOCK(fxMesa, GR_BUFFER_AUXBUFFER);
981- break;
982- case 24:
And relative macros:
#define GET_FB_DATA(ReadParamsp, type, x, y) \
(((x) < (ReadParamsp)->firstWrappedX) \
? (((type *)((ReadParamsp)->lfbPtr)) \
[(y) * ((ReadParamsp)->LFBStrideInElts) \
+ (x)]) \
: (((type *)((ReadParamsp)->lfbWrapPtr)) \
[((y)) * ((ReadParamsp)->LFBStrideInElts) \
+ ((x) - (ReadParamsp)->firstWrappedX)]))
#define GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) \
(((type *)((ReadParamsp)->lfbPtr)) \
[(y) * ((ReadParamsp)->LFBStrideInElts) \
+ (x)])
#define GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) \
(((type *)((ReadParamsp)->lfbWrapPtr)) \
[((y)) * ((ReadParamsp)->LFBStrideInElts) \
+ ((x) - (ReadParamsp)->firstWrappedX)])
#define PUT_FB_DATA(ReadParamsp, type, x, y, value) \
(GET_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
#define PUT_ORDINARY_FB_DATA(ReadParamsp, type, x, y, value) \
(GET_ORDINARY_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
#define PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value) \
(GET_WRAPPED_FB_DATA(ReadParamsp, type, x, y) = (type)(value))
The LFBParameters Struct
483-typedef struct
484-{
485- void *lfbPtr;
486- void *lfbWrapPtr;
487- FxU32 LFBStrideInElts;
488- GLint firstWrappedX;
489-}
490:LFBParameters;
Thanks for looking.
© Stack Overflow or respective owner