[PATCH 1/3] kdrive: fix "set but not used" warnings

Peter Hutterer peter.hutterer at who-t.net
Thu Feb 14 17:19:08 PST 2013


kinput.c: In function 'KdEnqueueKeyboardEvent':
kinput.c:1845:16: warning: variable 'ctrl' set but not used
kinput.c:1844:17: warning: variable 'keyc' set but not used

kinput.c: In function 'KdEnqueuePointerEvent':
kinput.c:1887:12: warning: variable 'ms' set but not used

kxv.c: In function 'KdXVDisable':
kxv.c:1181:19: warning: variable 'ScreenPriv' set but not used

mouse.c: In function 'ps2SkipInit':
mouse.c:444:9: warning: variable 'skipping' set but not used
mouse.c: In function 'ps2Init':
mouse.c:473:10: warning: variable 'waiting' set but not used
mouse.c:472:9: warning: variable 'skipping' set but not used

fbdev.c: In function 'fbdevRandRSetConfig':
fbdev.c:468:19: warning: variable 'newheight' set but not used
fbdev.c:468:9: warning: variable 'newwidth' set but not used

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Found this and the other two on a long-lost branch, but they still apply, so
whoopee.

 hw/kdrive/fbdev/fbdev.c | 10 ----------
 hw/kdrive/linux/mouse.c |  6 ------
 hw/kdrive/src/kinput.c  |  8 --------
 hw/kdrive/src/kxv.c     |  2 --
 4 files changed, 26 deletions(-)

diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index fd14afa..fb6e3a2 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -465,16 +465,6 @@ fbdevRandRSetConfig(ScreenPtr pScreen,
     int oldheight;
     int oldmmwidth;
     int oldmmheight;
-    int newwidth, newheight;
-
-    if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) {
-        newwidth = pSize->width;
-        newheight = pSize->height;
-    }
-    else {
-        newwidth = pSize->height;
-        newheight = pSize->width;
-    }
 
     if (wasEnabled)
         KdDisableScreen(pScreen);
diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c
index c875077..f442447 100644
--- a/hw/kdrive/linux/mouse.c
+++ b/hw/kdrive/linux/mouse.c
@@ -441,10 +441,8 @@ ps2SkipInit(KdPointerInfo * pi, int ninit, Bool ret_next)
 {
     Kmouse *km = pi->driverPrivate;
     int c = -1;
-    int skipping;
     Bool waiting;
 
-    skipping = 0;
     waiting = FALSE;
     while (ninit || ret_next) {
         c = MouseReadByte(&km->iob, MOUSE_TIMEOUT);
@@ -469,8 +467,6 @@ static Bool
 ps2Init(KdPointerInfo * pi)
 {
     Kmouse *km = pi->driverPrivate;
-    int skipping;
-    Bool waiting;
     int id;
     unsigned char *init;
     int ninit;
@@ -483,8 +479,6 @@ ps2Init(KdPointerInfo * pi)
      */
     if (!MouseWriteByte(km->iob.fd, PSMC_SEND_DEV_ID, 100))
         return FALSE;
-    skipping = 0;
-    waiting = FALSE;
     id = ps2SkipInit(pi, 0, TRUE);
     switch (id) {
     case 3:
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index b1068bb..c30f170 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1821,16 +1821,11 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki,
                        unsigned char scan_code, unsigned char is_up)
 {
     unsigned char key_code;
-    KeyClassPtr keyc = NULL;
-    KeybdCtrl *ctrl = NULL;
     int type;
 
     if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed || !ki->dixdev->key)
         return;
 
-    keyc = ki->dixdev->key;
-    ctrl = &ki->dixdev->kbdfeed->ctrl;
-
     if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode) {
         key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode;
 
@@ -1864,7 +1859,6 @@ void
 KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
                       int rz)
 {
-    CARD32 ms;
     unsigned char buttons;
     int x, y, z;
     int (*matrix)[3] = kdPointerMatrix.matrix;
@@ -1875,8 +1869,6 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
     if (!pi)
         return;
 
-    ms = GetTimeInMillis();
-
     /* we don't need to transform z, so we don't. */
     if (flags & KD_MOUSE_DELTA) {
         if (pi->transformCoordinates) {
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index cf65636..2263972 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -1174,7 +1174,6 @@ void
 KdXVDisable(ScreenPtr pScreen)
 {
     XvScreenPtr pxvs;
-    KdXVScreenPtr ScreenPriv;
     XvAdaptorPtr pAdaptor;
     XvPortPtr pPort;
     XvPortRecPrivatePtr pPriv;
@@ -1184,7 +1183,6 @@ KdXVDisable(ScreenPtr pScreen)
         return;
 
     pxvs = GET_XV_SCREEN(pScreen);
-    ScreenPriv = GET_KDXV_SCREEN(pScreen);
 
     for (i = 0; i < pxvs->nAdaptors; i++) {
         pAdaptor = &pxvs->pAdaptors[i];
-- 
1.8.1.2



More information about the xorg-devel mailing list