From 15c5a7d913d64718ad85cdb78327134a5ae51c86 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20=C3=85strand?= Date: Mon, 26 Jan 2009 09:10:57 +0000 Subject: [PATCH] Eliminated several GCC warnings: * Initializing "vis" variable. * Using dixLookupResourceByType instead of deprecated dixLookupResource. * Using unsigned integers when dealing with unsigned numbers. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3573 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/XserverDesktop.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 203ad5ad..da4935ac 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -180,7 +180,7 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_, } format.bigEndian = (screenInfo.imageByteOrder == MSBFirst); - VisualPtr vis; + VisualPtr vis = NULL; for (i = 0; i < pScreen->numVisuals; i++) { if (pScreen->visuals[i].vid == pScreen->rootVisual) { vis = &pScreen->visuals[i]; @@ -263,7 +263,7 @@ void XserverDesktop::serverReset(ScreenPtr pScreen_) int i; pointer retval; - i = dixLookupResource(&retval, pScreen->defColormap, RT_COLORMAP, NullClient, + i = dixLookupResourceByType(&retval, pScreen->defColormap, RT_COLORMAP, NullClient, DixReadAccess); /* Handle suspicious conditions */ @@ -352,8 +352,8 @@ void XserverDesktop::setColourMapEntries(ColormapPtr pColormap, int ndef, { if (cmap != pColormap || ndef <= 0) return; - int first = pdef[0].pixel; - int n = 1; + unsigned int first = pdef[0].pixel; + unsigned int n = 1; for (int i = 1; i < ndef; i++) { if (first + n == pdef[i].pixel) { @@ -984,7 +984,8 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down) { KeyClassPtr keyc = vncKeyboardDevice->key; KeySymsPtr keymap = &keyc->curKeySyms; - int i, j, k, n; + unsigned int i, n; + int j, k; if (keysym == XK_Caps_Lock) { vlog.debug("Ignoring caps lock"); -- 2.39.5