CodeQL IncorrectNotOperatorUsage.ql rtrDcmppose.c rtrCLEAR() usages

Maybe it was a single bit and '!' operator inverted a single bit, but it
 appears to be a 4-bit mask today.

TODO check rtrMARKED() this looks like it uses '&' operator is in use
 but from the context of a bitmask maybe this should be '|' operator.
This commit is contained in:
Darryl L. Miles 2025-02-13 08:22:28 +00:00 committed by Tim Edwards
parent ca9229b35a
commit 6a537c4659
1 changed files with 2 additions and 1 deletions

View File

@ -53,6 +53,7 @@
/* rtrMARK(t,s) Tile * t; int s;
* Mark the indicated horizontal tile edge as a valid channel boundary.
* FIXME this looks suspect, maybe it should be '|' operator and not '&'.
*/
#define rtrMARK(t,s) \
((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(s))))
@ -61,7 +62,7 @@
* Clear the indicated horizontal tile edge as a valid channel boundary.
*/
#define rtrCLEAR(t,s) \
((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(!s))))
((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(~s))))
/* Private Procedures */
int rtrSrPaint();