Question

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;
Was it helpful?

Solution

No, certainly this is not because a pointer is 0. This indicates that a type is wrong. As the message says, you need an lvalue on the left of an assignment. (which sounds normal, doesn't it?)

I'd guess that somehow one of the macros returns a pointer value and you are missing to dereference it.

OTHER TIPS

Your macro expands to:

(
(
  ((xpos) < (&ReadParams)->firstWrappedX) ?
  (((GLushort *)((&ReadParams)->lfbPtr)) [(ypos) * ((&ReadParams)->LFBStrideInElts) + (xpos)])
  :
  (((GLushort *)((&ReadParams)->lfbWrapPtr)) [((ypos)) * ((&ReadParams)->LFBStrideInElts) + ((xpos) - (&ReadParams)->firstWrappedX)])) = (GLushort)(d16)
);

So basically it is doing (some thing like):

   ((GLushort *)((&ReadParams)->lfbWrapPtr))[SOME_INDEX] = (GLushort)(d16);

Which I don't think is right and causing the problem. Is this what you are expecting?

You're probably not going to like to hear this, but X11R6 is ancient by most standards. Which video card do you have and why is fglrx required? Looking at my wall, I don't have any ATI/AMD chipsets which require fglrx; only the very newest chipsets, like the Cayman, require it, and fglrx for those chipsets won't build on X11R6 anyway.

Anyway, if you absolutely insist on doing this, you probably should build mesa with --with-dri-drivers=swrast as this will prevent drivers like tdfx_dri from being built. Surely you don't have a Voodoo that needs to be accelerated as well, right? :3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top