[X2Go-Commits] [nx-libs] 176/429: Colormap.c: fix parentheses

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:24 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 28fef3bc06e9325202920fc21f42d2506e8f2b2e
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Mon Aug 3 16:38:19 2020 +0200

    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."
---
 nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c
index 9308390fe..099c76af4 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c
@@ -482,7 +482,7 @@ void nxagentResolveColor(unsigned short *pRed, unsigned short *pGreen,
     unsigned int limg = pVisual->ColormapEntries - 1;
     /* rescale to gray then [0..limg] then [0..65535] then rgb bits */
     *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;
   }
   else

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list