[PATCH libXaw3d 3/5] Only use variable t in MoveThumb() on XAW_ARROW_SCROLLBARS

Guillem Jover guillem at hadrons.org
Mon Oct 3 20:35:01 PDT 2011


Fixes gcc warning:
Scrollbar.c: In function 'MoveThumb':
Scrollbar.c:1006:16: warning: variable 't' set but not used [-Wunused-but-set-variable]

Signed-off-by: Guillem Jover <guillem at hadrons.org>
---
 src/Scrollbar.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Scrollbar.c b/src/Scrollbar.c
index 02eb980..98aac74 100644
--- a/src/Scrollbar.c
+++ b/src/Scrollbar.c
@@ -1003,7 +1003,10 @@ MoveThumb (Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
     ScrollbarWidget sbw = (ScrollbarWidget) w;
     Position x, y;
-    float loc, t, s;
+    float loc, s;
+#ifdef XAW_ARROW_SCROLLBARS
+    float t;
+#endif
 
 #ifndef XAW_ARROW_SCROLLBARS
     if (sbw->scrollbar.direction == 0) return; /* if no StartScroll */
@@ -1015,9 +1018,9 @@ MoveThumb (Widget w, XEvent *event, String *params, Cardinal *num_params)
 
     ExtractPosition (event, &x, &y);
     loc = FractionLoc (sbw, x, y);
-    t = sbw->scrollbar.top;
     s = sbw->scrollbar.shown;
 #ifdef XAW_ARROW_SCROLLBARS
+    t = sbw->scrollbar.top;
     if (sbw->scrollbar.scroll_mode != 2 )
       /* initialize picked position */
       sbw->scrollbar.picked = (FloatInRange( loc, t, t + s ) - t);
-- 
1.7.6.3



More information about the xorg-devel mailing list