[easytag/wip/ax-compile-warnings: 4/12] Add missing default cases in switch statements



commit 0a6d0228a7cd2ea8a92fe502f15d07a09a44d4f0
Author: David King <amigadave amigadave com>
Date:   Fri Jan 30 13:35:25 2015 +0000

    Add missing default cases in switch statements

 src/application_window.c |    3 +++
 src/browser.c            |    9 +++++++++
 src/cddb_dialog.c        |    3 +++
 src/file_list.c          |    3 +++
 src/load_files_dialog.c  |    3 +++
 src/playlist_dialog.c    |    6 ++++++
 src/scan_dialog.c        |    6 ++++++
 src/tag_area.c           |    6 +++++-
 src/tags/opus_header.c   |    3 +++
 src/tags/vcedit.c        |    6 ++++++
 10 files changed, 47 insertions(+), 1 deletions(-)
---
diff --git a/src/application_window.c b/src/application_window.c
index ffa7cff..ea27c72 100644
--- a/src/application_window.c
+++ b/src/application_window.c
@@ -553,6 +553,9 @@ on_delete (GSimpleAction *action,
                 et_application_window_file_area_set_sensitive (self, TRUE);
 
                 return; /*We stop all actions. */
+            default:
+                g_assert_not_reached ();
+                break;
         }
     }
 
diff --git a/src/browser.c b/src/browser.c
index 3319ac6..bb86d73 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -700,6 +700,9 @@ Browser_Tree_Key_Press (GtkWidget *tree, GdkEvent *event, gpointer data)
                 gtk_tree_path_free(treePath);
                 return TRUE;
                 break;
+            /* Ignore all other keypresses. */
+            default:
+                break;
         }
         gtk_tree_path_free(treePath);
     }
@@ -732,6 +735,9 @@ Browser_List_Key_Press (GtkWidget *list, GdkEvent *event, gpointer data)
                     g_action_group_activate_action (G_ACTION_GROUP (MainWindow),
                                                     "delete", NULL);
                     return TRUE;
+                /* Ignore all other keypresses. */
+                default:
+                    break;
             }
         }
     }
@@ -2210,6 +2216,9 @@ Browser_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
         case ET_SORT_MODE_DESCENDING_FILE_SAMPLERATE:
             result = ET_Comp_Func_Sort_File_By_Descending_File_Samplerate(ETFile1, ETFile2);
             break;
+        default:
+            g_assert_not_reached ();
+            break;
     }
 
     return result;
diff --git a/src/cddb_dialog.c b/src/cddb_dialog.c
index 0b8a041..b117628 100644
--- a/src/cddb_dialog.c
+++ b/src/cddb_dialog.c
@@ -3049,6 +3049,9 @@ Cddb_Track_List_Sort_Func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
             g_free(text1cp);
             g_free(text2cp);
             break;
+        default:
+            g_assert_not_reached ();
+            break;
     }
 
     return ret;
diff --git a/src/file_list.c b/src/file_list.c
index ee645a7..b92f288 100644
--- a/src/file_list.c
+++ b/src/file_list.c
@@ -1078,6 +1078,9 @@ ET_Sort_File_List (GList *ETFileList,
         case ET_SORT_MODE_DESCENDING_FILE_SAMPLERATE:
             etfilelist = 
g_list_sort(etfilelist,(GCompareFunc)ET_Comp_Func_Sort_File_By_Descending_File_Samplerate);
             break;
+        default:
+            g_assert_not_reached ();
+            break;
     }
     /* Save sorting mode (note: needed when called from UI). */
     g_settings_set_enum (MainSettings, "sort-mode", Sorting_Type);
diff --git a/src/load_files_dialog.c b/src/load_files_dialog.c
index 0c3a2d6..1d562a1 100644
--- a/src/load_files_dialog.c
+++ b/src/load_files_dialog.c
@@ -367,6 +367,9 @@ Load_Filename_List_Key_Press (GtkWidget *treeview, GdkEvent *event)
                 Load_Filename_List_Insert_Blank_Line(treeview);
                 return GDK_EVENT_STOP;
                 break;
