gpt4 book ai didi

c - 打开宏定义 : tdfx_span. c: 需要左值作为赋值的左操作数

转载 作者:太空宇宙 更新时间:2023-11-04 04:57:25 24 4
gpt4 key购买 nike

我尝试在 Ubuntu maverick 下编译 X11R6-7.0,遇到了一些我无法自行解决的奇怪编译错误。

我需要 X11R6-7.0,因为 ati 催化剂驱动程序不支持较新的 xorg,而 oss 驱动程序不支持我的硬件的 3d 加速。

有人知道这条错误信息是什么意思吗?我知道一些 C 但我有点困惑。这是否意味着 GET_FB_DATA 宏返回了 NULL 或某些方法/属性未设置?

任何进一步了解如何在这一点上“调试”预处理器定义都会很棒。我不认为我可以使用 #error 打印任何有用的东西。

我得到的错误:

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

代码:

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:

和相关宏:

#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))

LFBParameters 结构

483-typedef struct
484-{
485- void *lfbPtr;
486- void *lfbWrapPtr;
487- FxU32 LFBStrideInElts;
488- GLint firstWrappedX;
489-}
490:LFBParameters;

最佳答案

不,当然这不是因为指针为 0。这表明类型错误。正如消息所说,您需要在赋值的左侧有一个左值。 (这听起来很正常,不是吗?)

我猜想其中一个宏会以某种方式返回一个指针值,而您却没有取消引用它。

关于c - 打开宏定义 : tdfx_span. c: 需要左值作为赋值的左操作数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4578475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com