[linux-nfc] [neard][PATCH v2 22/73] gdbus: do not shadow global 'pending' variable (-Wshadow)
Krzysztof Kozlowski <[email protected]> Mon, 19 Jul 2021 13:07:28 +0200
| Newsgroups | org.01.lists.linux-nfc,dev.linux.lists.oe-linux-nfc |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
---
gdbus/object.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdbus/object.c b/gdbus/object.c
index 96db51665301..f394334d4594 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,
--
2.27.0
_______________________________________________
Linux-nfc mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s