From: Peter Åstrand Date: Mon, 26 Jan 2009 09:10:57 +0000 (+0000) Subject: Eliminated several GCC warnings: X-Git-Tag: v0.0.90~188 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=15c5a7d913d64718ad85cdb78327134a5ae51c86;p=tigervnc.git 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 --- 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");