Commit 1cc49f60 authored by Michael Catanzaro's avatar Michael Catanzaro

Enable and placate -Wswitch-enum and -Wswitch-default

I guess these aren't so bad....
parent beff7a53
......@@ -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
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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) {
......
......@@ -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);
}
}
......
......@@ -1674,6 +1674,9 @@ load_changed_cb (WebKitWebView *web_view,
ephy_web_view_thaw_history (view);
break;
default:
break;
}
g_object_thaw_notify (object);
......
......@@ -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);
}
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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 ();
}
......
......@@ -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.");
}
......
......@@ -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 ();
}
......
......@@ -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 ();
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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;
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment