Building glide3x/cvg, gcc emits the following warning:
gglide.c: In function `grBufferClear':
gglide.c:733: warning: suggest parentheses around arithmetic in operand of |
... but glide2x/cvg is silent for it, because commit df4085a80 from
about 18 years ago added parentheses to silence it, like:
GR_SET(BROADCAST_ID, hw, bltSize,
- ( ((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3) - 1));
+ ((((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3)) - 1));
... which seems wrong. Substraction has precedence, therefore the
original code OR'ed the size by 511, but the fixed code OR'ed the
size by 512 and then substracted 1 from the result.
Looking at sst1InitVideoBuffers() init/video.c: it sets sst->bltSize
like:
ISET(sst->bltSize, ((pagesToFill-1)<<16) | 511);
Therefore, reverting this part of df4085a80 now. We can live with the
warning.