Commit 28fef3bc authored by Ulrich Sibiller's avatar Ulrich Sibiller

Colormap.c: fix parentheses

PVS Studio: "V592 The expression was enclosed by parentheses twice: '((* pRed * (limg + 1)))'. One pair of parentheses is unnecessary or misprint is present."
parent 36d7e152
...@@ -482,7 +482,7 @@ void nxagentResolveColor(unsigned short *pRed, unsigned short *pGreen, ...@@ -482,7 +482,7 @@ void nxagentResolveColor(unsigned short *pRed, unsigned short *pGreen,
unsigned int limg = pVisual->ColormapEntries - 1; unsigned int limg = pVisual->ColormapEntries - 1;
/* rescale to gray then [0..limg] then [0..65535] then rgb bits */ /* rescale to gray then [0..limg] then [0..65535] then rgb bits */
*pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100; *pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100;
*pRed = ((((*pRed * (limg + 1))) >> 16) * 65535) / limg; *pRed = (((*pRed * (limg + 1)) >> 16) * 65535) / limg;
*pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim; *pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim;
} }
else else
......
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