diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-04-27 11:06:37 +0100 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-04-27 11:12:08 +0100 |
commit | af2f349ebcf6deee82bf50252be9cac8337cdce2 (patch) | |
tree | b32d3046a335e6ee41bc52b97202f223593e2b40 | |
parent | c4a89602349a9853fe8a868e83f7c9fe4098676a (diff) | |
download | libsoup-af2f349ebcf6deee82bf50252be9cac8337cdce2.tar.gz |
libsoup: Fix variable shadowing
This makes the code a little easier to read, and eliminates some
compiler warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=748514
-rw-r--r-- | libsoup/soup-cache-input-stream.c | 6 | ||||
-rw-r--r-- | libsoup/soup-converter-wrapper.c | 4 | ||||
-rw-r--r-- | libsoup/soup-value-utils.h | 14 |
3 files changed, 11 insertions, 13 deletions
diff --git a/libsoup/soup-cache-input-stream.c b/libsoup/soup-cache-input-stream.c index 26bf52e2..137e0cf9 100644 --- a/libsoup/soup-cache-input-stream.c +++ b/libsoup/soup-cache-input-stream.c @@ -286,10 +286,10 @@ soup_cache_input_stream_close_fn (GInputStream *stream, if (g_output_stream_has_pending (priv->output_stream)) g_cancellable_cancel (priv->cancellable); else { - GError *error = NULL; - g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_PARTIAL_INPUT, + GError *notify_error = NULL; + g_set_error_literal (¬ify_error, G_IO_ERROR, G_IO_ERROR_PARTIAL_INPUT, _("Failed to completely cache the resource")); - notify_and_clear (istream, error); + notify_and_clear (istream, notify_error); } } else if (priv->cancellable) /* The file_replace_async() hasn't finished yet */ diff --git a/libsoup/soup-converter-wrapper.c b/libsoup/soup-converter-wrapper.c index 6fa19d91..d1837e62 100644 --- a/libsoup/soup-converter-wrapper.c +++ b/libsoup/soup-converter-wrapper.c @@ -247,8 +247,8 @@ soup_converter_wrapper_real_convert (GConverter *converter, &my_error); if (result != G_CONVERTER_ERROR) { if (!priv->started) { - SoupMessageFlags flags = soup_message_get_flags (priv->msg); - soup_message_set_flags (priv->msg, flags | SOUP_MESSAGE_CONTENT_DECODED); + SoupMessageFlags message_flags = soup_message_get_flags (priv->msg); + soup_message_set_flags (priv->msg, message_flags | SOUP_MESSAGE_CONTENT_DECODED); priv->started = TRUE; } diff --git a/libsoup/soup-value-utils.h b/libsoup/soup-value-utils.h index 1d265263..1ff42356 100644 --- a/libsoup/soup-value-utils.h +++ b/libsoup/soup-value-utils.h @@ -13,22 +13,20 @@ G_BEGIN_DECLS #define SOUP_VALUE_SETV(val, type, args) \ G_STMT_START { \ - char *error = NULL; \ + char *setv_error = NULL; \ \ memset (val, 0, sizeof (GValue)); \ g_value_init (val, type); \ - G_VALUE_COLLECT (val, args, G_VALUE_NOCOPY_CONTENTS, &error); \ - if (error) \ - g_free (error); \ + G_VALUE_COLLECT (val, args, G_VALUE_NOCOPY_CONTENTS, &setv_error); \ + g_free (setv_error); \ } G_STMT_END #define SOUP_VALUE_GETV(val, type, args) \ G_STMT_START { \ - char *error = NULL; \ + char *getv_error = NULL; \ \ - G_VALUE_LCOPY (val, args, G_VALUE_NOCOPY_CONTENTS, &error); \ - if (error) \ - g_free (error); \ + G_VALUE_LCOPY (val, args, G_VALUE_NOCOPY_CONTENTS, &getv_error); \ + g_free (getv_error); \ } G_STMT_END GHashTable *soup_value_hash_new (void); |