Commit d6581d4c authored by Michael Catanzaro's avatar Michael Catanzaro

Enable and placate -Wno-shadow

parent 44be8d85
...@@ -37,7 +37,7 @@ AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release], [-Wdeclaratio ...@@ -37,7 +37,7 @@ AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release], [-Wdeclaratio
dnl TODO: Remove all of these! These warnings should be fixed, not 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 silenced. At least, for the most part. -Wswitch-enum really does
dnl seem pretty dumb. dnl seem pretty dumb.
[-Wno-shadow -Wno-deprecated-declarations -Wno-switch-enum -Wno-switch-default -Wno-redundant-decls -Wno-discarded-qualifiers -Wno-sign-compare]) [-Wno-deprecated-declarations -Wno-switch-enum -Wno-switch-default -Wno-redundant-decls -Wno-discarded-qualifiers -Wno-sign-compare])
AC_PROG_CC AC_PROG_CC
......
...@@ -594,9 +594,9 @@ ephy_embed_shell_setup_process_model (EphyEmbedShell *shell) ...@@ -594,9 +594,9 @@ ephy_embed_shell_setup_process_model (EphyEmbedShell *shell)
} }
static void static void
ephy_embed_shell_create_web_context (EphyEmbedShell *embed_shell) ephy_embed_shell_create_web_context (EphyEmbedShell *shell)
{ {
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (embed_shell); EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
WebKitWebsiteDataManager *manager; WebKitWebsiteDataManager *manager;
char *data_dir; char *data_dir;
char *cache_dir; char *cache_dir;
...@@ -770,18 +770,18 @@ ephy_embed_shell_get_property (GObject *object, ...@@ -770,18 +770,18 @@ ephy_embed_shell_get_property (GObject *object,
static void static void
ephy_embed_shell_constructed (GObject *object) ephy_embed_shell_constructed (GObject *object)
{ {
EphyEmbedShell *embed_shell; EphyEmbedShell *shell;
EphyEmbedShellPrivate *priv; EphyEmbedShellPrivate *priv;
G_OBJECT_CLASS (ephy_embed_shell_parent_class)->constructed (object); G_OBJECT_CLASS (ephy_embed_shell_parent_class)->constructed (object);
embed_shell = EPHY_EMBED_SHELL (object); shell = EPHY_EMBED_SHELL (object);
priv = ephy_embed_shell_get_instance_private (embed_shell); priv = ephy_embed_shell_get_instance_private (shell);
/* These do not run the EmbedShell application instance, so make sure that /* These do not run the EmbedShell application instance, so make sure that
there is a web context and a user content manager for them. */ there is a web context and a user content manager for them. */
if (ephy_embed_shell_get_mode (embed_shell) == EPHY_EMBED_SHELL_MODE_TEST || if (ephy_embed_shell_get_mode (shell) == EPHY_EMBED_SHELL_MODE_TEST ||
ephy_embed_shell_get_mode (embed_shell) == EPHY_EMBED_SHELL_MODE_SEARCH_PROVIDER) { ephy_embed_shell_get_mode (shell) == EPHY_EMBED_SHELL_MODE_SEARCH_PROVIDER) {
ephy_embed_shell_create_web_context (embed_shell); ephy_embed_shell_create_web_context (shell);
priv->user_content = webkit_user_content_manager_new (); priv->user_content = webkit_user_content_manager_new ();
} }
} }
......
...@@ -202,7 +202,7 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id) ...@@ -202,7 +202,7 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id)
g_return_if_fail (context_id != 0); g_return_if_fail (context_id != 0);
for (list = embed->messages; list; list = list->next) { for (list = embed->messages; list; list = list->next) {
EphyEmbedStatusbarMsg *msg = list->data; msg = list->data;
if (msg->context_id == context_id) { if (msg->context_id == context_id) {
embed->messages = g_slist_remove_link (embed->messages, list); embed->messages = g_slist_remove_link (embed->messages, list);
......
...@@ -365,7 +365,7 @@ ephy_file_helpers_init (const char *profile_dir, ...@@ -365,7 +365,7 @@ ephy_file_helpers_init (const char *profile_dir,
for (i = 0; i < G_N_ELEMENTS (files_to_copy); i++) for (i = 0; i < G_N_ELEMENTS (files_to_copy); i++)
{ {
char *filename; char *filename;
GError *error = NULL; GError *err = NULL;
GFile *source, *destination; GFile *source, *destination;
filename = g_build_filename (profile_dir, filename = g_build_filename (profile_dir,
...@@ -382,11 +382,11 @@ ephy_file_helpers_init (const char *profile_dir, ...@@ -382,11 +382,11 @@ ephy_file_helpers_init (const char *profile_dir,
g_file_copy (source, destination, g_file_copy (source, destination,
G_FILE_COPY_OVERWRITE, G_FILE_COPY_OVERWRITE,
NULL, NULL, NULL, &error); NULL, NULL, NULL, &err);
if (error) if (error)
{ {
printf("Error stealing file %s from profile: %s\n", files_to_copy[i], error->message); printf("Error stealing file %s from profile: %s\n", files_to_copy[i], err->message);
g_error_free (error); g_error_free (err);
} }
g_object_unref (source); g_object_unref (source);
...@@ -614,10 +614,10 @@ load_mime_from_xml (void) ...@@ -614,10 +614,10 @@ load_mime_from_xml (void)
} }
else if (xmlStrEqual (tag, (const xmlChar *)"mime-type")) else if (xmlStrEqual (tag, (const xmlChar *)"mime-type"))
{ {
xmlChar *type; xmlChar *t;
type = xmlTextReaderGetAttribute (reader, (const xmlChar *)"type"); t = xmlTextReaderGetAttribute (reader, (const xmlChar *)"type");
g_hash_table_insert (mime_table, type, g_hash_table_insert (mime_table, t,
GINT_TO_POINTER (permission)); GINT_TO_POINTER (permission));
} }
...@@ -665,7 +665,7 @@ ephy_file_check_mime (const char *mime_type) ...@@ -665,7 +665,7 @@ ephy_file_check_mime (const char *mime_type)
/** /**
* ephy_file_launch_application: * ephy_file_launch_application:
* @app: the application to launch * @app: the application to launch
* @files: files to pass to @app * @list: files to pass to @app
* @user_time: user time to prevent focus stealing * @user_time: user time to prevent focus stealing
* @widget: a relevant widget from where to get the #GdkScreen and #GdkDisplay * @widget: a relevant widget from where to get the #GdkScreen and #GdkDisplay
* *
...@@ -677,7 +677,7 @@ ephy_file_check_mime (const char *mime_type) ...@@ -677,7 +677,7 @@ ephy_file_check_mime (const char *mime_type)
**/ **/
gboolean gboolean
ephy_file_launch_application (GAppInfo *app, ephy_file_launch_application (GAppInfo *app,
GList *files, GList *list,
guint32 user_time, guint32 user_time,
GtkWidget *widget) GtkWidget *widget)
{ {
...@@ -701,7 +701,7 @@ ephy_file_launch_application (GAppInfo *app, ...@@ -701,7 +701,7 @@ ephy_file_launch_application (GAppInfo *app,
gdk_app_launch_context_set_screen (context, screen); gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, user_time); gdk_app_launch_context_set_timestamp (context, user_time);
res = g_app_info_launch (app, files, res = g_app_info_launch (app, list,
G_APP_LAUNCH_CONTEXT (context), NULL); G_APP_LAUNCH_CONTEXT (context), NULL);
g_object_unref (context); g_object_unref (context);
......
...@@ -1361,8 +1361,8 @@ ephy_node_get_previous_child (EphyNode *node, ...@@ -1361,8 +1361,8 @@ ephy_node_get_previous_child (EphyNode *node,
* ephy_node_signal_connect_object: * ephy_node_signal_connect_object:
* @node: an #EphyNode * @node: an #EphyNode
* @type: signal type * @type: signal type
* @callback: (scope notified): the callback to connect * @cb: (scope notified): the callback to connect
* @object: data to pass to @callback * @object: data to pass to @cb
* *
* Connects a callback function to the @type signal of @node. * Connects a callback function to the @type signal of @node.
* *
...@@ -1371,7 +1371,7 @@ ephy_node_get_previous_child (EphyNode *node, ...@@ -1371,7 +1371,7 @@ ephy_node_get_previous_child (EphyNode *node,
int int
ephy_node_signal_connect_object (EphyNode *node, ephy_node_signal_connect_object (EphyNode *node,
EphyNodeSignalType type, EphyNodeSignalType type,
EphyNodeCallback callback, EphyNodeCallback cb,
GObject *object) GObject *object)
{ {
EphyNodeSignalData *signal_data; EphyNodeSignalData *signal_data;
...@@ -1384,7 +1384,7 @@ ephy_node_signal_connect_object (EphyNode *node, ...@@ -1384,7 +1384,7 @@ ephy_node_signal_connect_object (EphyNode *node,
signal_data = g_slice_new0 (EphyNodeSignalData); signal_data = g_slice_new0 (EphyNodeSignalData);
signal_data->node = node; signal_data->node = node;
signal_data->id = node->signal_id; signal_data->id = node->signal_id;
signal_data->callback = callback; signal_data->callback = cb;
signal_data->type = type; signal_data->type = type;
signal_data->data = object; signal_data->data = object;
...@@ -1433,10 +1433,10 @@ invalidate_matching_signal_data (gpointer key, ...@@ -1433,10 +1433,10 @@ invalidate_matching_signal_data (gpointer key,
* ephy_node_signal_disconnect_object: * ephy_node_signal_disconnect_object:
* @node: an #EphyNode * @node: an #EphyNode
* @type: signal type * @type: signal type
* @callback: (scope notified): the callback to disconnect * @cb: (scope notified): the callback to disconnect
* @object: data passed to @callback when it was connected * @object: data passed to @cb when it was connected
* *
* Disconnects @callback from @type in @node. @callback is identified by the * Disconnects @cb from @type in @node. @cb is identified by the
* @object previously passed in ephy_node_signal_connect_object. * @object previously passed in ephy_node_signal_connect_object.
* *
* Returns: the number of signal handlers removed * Returns: the number of signal handlers removed
...@@ -1444,14 +1444,14 @@ invalidate_matching_signal_data (gpointer key, ...@@ -1444,14 +1444,14 @@ invalidate_matching_signal_data (gpointer key,
guint guint
ephy_node_signal_disconnect_object (EphyNode *node, ephy_node_signal_disconnect_object (EphyNode *node,
EphyNodeSignalType type, EphyNodeSignalType type,
EphyNodeCallback callback, EphyNodeCallback cb,
GObject *object) GObject *object)
{ {
EphyNodeSignalData user_data; EphyNodeSignalData user_data;
g_return_val_if_fail (EPHY_IS_NODE (node), 0); g_return_val_if_fail (EPHY_IS_NODE (node), 0);
user_data.callback = callback; user_data.callback = cb;
user_data.type = type; user_data.type = type;
user_data.data = object; user_data.data = object;
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include <sys/types.h> #include <sys/types.h>
static int do_step_n = -1; static int do_step_n = -1;
static int version = -1; static int migration_version = -1;
static char *profile_dir = NULL; static char *profile_dir = NULL;
static GMainLoop *loop = NULL; static GMainLoop *loop = NULL;
...@@ -205,7 +205,7 @@ parse_and_decrypt_signons (const char *signons, ...@@ -205,7 +205,7 @@ parse_and_decrypt_signons (const char *signons,
if (g_strstr_len (lines[begin], -1, realmBracketBegin)) { if (g_strstr_len (lines[begin], -1, realmBracketBegin)) {
char *start_ptr, *end_ptr; char *start_ptr, *end_ptr;
char *full_url, *url; char *full_url, *url;
glong start, end; glong start, ending;
/* In this case the scheme may not exist. We assume that the /* In this case the scheme may not exist. We assume that the
* scheme is HTTP. * scheme is HTTP.
...@@ -224,8 +224,8 @@ parse_and_decrypt_signons (const char *signons, ...@@ -224,8 +224,8 @@ parse_and_decrypt_signons (const char *signons,
start += strlen (realmBracketBegin); start += strlen (realmBracketBegin);
end_ptr = g_strstr_len (full_url, -1, realmBracketEnd) -1; end_ptr = g_strstr_len (full_url, -1, realmBracketEnd) -1;
end = g_utf8_pointer_to_offset (full_url, end_ptr); ending = g_utf8_pointer_to_offset (full_url, end_ptr);
realm = g_utf8_substring (full_url, start, end); realm = g_utf8_substring (full_url, start, ending);
g_free (full_url); g_free (full_url);
} else { } else {
...@@ -1060,7 +1060,7 @@ static const GOptionEntry option_entries[] = ...@@ -1060,7 +1060,7 @@ static const GOptionEntry option_entries[] =
{ {
{ "do-step", 'd', 0, G_OPTION_ARG_INT, &do_step_n, { "do-step", 'd', 0, G_OPTION_ARG_INT, &do_step_n,
N_("Executes only the n-th migration step"), NULL }, N_("Executes only the n-th migration step"), NULL },
{ "version", 'v', 0, G_OPTION_ARG_INT, &version, { "version", 'v', 0, G_OPTION_ARG_INT, &migration_version,
N_("Specifies the required version for the migrator"), NULL }, N_("Specifies the required version for the migrator"), NULL },
{ "profile-dir", 'p', 0, G_OPTION_ARG_FILENAME, &profile_dir, { "profile-dir", 'p', 0, G_OPTION_ARG_FILENAME, &profile_dir,
N_("Specifies the profile where the migrator should run"), NULL }, N_("Specifies the profile where the migrator should run"), NULL },
...@@ -1096,8 +1096,9 @@ main (int argc, char *argv[]) ...@@ -1096,8 +1096,9 @@ main (int argc, char *argv[])
g_option_context_free (option_context); g_option_context_free (option_context);
if (version != -1 && version != EPHY_PROFILE_MIGRATION_VERSION) { if (migration_version != -1 && migration_version != EPHY_PROFILE_MIGRATION_VERSION) {
g_print ("Version mismatch, version %d requested but our version is %d\n", version, EPHY_PROFILE_MIGRATION_VERSION); g_print ("Version mismatch, version %d requested but our version is %d\n",
migration_version, EPHY_PROFILE_MIGRATION_VERSION);
return 1; return 1;
} }
......
...@@ -104,10 +104,10 @@ ephy_snapshot_service_prepare_snapshot (cairo_surface_t *surface, ...@@ -104,10 +104,10 @@ ephy_snapshot_service_prepare_snapshot (cairo_surface_t *surface,
g_object_unref (snapshot); g_object_unref (snapshot);
x_offset = 6;
if (favicon) { if (favicon) {
GdkPixbuf* fav_pixbuf; GdkPixbuf* fav_pixbuf;
int favicon_size = 16; int favicon_size = 16;
int x_offset = 6;
int y_offset = gdk_pixbuf_get_height (scaled) - favicon_size - x_offset; int y_offset = gdk_pixbuf_get_height (scaled) - favicon_size - x_offset;
fav_pixbuf = ephy_pixbuf_get_from_surface_scaled (favicon, favicon_size, favicon_size); fav_pixbuf = ephy_pixbuf_get_from_surface_scaled (favicon, favicon_size, favicon_size);
......
...@@ -614,38 +614,38 @@ import_dialog_response_cb (GtkDialog *dialog, ...@@ -614,38 +614,38 @@ import_dialog_response_cb (GtkDialog *dialog,
if (filename == NULL) if (filename == NULL)
{ {
EphyFileChooser *dialog; EphyFileChooser *chooser;
GtkFileFilter *filter; GtkFileFilter *filter;
dialog = ephy_file_chooser_new (_("Import Bookmarks from File"), chooser = ephy_file_chooser_new (_("Import Bookmarks from File"),
GTK_WIDGET (editor), GTK_WIDGET (editor),
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_FILE_CHOOSER_ACTION_OPEN,
EPHY_FILE_FILTER_NONE); EPHY_FILE_FILTER_NONE);
ephy_file_chooser_add_mime_filter ephy_file_chooser_add_mime_filter
(dialog, (chooser,
_("Firefox/Mozilla bookmarks"), _("Firefox/Mozilla bookmarks"),
"application/x-mozilla-bookmarks", NULL); "application/x-mozilla-bookmarks", NULL);
ephy_file_chooser_add_mime_filter ephy_file_chooser_add_mime_filter
(dialog, _("Galeon/Konqueror bookmarks"), (chooser, _("Galeon/Konqueror bookmarks"),
"application/x-xbel", NULL); "application/x-xbel", NULL);
ephy_file_chooser_add_mime_filter ephy_file_chooser_add_mime_filter
(dialog, _("Web bookmarks"), (chooser, _("Web bookmarks"),
"text/rdf", "application/rdf+xml", NULL); "text/rdf", "application/rdf+xml", NULL);
filter = ephy_file_chooser_add_pattern_filter (dialog, filter = ephy_file_chooser_add_pattern_filter (chooser,
_("All files"), _("All files"),
"*", NULL); "*", NULL);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser),
filter); filter);
g_signal_connect (dialog, "response", g_signal_connect (chooser, "response",
G_CALLBACK (import_from_file_response_cb), editor); G_CALLBACK (import_from_file_response_cb), editor);
gtk_widget_show (GTK_WIDGET (dialog)); gtk_widget_show (GTK_WIDGET (chooser));
} }
else else
{ {
......
...@@ -253,7 +253,7 @@ main (int argc, ...@@ -253,7 +253,7 @@ main (int argc,
if (argc >= 2 && strcmp (argv[1], "-remote") == 0) { if (argc >= 2 && strcmp (argv[1], "-remote") == 0) {
const char *opening, *closing; const char *opening, *closing;
char *command, *argument; char *command, *argument;
char **arguments; char **arg_list;
if (argc != 3) { if (argc != 3) {
g_print ("-remote allows exactly one argument\n"); g_print ("-remote allows exactly one argument\n");
...@@ -285,19 +285,19 @@ main (int argc, ...@@ -285,19 +285,19 @@ main (int argc,
g_free (command); g_free (command);
argument = g_strstrip (g_strndup (opening + 1, closing - opening - 1)); argument = g_strstrip (g_strndup (opening + 1, closing - opening - 1));
arguments = g_strsplit (argument, ",", -1); arg_list = g_strsplit (argument, ",", -1);
g_free (argument); g_free (argument);
if (arguments == NULL) { if (arg_list == NULL) {
g_print ("Invalid argument for -remote\n"); g_print ("Invalid argument for -remote\n");
exit (1); exit (1);
} }
/* replace arguments */ /* replace arguments */
argv[1] = g_strstrip (g_strdup (arguments[0])); argv[1] = g_strstrip (g_strdup (arg_list[0]));
argc = 2; argc = 2;
g_strfreev (arguments); g_strfreev (arg_list);
} }
/* Initialise our debug helpers */ /* Initialise our debug helpers */
......
...@@ -1204,7 +1204,7 @@ view_source_embedded (const char *uri, EphyEmbed *embed) ...@@ -1204,7 +1204,7 @@ view_source_embedded (const char *uri, EphyEmbed *embed)
static void static void
save_temp_source_close_cb (GOutputStream *ostream, GAsyncResult *result, gpointer data) save_temp_source_close_cb (GOutputStream *ostream, GAsyncResult *result, gpointer data)
{ {
char *uri; const char *uri;
GFile *file; GFile *file;
GError *error = NULL; GError *error = NULL;
...@@ -1216,14 +1216,13 @@ save_temp_source_close_cb (GOutputStream *ostream, GAsyncResult *result, gpointe ...@@ -1216,14 +1216,13 @@ save_temp_source_close_cb (GOutputStream *ostream, GAsyncResult *result, gpointe
return; return;
} }
uri = (char*)g_object_get_data (G_OBJECT (ostream), "ephy-save-temp-source-uri"); uri = (const char*)g_object_get_data (G_OBJECT (ostream), "ephy-save-temp-source-uri");
file = g_file_new_for_uri (uri); file = g_file_new_for_uri (uri);
if (!ephy_file_launch_handler ("text/plain", file, gtk_get_current_event_time ())) if (!ephy_file_launch_handler ("text/plain", file, gtk_get_current_event_time ()))
{ {
/* Fallback to view the source inside the browser */ /* Fallback to view the source inside the browser */
const char *uri;
EphyEmbed *embed; EphyEmbed *embed;
uri = (const char*) g_object_get_data (G_OBJECT (ostream), uri = (const char*) g_object_get_data (G_OBJECT (ostream),
......
...@@ -206,7 +206,7 @@ test_snapshot_and_timed_cancellation (void) ...@@ -206,7 +206,7 @@ test_snapshot_and_timed_cancellation (void)
} }
static void static void
server_callback (SoupServer *server, SoupMessage *msg, server_callback (SoupServer *s, SoupMessage *msg,
const char *path, GHashTable *query, const char *path, GHashTable *query,
SoupClientContext *context, gpointer data) SoupClientContext *context, gpointer data)
{ {
......
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