aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-11 14:04:54 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:44:07 +0200
commitb67667cb7151a80c2afcc6e573f7a6a4cb7635e5 (patch)
treea639675932ee82440312c422726bd31451011f3b
parent3e7a35a7bfeb78764ad157807e4135dcfa9100a1 (diff)
downloadneard-b67667cb7151a80c2afcc6e573f7a6a4cb7635e5.tar.gz
gdbus: do not shadow global 'pending' variable (-Wshadow)
Fix -Wshadow warnings: gdbus/object.c: In function ‘g_dbus_pending_success’: gdbus/object.c:286:24: error: declaration of ‘pending’ shadows a global declaration [-Werror=shadow] 286 | GDBusPendingReply pending) | ~~~~~~~~~~~~~~~~~~^~~~~~~ gdbus/object.c:89:16: note: shadowed declaration is here 89 | static GSList *pending = NULL; | ^~~~~~~ gdbus/object.c: In function ‘g_dbus_pending_error_valist’: gdbus/object.c:308:23: error: declaration of ‘pending’ shadows a global declaration [-Werror=shadow] 308 | GDBusPendingReply pending, const char *name, | ~~~~~~~~~~~~~~~~~~^~~~~~~ gdbus/object.c:89:16: note: shadowed declaration is here 89 | static GSList *pending = NULL; | ^~~~~~~ gdbus/object.c: In function ‘g_dbus_pending_error’: gdbus/object.c:331:23: error: declaration of ‘pending’ shadows a global declaration [-Werror=shadow] 331 | GDBusPendingReply pending, | ~~~~~~~~~~~~~~~~~~^~~~~~~ gdbus/object.c:89:16: note: shadowed declaration is here 89 | static GSList *pending = NULL; | ^~~~~~~ gdbus/object.c: In function ‘builtin_security_function’: gdbus/object.c:370:25: error: declaration of ‘pending’ shadows a global declaration [-Werror=shadow] 370 | GDBusPendingReply pending) | ~~~~~~~~~~~~~~~~~~^~~~~~~ gdbus/object.c:89:16: note: shadowed declaration is here 89 | static GSList *pending = NULL; | ^~~~~~~ Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r--gdbus/object.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index 96db516..f394334 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -283,14 +283,14 @@ static GSList *pending_security = NULL;
static const GDBusSecurityTable *security_table = NULL;
void g_dbus_pending_success(DBusConnection *connection,
- GDBusPendingReply pending)
+ GDBusPendingReply pending_reply)
{
GSList *list;
for (list = pending_security; list; list = list->next) {
struct security_data *secdata = list->data;
- if (secdata->pending != pending)
+ if (secdata->pending != pending_reply)
continue;
pending_security = g_slist_remove(pending_security, secdata);
@@ -305,7 +305,7 @@ void g_dbus_pending_success(DBusConnection *connection,
}
void g_dbus_pending_error_valist(DBusConnection *connection,
- GDBusPendingReply pending, const char *name,
+ GDBusPendingReply pending_reply, const char *name,
const char *format, va_list args)
{
GSList *list;
@@ -313,7 +313,7 @@ void g_dbus_pending_error_valist(DBusConnection *connection,
for (list = pending_security; list; list = list->next) {
struct security_data *secdata = list->data;
- if (secdata->pending != pending)
+ if (secdata->pending != pending_reply)
continue;
pending_security = g_slist_remove(pending_security, secdata);
@@ -328,14 +328,14 @@ void g_dbus_pending_error_valist(DBusConnection *connection,
}
void g_dbus_pending_error(DBusConnection *connection,
- GDBusPendingReply pending,
+ GDBusPendingReply pending_reply,
const char *name, const char *format, ...)
{
va_list args;
va_start(args, format);
- g_dbus_pending_error_valist(connection, pending, name, format, args);
+ g_dbus_pending_error_valist(connection, pending_reply, name, format, args);
va_end(args);
}
@@ -365,19 +365,19 @@ static void builtin_security_result(dbus_bool_t authorized, void *user_data)
}
static void builtin_security_function(DBusConnection *conn,
- const char *action,
- gboolean interaction,
- GDBusPendingReply pending)
+ const char *action,
+ gboolean interaction,
+ GDBusPendingReply pending_reply)
{
struct builtin_security_data *data;
data = g_new0(struct builtin_security_data, 1);
data->conn = conn;
- data->pending = pending;
+ data->pending = pending_reply;
if (polkit_check_authorization(conn, action, interaction,
builtin_security_result, data, 30000) < 0)
- g_dbus_pending_error(conn, pending, NULL, NULL);
+ g_dbus_pending_error(conn, pending_reply, NULL, NULL);
}
static gboolean check_privilege(DBusConnection *conn, DBusMessage *msg,