summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2015-12-26 20:47:01 -0600
committerMichael Catanzaro <mcatanzaro@igalia.com>2015-12-26 22:33:35 -0600
commitd6581d4ce8ca69821485a09c71b8d7530717c2db (patch)
tree2a5fae8a6459d3110afb60b382d1f558105637af
parent44be8d856c4afcdb0e11dd3c55047e1e8b903ac7 (diff)
downloadepiphany-d6581d4ce8ca69821485a09c71b8d7530717c2db.tar.gz
Enable and placate -Wno-shadow
-rw-r--r--configure.ac2
-rw-r--r--embed/ephy-embed-shell.c16
-rw-r--r--embed/ephy-embed.c2
-rw-r--r--lib/ephy-file-helpers.c20
-rw-r--r--lib/ephy-node.c18
-rw-r--r--lib/ephy-profile-migrator.c15
-rw-r--r--lib/ephy-snapshot-service.c2
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c24
-rw-r--r--src/ephy-main.c10
-rw-r--r--src/window-commands.c5
-rw-r--r--tests/ephy-snapshot-service-test.c2
11 files changed, 58 insertions, 58 deletions
diff --git a/configure.ac b/configure.ac
index 8d599ec96..75eaae658 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 silenced. At least, for the most part. -Wswitch-enum really does
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
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 756464624..ffefbd5ad 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -594,9 +594,9 @@ ephy_embed_shell_setup_process_model (EphyEmbedShell *shell)
}
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;
char *data_dir;
char *cache_dir;
@@ -770,18 +770,18 @@ ephy_embed_shell_get_property (GObject *object,
static void
ephy_embed_shell_constructed (GObject *object)
{
- EphyEmbedShell *embed_shell;
+ EphyEmbedShell *shell;
EphyEmbedShellPrivate *priv;
G_OBJECT_CLASS (ephy_embed_shell_parent_class)->constructed (object);
- embed_shell = EPHY_EMBED_SHELL (object);
- priv = ephy_embed_shell_get_instance_private (embed_shell);
+ shell = EPHY_EMBED_SHELL (object);
+ priv = ephy_embed_shell_get_instance_private (shell);
/* These do not run the EmbedShell application instance, so make sure that
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 ||
- ephy_embed_shell_get_mode (embed_shell) == EPHY_EMBED_SHELL_MODE_SEARCH_PROVIDER) {
- ephy_embed_shell_create_web_context (embed_shell);
+ if (ephy_embed_shell_get_mode (shell) == EPHY_EMBED_SHELL_MODE_TEST ||
+ ephy_embed_shell_get_mode (shell) == EPHY_EMBED_SHELL_MODE_SEARCH_PROVIDER) {
+ ephy_embed_shell_create_web_context (shell);
priv->user_content = webkit_user_content_manager_new ();
}
}
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 42bf8abd2..3e1925a9a 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -202,7 +202,7 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id)
g_return_if_fail (context_id != 0);
for (list = embed->messages; list; list = list->next) {
- EphyEmbedStatusbarMsg *msg = list->data;
+ msg = list->data;
if (msg->context_id == context_id) {
embed->messages = g_slist_remove_link (embed->messages, list);
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index b0d4b078d..a2654c119 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -365,7 +365,7 @@ ephy_file_helpers_init (const char *profile_dir,
for (i = 0; i < G_N_ELEMENTS (files_to_copy); i++)
{
char *filename;
- GError *error = NULL;
+ GError *err = NULL;
GFile *source, *destination;
filename = g_build_filename (profile_dir,
@@ -382,11 +382,11 @@ ephy_file_helpers_init (const char *profile_dir,
g_file_copy (source, destination,
G_FILE_COPY_OVERWRITE,
- NULL, NULL, NULL, &error);
+ NULL, NULL, NULL, &err);
if (error)
{
- printf("Error stealing file %s from profile: %s\n", files_to_copy[i], error->message);
- g_error_free (error);
+ printf("Error stealing file %s from profile: %s\n", files_to_copy[i], err->message);
+ g_error_free (err);
}
g_object_unref (source);
@@ -614,10 +614,10 @@ load_mime_from_xml (void)
}
else if (xmlStrEqual (tag, (const xmlChar *)"mime-type"))
{
- xmlChar *type;
+ xmlChar *t;
- type = xmlTextReaderGetAttribute (reader, (const xmlChar *)"type");
- g_hash_table_insert (mime_table, type,
+ t = xmlTextReaderGetAttribute (reader, (const xmlChar *)"type");
+ g_hash_table_insert (mime_table, t,
GINT_TO_POINTER (permission));
}
@@ -665,7 +665,7 @@ ephy_file_check_mime (const char *mime_type)
/**
* ephy_file_launch_application:
* @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
* @widget: a relevant widget from where to get the #GdkScreen and #GdkDisplay
*
@@ -677,7 +677,7 @@ ephy_file_check_mime (const char *mime_type)
**/
gboolean
ephy_file_launch_application (GAppInfo *app,
- GList *files,
+ GList *list,
guint32 user_time,
GtkWidget *widget)
{
@@ -701,7 +701,7 @@ ephy_file_launch_application (GAppInfo *app,
gdk_app_launch_context_set_screen (context, screen);
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_object_unref (context);
diff --git a/lib/ephy-node.c b/lib/ephy-node.c
index fe0e1b60a..206f879c3 100644
--- a/lib/ephy-node.c
+++ b/lib/ephy-node.c
@@ -1361,8 +1361,8 @@ ephy_node_get_previous_child (EphyNode *node,
* ephy_node_signal_connect_object:
* @node: an #EphyNode
* @type: signal type
- * @callback: (scope notified): the callback to connect
- * @object: data to pass to @callback
+ * @cb: (scope notified): the callback to connect
+ * @object: data to pass to @cb
*
* Connects a callback function to the @type signal of @node.
*
@@ -1371,7 +1371,7 @@ ephy_node_get_previous_child (EphyNode *node,
int
ephy_node_signal_connect_object (EphyNode *node,
EphyNodeSignalType type,
- EphyNodeCallback callback,
+ EphyNodeCallback cb,
GObject *object)
{
EphyNodeSignalData *signal_data;
@@ -1384,7 +1384,7 @@ ephy_node_signal_connect_object (EphyNode *node,
signal_data = g_slice_new0 (EphyNodeSignalData);
signal_data->node = node;
signal_data->id = node->signal_id;
- signal_data->callback = callback;
+ signal_data->callback = cb;
signal_data->type = type;
signal_data->data = object;
@@ -1433,10 +1433,10 @@ invalidate_matching_signal_data (gpointer key,
* ephy_node_signal_disconnect_object:
* @node: an #EphyNode
* @type: signal type
- * @callback: (scope notified): the callback to disconnect
- * @object: data passed to @callback when it was connected
+ * @cb: (scope notified): the callback to disconnect
+ * @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.
*
* Returns: the number of signal handlers removed
@@ -1444,14 +1444,14 @@ invalidate_matching_signal_data (gpointer key,
guint
ephy_node_signal_disconnect_object (EphyNode *node,
EphyNodeSignalType type,
- EphyNodeCallback callback,
+ EphyNodeCallback cb,
GObject *object)
{
EphyNodeSignalData user_data;
g_return_val_if_fail (EPHY_IS_NODE (node), 0);
- user_data.callback = callback;
+ user_data.callback = cb;
user_data.type = type;
user_data.data = object;
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index 30a1fb8ad..698b94458 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -51,7 +51,7 @@
#include <sys/types.h>
static int do_step_n = -1;
-static int version = -1;
+static int migration_version = -1;
static char *profile_dir = NULL;
static GMainLoop *loop = NULL;
@@ -205,7 +205,7 @@ parse_and_decrypt_signons (const char *signons,
if (g_strstr_len (lines[begin], -1, realmBracketBegin)) {
char *start_ptr, *end_ptr;
char *full_url, *url;
- glong start, end;
+ glong start, ending;
/* In this case the scheme may not exist. We assume that the
* scheme is HTTP.
@@ -224,8 +224,8 @@ parse_and_decrypt_signons (const char *signons,
start += strlen (realmBracketBegin);
end_ptr = g_strstr_len (full_url, -1, realmBracketEnd) -1;
- end = g_utf8_pointer_to_offset (full_url, end_ptr);
- realm = g_utf8_substring (full_url, start, end);
+ ending = g_utf8_pointer_to_offset (full_url, end_ptr);
+ realm = g_utf8_substring (full_url, start, ending);
g_free (full_url);
} else {
@@ -1060,7 +1060,7 @@ static const GOptionEntry option_entries[] =
{
{ "do-step", 'd', 0, G_OPTION_ARG_INT, &do_step_n,
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 },
{ "profile-dir", 'p', 0, G_OPTION_ARG_FILENAME, &profile_dir,
N_("Specifies the profile where the migrator should run"), NULL },
@@ -1096,8 +1096,9 @@ main (int argc, char *argv[])
g_option_context_free (option_context);
- if (version != -1 && version != EPHY_PROFILE_MIGRATION_VERSION) {
- g_print ("Version mismatch, version %d requested but our version is %d\n", 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",
+ migration_version, EPHY_PROFILE_MIGRATION_VERSION);
return 1;
}
diff --git a/lib/ephy-snapshot-service.c b/lib/ephy-snapshot-service.c
index fc7744151..ce01a7cff 100644
--- a/lib/ephy-snapshot-service.c
+++ b/lib/ephy-snapshot-service.c
@@ -104,10 +104,10 @@ ephy_snapshot_service_prepare_snapshot (cairo_surface_t *surface,
g_object_unref (snapshot);
+ x_offset = 6;
if (favicon) {
GdkPixbuf* fav_pixbuf;
int favicon_size = 16;
- int x_offset = 6;
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);
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 904527ad5..d7e4c7750 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -614,38 +614,38 @@ import_dialog_response_cb (GtkDialog *dialog,
if (filename == NULL)
{
- EphyFileChooser *dialog;
+ EphyFileChooser *chooser;
GtkFileFilter *filter;
- dialog = ephy_file_chooser_new (_("Import Bookmarks from File"),
- GTK_WIDGET (editor),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- EPHY_FILE_FILTER_NONE);
+ chooser = ephy_file_chooser_new (_("Import Bookmarks from File"),
+ GTK_WIDGET (editor),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ EPHY_FILE_FILTER_NONE);
ephy_file_chooser_add_mime_filter
- (dialog,
+ (chooser,
_("Firefox/Mozilla bookmarks"),
"application/x-mozilla-bookmarks", NULL);
ephy_file_chooser_add_mime_filter
- (dialog, _("Galeon/Konqueror bookmarks"),
+ (chooser, _("Galeon/Konqueror bookmarks"),
"application/x-xbel", NULL);
ephy_file_chooser_add_mime_filter
- (dialog, _("Web bookmarks"),
+ (chooser, _("Web bookmarks"),
"text/rdf", "application/rdf+xml", NULL);
- filter = ephy_file_chooser_add_pattern_filter (dialog,
+ filter = ephy_file_chooser_add_pattern_filter (chooser,
_("All files"),
"*", NULL);
- gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog),
+ gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser),
filter);
- g_signal_connect (dialog, "response",
+ g_signal_connect (chooser, "response",
G_CALLBACK (import_from_file_response_cb), editor);
- gtk_widget_show (GTK_WIDGET (dialog));
+ gtk_widget_show (GTK_WIDGET (chooser));
}
else
{
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 69a08bd3d..7f9d55c48 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -253,7 +253,7 @@ main (int argc,
if (argc >= 2 && strcmp (argv[1], "-remote") == 0) {
const char *opening, *closing;
char *command, *argument;
- char **arguments;
+ char **arg_list;
if (argc != 3) {
g_print ("-remote allows exactly one argument\n");
@@ -285,19 +285,19 @@ main (int argc,
g_free (command);
argument = g_strstrip (g_strndup (opening + 1, closing - opening - 1));
- arguments = g_strsplit (argument, ",", -1);
+ arg_list = g_strsplit (argument, ",", -1);
g_free (argument);
- if (arguments == NULL) {
+ if (arg_list == NULL) {
g_print ("Invalid argument for -remote\n");
exit (1);
}
/* replace arguments */
- argv[1] = g_strstrip (g_strdup (arguments[0]));
+ argv[1] = g_strstrip (g_strdup (arg_list[0]));
argc = 2;
- g_strfreev (arguments);
+ g_strfreev (arg_list);
}
/* Initialise our debug helpers */
diff --git a/src/window-commands.c b/src/window-commands.c
index de5e9b9af..f651dc697 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -1204,7 +1204,7 @@ view_source_embedded (const char *uri, EphyEmbed *embed)
static void
save_temp_source_close_cb (GOutputStream *ostream, GAsyncResult *result, gpointer data)
{
- char *uri;
+ const char *uri;
GFile *file;
GError *error = NULL;
@@ -1216,14 +1216,13 @@ save_temp_source_close_cb (GOutputStream *ostream, GAsyncResult *result, gpointe
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);
if (!ephy_file_launch_handler ("text/plain", file, gtk_get_current_event_time ()))
{
/* Fallback to view the source inside the browser */
- const char *uri;
EphyEmbed *embed;
uri = (const char*) g_object_get_data (G_OBJECT (ostream),
diff --git a/tests/ephy-snapshot-service-test.c b/tests/ephy-snapshot-service-test.c
index 459b625b4..cf2aa65f5 100644
--- a/tests/ephy-snapshot-service-test.c
+++ b/tests/ephy-snapshot-service-test.c
@@ -206,7 +206,7 @@ test_snapshot_and_timed_cancellation (void)
}
static void
-server_callback (SoupServer *server, SoupMessage *msg,
+server_callback (SoupServer *s, SoupMessage *msg,
const char *path, GHashTable *query,
SoupClientContext *context, gpointer data)
{