Commit e5386011 authored by Alan Coopersmith's avatar Alan Coopersmith
Browse files

int10: wrap entire V_ADDR_R* macros in parens for safer expansion



Resolves warnings from Oracle Parfait static analyser:

Error: Misleading macro
   Misleading macro [misleading-macro]:
      misleading evaluation of ternary '?:' operator in expansion of macro V_ADDR_RB due to missing parentheses
        at line 392 of hw/xfree86/int10/generic.c.
        '|' operator has higher precedence than ternary '?:' operator inside macro body at line 431
        low precedence ternary '?:' operator is hidden by expansion of macro V_ADDR_RB at line 431
   Misleading macro [misleading-macro]:
      misleading evaluation of ternary '?:' operator in expansion of macro V_ADDR_RB due to missing parentheses
        at line 392 of hw/xfree86/int10/generic.c.
        '<<' operator has higher precedence than ternary '?:' operator inside macro body at line 431
        low precedence ternary '?:' operator is hidden by expansion of macro V_ADDR_RB at line 431
   Misleading macro [misleading-macro]:
      misleading evaluation of ternary '?:' operator in expansion of macro V_ADDR_RB due to missing parentheses
        at line 392 of hw/xfree86/int10/generic.c.
        '<<' operator has higher precedence than ternary '?:' operator inside macro body at line 442
        low precedence ternary '?:' operator is hidden by expansion of macro V_ADDR_RB at line 442
   Misleading macro [misleading-macro]:
      misleading evaluation of ternary '?:' operator in expansion of macro V_ADDR_RB due to missing parentheses
        at line 392 of hw/xfree86/int10/generic.c.
        '<<' operator has higher precedence than ternary '?:' operator inside macro body at line 443
        low precedence ternary '?:' operator is hidden by expansion of macro V_ADDR_RB at line 443
   Misleading macro [misleading-macro]:
      misleading evaluation of ternary '?:' operator in expansion of macro V_ADDR_RB due to missing parentheses
        at line 392 of hw/xfree86/int10/generic.c.
        '|' operator has higher precedence than ternary '?:' operator inside macro body at line 443
        low precedence ternary '?:' operator is hidden by expansion of macro V_ADDR_RB at line 441
   Misleading macro [misleading-macro]:
      misleading evaluation of ternary '?:' operator in expansion of macro V_ADDR_RB due to missing parentheses
        at line 392 of hw/xfree86/int10/generic.c.
        '<<' operator has higher precedence than ternary '?:' operator inside macro body at line 443
        low precedence ternary '?:' operator is hidden by expansion of macro V_ADDR_RB at line 443
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent a6574033
Pipeline #230466 passed with stages
in 9 minutes and 39 seconds
......@@ -389,14 +389,14 @@ xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
#define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE)))
#define V_ADDR_RB(addr) \
(VRAM(addr)) ? MMIO_IN8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr)) \
: *(uint8_t*) V_ADDR(addr)
((VRAM(addr)) ? MMIO_IN8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr)) \
: *(uint8_t*) V_ADDR(addr))
#define V_ADDR_RW(addr) \
(VRAM(addr)) ? MMIO_IN16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr)) \
: ldw_u((void *)V_ADDR(addr))
((VRAM(addr)) ? MMIO_IN16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr)) \
: ldw_u((void *)V_ADDR(addr)))
#define V_ADDR_RL(addr) \
(VRAM(addr)) ? MMIO_IN32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr)) \
: ldl_u((void *)V_ADDR(addr))
((VRAM(addr)) ? MMIO_IN32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr)) \
: ldl_u((void *)V_ADDR(addr)))
#define V_ADDR_WB(addr,val) \
if(VRAM(addr)) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment