因此,我在浏览非官方OpenGL库的strange部分时,发现了一些奇怪的东西。在其中一个函数中,指针参数被分配给自己,我看不出这是如何完成任何事情的。这是某种程度上迫使内存进入缓存,还是其他什么东西?可能是窃听器?
static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int hs)
{
// resample with nearest-neighbor
int i,j;
in_far = in_far; // <-- here?
for (i=0; i < w; ++i)
for (j=0; j < hs; ++j)
out[i*hs+j] = in_near[i];
return out;
}发布于 2013-10-04 04:23:13
它是为了抑制在函数中不使用参数in_far的警告。
另一种压制警告的方法是:
(void)in_far;https://stackoverflow.com/questions/19173165
复制相似问题