[yocto] [matchbox-wm][PATCH 3/3] Fix "unused variable" warnings

Jussi Kukkonen jussi.kukkonen at intel.com
Wed Dec 7 05:22:57 PST 2016


Some were removed as unused, some just silenced with the gcc
attribute since they were actually somehow used and fixing
otherwise would have been more invasive.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen at intel.com>
---
 src/ewmh.c    | 6 ++++--
 src/mbtheme.c | 7 -------
 src/wm.c      | 2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/ewmh.c b/src/ewmh.c
index 17ea48a..afcabe7 100644
--- a/src/ewmh.c
+++ b/src/ewmh.c
@@ -1257,8 +1257,9 @@ int
 ewmh_utf8_len(unsigned char *str) /* Only parse _validated_ utf8 */
 {
   unsigned char *p = str;
+  int len, result = 0;
+  __attribute__((unused)) int mask;
 
-  int mask, len, result = 0;
   while (*p != '\0')
     {
       UTF8_COMPUTE(*p, mask, len);
@@ -1273,8 +1274,9 @@ int
 ewmh_utf8_get_byte_cnt(unsigned char *str, int num_chars)
 {
   unsigned char *p = str;
+  int len, result = 0;
+  __attribute__((unused)) int mask;
 
-  int mask, len, result = 0;
   while (*p != '\0' && num_chars-- > 0)
     {
       UTF8_COMPUTE(*p, mask, len);
diff --git a/src/mbtheme.c b/src/mbtheme.c
index 42459a0..821195a 100644
--- a/src/mbtheme.c
+++ b/src/mbtheme.c
@@ -602,7 +602,6 @@ theme_frame_paint( MBTheme *theme,
   MBThemeFrame     *frame;
   MBPixbufImage    *img;
   MBThemeLayer     *layer_label = NULL, *layer_icon = NULL;
-  struct list_item *layer_list_item;
   int               label_rendered_width;
   int               decor_idx = 0;
   MBDrawable       *drawable = NULL;
@@ -699,8 +698,6 @@ theme_frame_paint( MBTheme *theme,
       img = theme->img_caches[frame_type];
     }
 
-  layer_list_item = frame->layers;
-
   layer_label = (MBThemeLayer*)list_find_by_id(frame->layers, LAYER_LABEL);
 
   /* Figure out text alignment + positioning */
@@ -981,7 +978,6 @@ theme_frame_menu_highlight_entry(Client         *c,
   MBDrawable    *drw;
   MBThemeFrame  *frame;
   MBFont        *font;
-  MBColor       *color;
   Client        *entry = (Client *)button->data;
   int            offset, item_h;
 
@@ -991,7 +987,6 @@ theme_frame_menu_highlight_entry(Client         *c,
     return;
 
   font  = frame->font;
-  color = frame->color;
 
   if (frame->hl_color)
     {
@@ -1982,7 +1977,6 @@ parse_color_tag (MBTheme *theme,
 		 XMLNode *node)
 {
   MBColor *color = NULL;
-  int alpha;
   char *id     = get_attr(node, "id");
   char *spec   = get_attr(node, "def");
 
@@ -1990,7 +1984,6 @@ parse_color_tag (MBTheme *theme,
     {
       fprintf(stderr, "matchbox *warning*: alpha attribute in theme.xml color tar is depreciated\n                    Use def='rrggbbaa' format instead to specify alpha\n"); 
     }
-  else alpha = 0xff;
 
   dbg("%s() id : %s , def : %s\n", __func__, id, spec);
 
diff --git a/src/wm.c b/src/wm.c
index cb033c6..0823fef 100644
--- a/src/wm.c
+++ b/src/wm.c
@@ -2621,7 +2621,7 @@ wm_activate_client(Client *c)
       /* As matchbox works around 'main' windows ( apps/main and desktop wins).
 	 We need to sync extra stuff up when displaying a new one.
        */
-      Bool switching_from_to_fullscreen = False;
+      __attribute__((unused)) Bool switching_from_to_fullscreen = False;
 
       /* save focus state for transient dialogs of prev showing main win */
 
-- 
2.11.0




More information about the yocto mailing list