[gnumeric] Deal with new gcc warnings.



commit 12d54308033b45897537db227b69b5113be3f3f3
Author: Morten Welinder <terra gnome org>
Date:   Mon Jul 9 19:36:46 2018 -0400

    Deal with new gcc warnings.

 plugins/sylk/sylk.c | 67 +++++++++++++++++++++++++++--------------------------
 src/item-bar.c      |  3 ++-
 src/wbc-gtk.c       |  2 +-
 3 files changed, 37 insertions(+), 35 deletions(-)
---
diff --git a/plugins/sylk/sylk.c b/plugins/sylk/sylk.c
index a8d9fa710..89ccf07e6 100644
--- a/plugins/sylk/sylk.c
+++ b/plugins/sylk/sylk.c
@@ -579,44 +579,45 @@ sylk_rtd_f_parse (SylkReader *state, char *str)
                        break;
 
                case 'S':
-               for (str++ ; *str && *str != ';' ; str++)
-                       switch (*str) {
-                       case 'I':
-                               if (style == NULL) style = gnm_style_new ();
-                               gnm_style_set_font_italic (style, TRUE);
-                               break;
+                       for (str++ ; *str && *str != ';' ; str++) {
+                               switch (*str) {
+                               case 'I':
+                                       if (style == NULL) style = gnm_style_new ();
+                                       gnm_style_set_font_italic (style, TRUE);
+                                       break;
 
-                       case 'D':
-                               if (style == NULL) style = gnm_style_new ();
-                               gnm_style_set_font_bold (style, TRUE);
-                               break;
-
-                       case 'M':
-                               if (sylk_parse_int (str+1, &tmp) &&
-                                   1 <= tmp && tmp <= (int)state->fonts->len) {
-                                       GnmStyle const *font =
-                                               g_ptr_array_index (state->fonts, tmp-1);
+                               case 'D':
                                        if (style == NULL) style = gnm_style_new ();
-                                       gnm_style_merge_element (style, font,
-                                               MSTYLE_FONT_NAME);
-                                       gnm_style_merge_element (style, font,
-                                               MSTYLE_FONT_SIZE);
-                               }
-                               str = (char *)" ";
-                               break;
+                                       gnm_style_set_font_bold (style, TRUE);
+                                       break;
 
-                       case 'S': /* seems to stipple things */
-                               if (style == NULL) style = gnm_style_new ();
-                               gnm_style_set_pattern (style, 5);
-                               break;
+                               case 'M':
+                                       if (sylk_parse_int (str+1, &tmp) &&
+                                           1 <= tmp && tmp <= (int)state->fonts->len) {
+                                               GnmStyle const *font =
+                                                       g_ptr_array_index (state->fonts, tmp-1);
+                                               if (style == NULL) style = gnm_style_new ();
+                                               gnm_style_merge_element (style, font,
+                                                                        MSTYLE_FONT_NAME);
+                                               gnm_style_merge_element (style, font,
+                                                                        MSTYLE_FONT_SIZE);
+                                       }
+                                       str = (char *)" ";
+                                       break;
 
-                       case 'T': style = sylk_set_border (style, MSTYLE_BORDER_TOP); break;
-                       case 'B': style = sylk_set_border (style, MSTYLE_BORDER_BOTTOM); break;
-                       case 'L': style = sylk_set_border (style, MSTYLE_BORDER_LEFT); break;
-                       case 'R': style = sylk_set_border (style, MSTYLE_BORDER_RIGHT); break;
+                               case 'S': /* seems to stipple things */
+                                       if (style == NULL) style = gnm_style_new ();
+                                       gnm_style_set_pattern (style, 5);
+                                       break;
+
+                               case 'T': style = sylk_set_border (style, MSTYLE_BORDER_TOP); break;
+                               case 'B': style = sylk_set_border (style, MSTYLE_BORDER_BOTTOM); break;
+                               case 'L': style = sylk_set_border (style, MSTYLE_BORDER_LEFT); break;
+                               case 'R': style = sylk_set_border (style, MSTYLE_BORDER_RIGHT); break;
 
-                       default:
-                               sylk_read_warning (state, "unhandled style S%c.", *str);
+                               default:
+                                       sylk_read_warning (state, "unhandled style S%c.", *str);
+                               }
                        }
                        break;
 
diff --git a/src/item-bar.c b/src/item-bar.c
index 6b991904c..4bb55f151 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -736,9 +736,10 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr,
                                                                cairo_move_to (cr, left+3,          
bottom+size/2);
                                                                cairo_line_to (cr, left+size-4, 
bottom+size/2);
                                                        }
-                                               } else if (level > 0)
+                                               } else if (level > 0) {
                                                        cairo_move_to (cr, pos,      top+pixels/2);
                                                        cairo_line_to (cr, pos+len,  top+pixels/2);
+                                               }
                                        }
                                        cairo_stroke (cr);
                                        cairo_restore (cr);
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 22bb70ca9..6738cf35b 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -3584,7 +3584,7 @@ toolbar_context_menu (GtkToolbar *tb, WBCGtk *gtk, GdkEvent *event)
        static const struct {
                char const *text;
                GtkPositionType pos;
-       } const pos_items[] = {
+       } pos_items[] = {
                { N_("Display toolbar above sheets"), GTK_POS_TOP },
                { N_("Display toolbar to the left of sheets"), GTK_POS_LEFT },
                { N_("Display toolbar to the right of sheets"), GTK_POS_RIGHT }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]