+            default:
+                /* Ignore all other keypresses. */
+                break;
         }
     }
 
diff --git a/src/playlist_dialog.c b/src/playlist_dialog.c
index f0c6447..43dd1eb 100644
--- a/src/playlist_dialog.c
+++ b/src/playlist_dialog.c
@@ -226,6 +226,9 @@ write_playlist (EtPlaylistDialog *self, GFile *file, GError **error)
                         g_free (mask);
                         g_free (filename_generated_utf8);
                     }
+                    default:
+                        g_assert_not_reached ();
+                        break;
                 }
 
                 /* 3) Write the file path. */
@@ -345,6 +348,9 @@ write_playlist (EtPlaylistDialog *self, GFile *file, GError **error)
                     g_free (filename_generated_utf8);
                 }
                 break;
+                default:
+                    g_assert_not_reached ();
+                    break;
             }
 
             /* 3) Write the file path. */
diff --git a/src/scan_dialog.c b/src/scan_dialog.c
index 69eb467..989afbc 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -1240,6 +1240,9 @@ Scan_Process_Fields_Functions (EtScanDialog *self, gchar **string)
             break;
         case ET_PROCESS_FIELDS_CONVERT_NO_CHANGE:
             break;
+        default:
+            g_assert_not_reached ();
+            break;
     }
 
     /* FIXME: Use GSettings keys instead of toggle buton states. */
@@ -2069,6 +2072,9 @@ Mask_Editor_List_Key_Press (GtkWidget *widget,
                 Mask_Editor_List_Remove (self);
                 return GDK_EVENT_STOP;
                 break;
+            default:
+                /* Ignore all other keypresses. */
+                break;
         }
     }
 
diff --git a/src/tag_area.c b/src/tag_area.c
index e5658ac..7ddcce2 100644
--- a/src/tag_area.c
+++ b/src/tag_area.c
@@ -1893,7 +1893,8 @@ on_picture_save_button_clicked (GObject *object,
                 case PICTURE_FORMAT_GIF:
                     image_name = g_strdup ("image_name.gif");
                     break;
-                case PICTURE_FORMAT_UNKNOWN :
+                case PICTURE_FORMAT_UNKNOWN:
+                default:
                     image_name = g_strdup("image_name.ext");
                     break;
             }
@@ -2100,6 +2101,9 @@ on_picture_view_key_pressed (GtkTreeView *treeview,
                 on_picture_clear_button_clicked (G_OBJECT (priv->remove_image_toolitem),
                                                  self);
                 return GDK_EVENT_STOP;
+            default:
+                /* Ignore all other keypresses. */
+                break;
         }
     }
 
diff --git a/src/tags/opus_header.c b/src/tags/opus_header.c
index e4a95c0..9564407 100644
--- a/src/tags/opus_header.c
+++ b/src/tags/opus_header.c
@@ -122,6 +122,9 @@ et_opus_open_file (GFile *gfile, GError **error)
                              "First/last timestamp in a link failed checks");
                 g_assert (error == NULL || *error != NULL);
                 return NULL;
+            default:
+                g_assert_not_reached ();
+                break;
         }
     }
 
diff --git a/src/tags/vcedit.c b/src/tags/vcedit.c
index 70d66ed..9b2abef 100644
--- a/src/tags/vcedit.c
+++ b/src/tags/vcedit.c
@@ -577,6 +577,9 @@ vcedit_open (EtOggState *state,
                                     state->bookbuf = g_memdup (header->packet,
                                                                header->bytes);
                                     break;
+                                default:
+                                    g_assert_not_reached ();
+                                    break;
                             }
                             break;
                         case ET_OGG_KIND_SPEEX:
@@ -620,6 +623,9 @@ vcedit_open (EtOggState *state,
                                                  "Ogg Opus tags do not follow the specification");
                                     goto err;
                                     break;
+                                default:
+                                    g_assert_not_reached ();
+                                    break;
                             }
                             break;
 #endif


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