summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-09-13 19:18:15 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-09-13 19:19:10 +0200
commitc702f05f9218f123857eba478ca0c1c905c3b4ff (patch)
tree77196163a48c45a59e7874b7d566c0fd17d86411
parent44ed85d5d1d38daaaf6a552596a4d303130294e9 (diff)
downloadlibqmi-c702f05f9218f123857eba478ca0c1c905c3b4ff.tar.gz
libqmi-glib: avoid shadowing 'read'
qmi-device.c: In function 'input_ready_cb': qmi-device.c:1344:12: error: declaration of 'read' shadows a global declaration [-Werror=shadow] cc1: all warnings being treated as errors make[4]: *** [libqmi_glib_la-qmi-device.lo] Error 1 Bug report and original fix by Heath Kehoe <heath@digitalartefacts.com>
-rw-r--r--src/libqmi-glib/qmi-device.c24
-rw-r--r--src/libqmi-glib/qmi-proxy.c22
2 files changed, 23 insertions, 23 deletions
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
index 286f5d76..a1352aad 100644
--- a/src/libqmi-glib/qmi-device.c
+++ b/src/libqmi-glib/qmi-device.c
@@ -1341,14 +1341,14 @@ input_ready_cb (GInputStream *istream,
{
guint8 buffer[BUFFER_SIZE];
GError *error = NULL;
- gssize read;
-
- read = g_pollable_input_stream_read_nonblocking (G_POLLABLE_INPUT_STREAM (istream),
- buffer,
- BUFFER_SIZE,
- NULL,
- &error);
- if (read < 0) {
+ gssize r;
+
+ r = g_pollable_input_stream_read_nonblocking (G_POLLABLE_INPUT_STREAM (istream),
+ buffer,
+ BUFFER_SIZE,
+ NULL,
+ &error);
+ if (r < 0) {
g_warning ("Error reading from istream: %s", error ? error->message : "unknown");
if (error)
g_error_free (error);
@@ -1357,16 +1357,16 @@ input_ready_cb (GInputStream *istream,
return FALSE;
}
- if (read == 0) {
+ if (r == 0) {
/* HUP! */
g_warning ("Cannot read from istream: connection broken");
return FALSE;
}
- /* else, read > 0 */
+ /* else, r > 0 */
if (!G_UNLIKELY (self->priv->buffer))
- self->priv->buffer = g_byte_array_sized_new (read);
- g_byte_array_append (self->priv->buffer, buffer, read);
+ self->priv->buffer = g_byte_array_sized_new (r);
+ g_byte_array_append (self->priv->buffer, buffer, r);
/* Try to parse input messages */
parse_response (self);
diff --git a/src/libqmi-glib/qmi-proxy.c b/src/libqmi-glib/qmi-proxy.c
index f9567463..4dd7b318 100644
--- a/src/libqmi-glib/qmi-proxy.c
+++ b/src/libqmi-glib/qmi-proxy.c
@@ -557,7 +557,7 @@ connection_readable_cb (GSocket *socket,
{
guint8 buffer[BUFFER_SIZE];
GError *error = NULL;
- gssize read;
+ gssize r;
if (condition & G_IO_HUP || condition & G_IO_ERR) {
g_debug ("client connection closed");
@@ -568,12 +568,12 @@ connection_readable_cb (GSocket *socket,
if (!(condition & G_IO_IN || condition & G_IO_PRI))
return TRUE;
- read = g_input_stream_read (g_io_stream_get_input_stream (G_IO_STREAM (client->connection)),
- buffer,
- BUFFER_SIZE,
- NULL,
- &error);
- if (read < 0) {
+ r = g_input_stream_read (g_io_stream_get_input_stream (G_IO_STREAM (client->connection)),
+ buffer,
+ BUFFER_SIZE,
+ NULL,
+ &error);
+ if (r < 0) {
g_warning ("Error reading from istream: %s", error ? error->message : "unknown");
if (error)
g_error_free (error);
@@ -582,13 +582,13 @@ connection_readable_cb (GSocket *socket,
return FALSE;
}
- if (read == 0)
+ if (r == 0)
return TRUE;
- /* else, read > 0 */
+ /* else, r > 0 */
if (!G_UNLIKELY (client->buffer))
- client->buffer = g_byte_array_sized_new (read);
- g_byte_array_append (client->buffer, buffer, read);
+ client->buffer = g_byte_array_sized_new (r);
+ g_byte_array_append (client->buffer, buffer, r);
/* Try to parse input messages */
parse_request (client);