[nautilus] canvas-container: fix warning of possible non handled value in switch



commit 4b2f6d5dcf9be3e23d9aae3c49f514d6f7737471
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Feb 27 16:10:33 2017 +0100

    canvas-container: fix warning of possible non handled value in switch
    
    We added a new enum value, but we didn't handled it on places where
    we knew it couldn't be reached. However that spits out a warning with
    gcc even if we handled it after the switch.
    
    Fix that handling a "default" and returning a default value.

 src/nautilus-canvas-container.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index 69140c8..65c5c10 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -385,8 +385,13 @@ nautilus_canvas_container_get_grid_size_for_zoom_level (NautilusCanvasZoomLevel
             return LARGER_ICON_GRID_WIDTH;
         }
         break;
+
+        default:
+        {
+            g_return_val_if_reached (STANDARD_ICON_GRID_WIDTH);
+        }
+        break;
     }
-    g_return_val_if_reached (STANDARD_ICON_GRID_WIDTH);
 }
 
 guint
@@ -417,8 +422,13 @@ nautilus_canvas_container_get_icon_size_for_zoom_level (NautilusCanvasZoomLevel
             return NAUTILUS_CANVAS_ICON_SIZE_LARGER;
         }
         break;
+
+        default:
+        {
+            g_return_val_if_reached (NAUTILUS_CANVAS_ICON_SIZE_STANDARD);
+        }
+        break;
     }
-    g_return_val_if_reached (NAUTILUS_CANVAS_ICON_SIZE_STANDARD);
 }
 
 static void


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