[libsoup] libsoup: Fix variable shadowing
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] libsoup: Fix variable shadowing
- Date: Mon, 27 Apr 2015 15:23:54 +0000 (UTC)
commit af2f349ebcf6deee82bf50252be9cac8337cdce2
Author: Philip Withnall <philip withnall collabora co uk>
Date: Mon Apr 27 11:06:37 2015 +0100
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
libsoup/soup-cache-input-stream.c | 6 +++---
libsoup/soup-converter-wrapper.c | 4 ++--
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 26bf52e..137e0cf 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 6fa19d9..d1837e6 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 1d26526..1ff4235 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]