mirror of
https://github.com/X11Libre/xf86-video-nv.git
synced 2026-03-24 01:24:21 +00:00
riva_hw.c: Ensure ABS macro expands correctly
Handles warning from Oracle Parfait static analyser:
Error: Misleading macro
Misleading macro [misleading-macro]:
misleading evaluation of unary '-' operator in expansion of macro ABS due to missing parentheses
at line 104 of src/riva_hw.c.
binary '+' operator has lower precedence than unary '-' operator inside macro body at line 298
if (ABS(ainfo->vburst_size) + (ABS(ainfo->wcvlwm + 32) & ~0xf) - tmp> VFIFO_SIZE)
low precedence binary '+' operator is hidden by expansion of macro argument a at line 104
#define ABS(a) (a>0?a:-a)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
@@ -101,7 +101,7 @@ static int ShowHideCursor
|
||||
#define GFIFO_SIZE_128 256
|
||||
#define MFIFO_SIZE 120
|
||||
#define VFIFO_SIZE 256
|
||||
#define ABS(a) (a>0?a:-a)
|
||||
#define ABS(a) ((a) > 0 ? (a) : -(a))
|
||||
typedef struct {
|
||||
int gdrain_rate;
|
||||
int vdrain_rate;
|
||||
|
||||
Reference in New Issue
Block a user