From 1a8de6352d068e0a45904cf9b80bde30561eca2f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 30 May 2019 00:30:46 +0200 Subject: dix/window.c: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Window.c:3827:46: warning: array subscript 128 is above array bounds of ‘StoringPixmapRec *[128]’ {aka ‘struct *[128]’} [-Warray-bounds] i, (void *) nxagentBSPixmapList[i]); --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index f602d0ed3..6758e0875 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3938,16 +3938,16 @@ int nxagentEmptyBSPixmapList(void) StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) { - int i; - - for (i = 0; i < BSPIXMAPLIMIT; i++) + for (int i = 0; i < BSPIXMAPLIMIT; i++) { if ((nxagentBSPixmapList[i] != NULL) && (nxagentBSPixmapList[i] -> storingPixmapId == pixmapId)) { #ifdef TEST - fprintf(stderr, "nxagentFindItemBSPixmapList: pixmapId [%lu].\n", pixmapId); - fprintf(stderr, "nxagentFindItemBSPixmapList: nxagentBSPixmapList[%d] -> storingPixmapId [%lu].\n", + fprintf(stderr, "%s: pixmapId [%lu].\n", __func__, pixmapId); + fprintf(stderr, "%s: nxagentBSPixmapList[%d] = [%p].\n", __func__, + i, (void *) nxagentBSPixmapList[i]); + fprintf(stderr, "%s: nxagentBSPixmapList[%d] -> storingPixmapId [%lu].\n", __func__, i, nxagentBSPixmapList[i] -> storingPixmapId); #endif @@ -3955,15 +3955,13 @@ StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) } } - #ifdef TEST - fprintf(stderr, "nxagentFindItemBSPixmapList: WARNING! Item not found.\n"); + #ifdef WARNING + fprintf(stderr, "%s: WARNING! Item not found.\n", __func__); #endif #ifdef TEST - fprintf(stderr, "nxagentFindItemBSPixmapList: Pixmap with id [%lu] not found.\n", + fprintf(stderr, "%s: Pixmap with id [%lu] not found.\n", __func__, pixmapId); - fprintf(stderr, "nxagentBSPixmapList[%d] = [%p].\n", - i, (void *) nxagentBSPixmapList[i]); #endif return NULL; -- cgit v1.2.3