Skip to content

riva_hw.c: Ensure ABS macro expands correctly

Alan Coopersmith requested to merge alanc/xf86-video-nv:parfait into master

Handles warning from Oracle Parfait 11.2 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)

Merge request reports