[epiphany] Enable and placate -Wswitch-enum and -Wswitch-default
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Enable and placate -Wswitch-enum and -Wswitch-default
- Date: Sun, 27 Dec 2015 04:34:20 +0000 (UTC)
commit 1cc49f609cc56346269781ece0f56d632f37b133
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sat Dec 26 22:28:12 2015 -0600
Enable and placate -Wswitch-enum and -Wswitch-default
I guess these aren't so bad....
configure.ac | 6 ++----
embed/ephy-embed-shell.c | 2 ++
embed/ephy-embed.c | 2 ++
embed/ephy-file-monitor.c | 7 +++++++
embed/ephy-find-toolbar.c | 5 +++++
embed/ephy-web-view.c | 3 +++
lib/ephy-node-db.c | 4 ++++
lib/ephy-node-filter.c | 11 +++++++++++
lib/ephy-node.c | 3 +++
lib/ephy-smaps.c | 1 +
lib/history/ephy-history-service-urls-table.c | 1 +
lib/widgets/ephy-certificate-dialog.c | 4 ++++
lib/widgets/ephy-security-popover.c | 2 ++
lib/widgets/ephy-zoom-action.c | 4 ++++
src/bookmarks/ephy-bookmark-action.c | 4 ++++
src/bookmarks/ephy-bookmarks-import.c | 3 +++
src/bookmarks/ephy-topic-action.c | 4 ++++
src/ephy-notebook.c | 4 ++++
18 files changed, 66 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 69e0508..de3153c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,10 +34,8 @@ AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])
AX_CHECK_ENABLE_DEBUG([yes])
AX_CODE_COVERAGE
AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release], [],
- dnl TODO: Remove all of these! These warnings should be fixed, not
- dnl silenced. At least, for the most part. -Wswitch-enum really does
- dnl seem pretty dumb.
- [-Wno-deprecated-declarations -Wno-switch-enum -Wno-switch-default])
+ dnl TODO: Remove! These warnings should be fixed, not silenced.
+ [-Wno-deprecated-declarations])
AC_PROG_CC
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index ffefbd5..2efacdb 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -587,6 +587,8 @@ ephy_embed_shell_setup_process_model (EphyEmbedShell *shell)
case EPHY_PREFS_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW:
max_processes = g_settings_get_uint (EPHY_SETTINGS_MAIN, EPHY_PREFS_MAX_PROCESSES);
break;
+ default:
+ g_assert_not_reached ();
}
webkit_web_context_set_process_model (priv->web_context,
WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 3e1925a..7fadba1 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -287,6 +287,8 @@ load_changed_cb (WebKitWebView *web_view,
!webkit_web_view_get_title (web_view))
ephy_embed_set_title (embed, NULL);
break;
+ case WEBKIT_LOAD_STARTED:
+ case WEBKIT_LOAD_REDIRECTED:
default:
break;
}
diff --git a/embed/ephy-file-monitor.c b/embed/ephy-file-monitor.c
index 69da675..7e2e069 100644
--- a/embed/ephy-file-monitor.c
+++ b/embed/ephy-file-monitor.c
@@ -128,6 +128,13 @@ ephy_file_monitor_changed_cb (GFileMonitor *monitor,
default:
should_reload = FALSE;
break;
+
+ /* These events will never be sent: */
+ case G_FILE_MONITOR_EVENT_MOVED:
+ case G_FILE_MONITOR_EVENT_RENAMED:
+ case G_FILE_MONITOR_EVENT_MOVED_IN:
+ case G_FILE_MONITOR_EVENT_MOVED_OUT:
+ g_assert_not_reached ();
}
if (should_reload) {
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c
index ed796f1..2b3405d 100644
--- a/embed/ephy-find-toolbar.c
+++ b/embed/ephy-find-toolbar.c
@@ -107,6 +107,9 @@ set_status (EphyFindToolbar *toolbar,
icon_name = "view-wrapped-symbolic";
tooltip = _("Search wrapped back to the top");
break;
+
+ default:
+ g_assert_not_reached ();
}
gtk_widget_set_sensitive (toolbar->prev, result != EPHY_FIND_RESULT_NOTFOUND);
@@ -511,6 +514,8 @@ ephy_find_toolbar_set_property (GObject *object,
case PROP_WEB_VIEW:
ephy_find_toolbar_set_web_view (toolbar, (WebKitWebView *) g_value_get_object
(value));
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 08499b0..5075efb 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1674,6 +1674,9 @@ load_changed_cb (WebKitWebView *web_view,
ephy_web_view_thaw_history (view);
break;
+
+ default:
+ break;
}
g_object_thaw_notify (object);
diff --git a/lib/ephy-node-db.c b/lib/ephy-node-db.c
index 44c45bf..58e570b 100644
--- a/lib/ephy-node-db.c
+++ b/lib/ephy-node-db.c
@@ -72,6 +72,8 @@ ephy_node_db_get_property (GObject *object,
case PROP_IMMUTABLE:
g_value_set_boolean (value, ephy_node_db_is_immutable (db));
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
@@ -91,6 +93,8 @@ ephy_node_db_set_property (GObject *object,
case PROP_IMMUTABLE:
ephy_node_db_set_immutable (db, g_value_get_boolean (value));
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
diff --git a/lib/ephy-node-filter.c b/lib/ephy-node-filter.c
index a7cee39..24744be 100644
--- a/lib/ephy-node-filter.c
+++ b/lib/ephy-node-filter.c
@@ -280,6 +280,7 @@ ephy_node_filter_expression_new (EphyNodeFilterExpressionType type,
exp->args.prop_args.prop_id = va_arg (valist, int);
exp->args.prop_args.second_arg.number = va_arg (valist, int);
break;
+ case EPHY_NODE_FILTER_EXPRESSION_ALWAYS_TRUE:
default:
break;
}
@@ -300,6 +301,16 @@ ephy_node_filter_expression_free (EphyNodeFilterExpression *exp)
case EPHY_NODE_FILTER_EXPRESSION_KEY_PROP_EQUALS:
g_free (exp->args.prop_args.second_arg.string);
break;
+ case EPHY_NODE_FILTER_EXPRESSION_ALWAYS_TRUE:
+ case EPHY_NODE_FILTER_EXPRESSION_NODE_EQUALS:
+ case EPHY_NODE_FILTER_EXPRESSION_EQUALS:
+ case EPHY_NODE_FILTER_EXPRESSION_HAS_PARENT:
+ case EPHY_NODE_FILTER_EXPRESSION_HAS_CHILD:
+ case EPHY_NODE_FILTER_EXPRESSION_NODE_PROP_EQUALS:
+ case EPHY_NODE_FILTER_EXPRESSION_CHILD_PROP_EQUALS:
+ case EPHY_NODE_FILTER_EXPRESSION_INT_PROP_EQUALS:
+ case EPHY_NODE_FILTER_EXPRESSION_INT_PROP_BIGGER_THAN:
+ case EPHY_NODE_FILTER_EXPRESSION_INT_PROP_LESS_THAN:
default:
break;
}
diff --git a/lib/ephy-node.c b/lib/ephy-node.c
index 8f02e1d..9216a38 100644
--- a/lib/ephy-node.c
+++ b/lib/ephy-node.c
@@ -159,6 +159,9 @@ callback (long id, EphyNodeSignalData *data, gpointer *dummy)
case EPHY_NODE_CHILDREN_REORDERED:
data->callback (data->node, va_arg (valist, int *), data->data);
break;
+
+ default:
+ break;
}
va_end(valist);
diff --git a/lib/ephy-smaps.c b/lib/ephy-smaps.c
index 5aa0b77..7a5f378 100644
--- a/lib/ephy-smaps.c
+++ b/lib/ephy-smaps.c
@@ -75,6 +75,7 @@ static const char *get_ephy_process_name (EphyProcess process)
case EPHY_PROCESS_PLUGIN:
return "Plugin Process";
case EPHY_PROCESS_OTHER:
+ default:
g_assert_not_reached ();
}
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index 35a92b9..ad39bff 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -299,6 +299,7 @@ ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery *
case EPHY_HISTORY_SORT_URL_DESCENDING:
statement_str = g_string_append (statement_str, "ORDER BY LOWER(urls.url) DESC ");
break;
+ case EPHY_HISTORY_SORT_NONE:
default:
g_warning ("We don't support this sorting method yet.");
}
diff --git a/lib/widgets/ephy-certificate-dialog.c b/lib/widgets/ephy-certificate-dialog.c
index 83ec1e0..30d3708 100644
--- a/lib/widgets/ephy-certificate-dialog.c
+++ b/lib/widgets/ephy-certificate-dialog.c
@@ -175,6 +175,10 @@ ephy_certificate_dialog_constructed (GObject *object)
gtk_label_set_text (GTK_LABEL (priv->text), _("This certificate is valid. However, "
"resources on this page were sent insecurely."));
break;
+ case EPHY_SECURITY_LEVEL_TO_BE_DETERMINED:
+ case EPHY_SECURITY_LEVEL_NO_SECURITY:
+ case EPHY_SECURITY_LEVEL_UNACCEPTABLE_CERTIFICATE:
+ case EPHY_SECURITY_LEVEL_LOCAL_PAGE:
default:
g_assert_not_reached ();
}
diff --git a/lib/widgets/ephy-security-popover.c b/lib/widgets/ephy-security-popover.c
index 4f3cca5..3c7c88c 100644
--- a/lib/widgets/ephy-security-popover.c
+++ b/lib/widgets/ephy-security-popover.c
@@ -136,6 +136,8 @@ ephy_security_popover_set_security_level (EphySecurityPopover *popover,
_("Your connection seems to be secure."));
gtk_widget_show (priv->host_label);
break;
+ case EPHY_SECURITY_LEVEL_TO_BE_DETERMINED:
+ case EPHY_SECURITY_LEVEL_LOCAL_PAGE:
default:
g_assert_not_reached ();
}
diff --git a/lib/widgets/ephy-zoom-action.c b/lib/widgets/ephy-zoom-action.c
index 1f6eb0c..1c80e71 100644
--- a/lib/widgets/ephy-zoom-action.c
+++ b/lib/widgets/ephy-zoom-action.c
@@ -126,6 +126,8 @@ ephy_zoom_action_set_property (GObject *object,
case PROP_ZOOM:
action->priv->zoom = g_value_get_float (value);
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
@@ -144,6 +146,8 @@ ephy_zoom_action_get_property (GObject *object,
case PROP_ZOOM:
g_value_set_float (value, action->priv->zoom);
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 4baca2b..3f0a28c 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -337,6 +337,8 @@ ephy_bookmark_action_set_property (GObject *object,
case PROP_ICON:
/* not writable */
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
@@ -370,6 +372,8 @@ ephy_bookmark_action_get_property (GObject *object,
ephy_node_get_property_string (priv->node,
EPHY_NODE_BMK_PROP_ICON));
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c
index ef4ea6f..72ce993 100644
--- a/src/bookmarks/ephy-bookmarks-import.c
+++ b/src/bookmarks/ephy-bookmarks-import.c
@@ -777,6 +777,9 @@ ephy_bookmarks_import_mozilla (EphyBookmarks *bookmarks,
g_free (parsedname);
break;
+ case NS_NOTES:
+ case NS_SEPARATOR:
+ case NS_UNKNOWN:
default:
break;
}
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index 9a31f83..016dba1 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -299,6 +299,8 @@ ephy_topic_action_set_property (GObject *object,
case PROP_MANAGER:
priv->manager = g_value_get_object (value);
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
@@ -319,6 +321,8 @@ ephy_topic_action_get_property (GObject *object,
case PROP_MANAGER:
g_value_set_object (value, priv->manager);
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 352d913..340bf73 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -105,6 +105,8 @@ ephy_notebook_get_property (GObject *object,
case PROP_TABS_ALLOWED:
g_value_set_boolean (value, priv->tabs_allowed);
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
@@ -121,6 +123,8 @@ ephy_notebook_set_property (GObject *object,
case PROP_TABS_ALLOWED:
ephy_notebook_set_tabs_allowed (notebook, g_value_get_boolean (value));
break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]