File 0001-wispr-Rename-wispr_portal_list-to-wispr_portal_hash.patch of Package connman
From d7022ad52d8bf84f437b0b2e021d7b06064b97dd Mon Sep 17 00:00:00 2001
From: Daniel Wagner <wagi@monom.org>
Date: Mon, 4 Jul 2022 08:16:58 +0200
Subject: [PATCH 1/5] wispr: Rename wispr_portal_list to wispr_portal_hash
This data structure is a hash table, so replace the '_list' with
'_hash' to reduce the possibility for confusion.
Signed-off-by: Daniel Wagner <wagi@monom.org>
---
src/wispr.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -91,7 +91,7 @@ struct connman_wispr_portal {
static bool wispr_portal_web_result(GWebResult *result, gpointer user_data);
-static GHashTable *wispr_portal_list = NULL;
+static GHashTable *wispr_portal_hash = NULL;
static char *online_check_ipv4_url = NULL;
static char *online_check_ipv6_url = NULL;
@@ -576,7 +576,7 @@ static void wispr_portal_browser_reply_c
if (index < 0)
return;
- wispr_portal = g_hash_table_lookup(wispr_portal_list,
+ wispr_portal = g_hash_table_lookup(wispr_portal_hash,
GINT_TO_POINTER(index));
if (!wispr_portal)
return;
@@ -950,21 +950,21 @@ int __connman_wispr_start(struct connman
DBG("service %p", service);
- if (!wispr_portal_list)
+ if (!wispr_portal_hash)
return -EINVAL;
index = __connman_service_get_index(service);
if (index < 0)
return -EINVAL;
- wispr_portal = g_hash_table_lookup(wispr_portal_list,
+ wispr_portal = g_hash_table_lookup(wispr_portal_hash,
GINT_TO_POINTER(index));
if (!wispr_portal) {
wispr_portal = g_try_new0(struct connman_wispr_portal, 1);
if (!wispr_portal)
return -ENOMEM;
- g_hash_table_replace(wispr_portal_list,
+ g_hash_table_replace(wispr_portal_hash,
GINT_TO_POINTER(index), wispr_portal);
}
@@ -1002,27 +1002,27 @@ void __connman_wispr_stop(struct connman
DBG("service %p", service);
- if (!wispr_portal_list)
+ if (!wispr_portal_hash)
return;
index = __connman_service_get_index(service);
if (index < 0)
return;
- wispr_portal = g_hash_table_lookup(wispr_portal_list,
+ wispr_portal = g_hash_table_lookup(wispr_portal_hash,
GINT_TO_POINTER(index));
if (!wispr_portal)
return;
if (wispr_portal->ipv4_context) {
if (service == wispr_portal->ipv4_context->service)
- g_hash_table_remove(wispr_portal_list,
+ g_hash_table_remove(wispr_portal_hash,
GINT_TO_POINTER(index));
}
if (wispr_portal->ipv6_context) {
if (service == wispr_portal->ipv6_context->service)
- g_hash_table_remove(wispr_portal_list,
+ g_hash_table_remove(wispr_portal_hash,
GINT_TO_POINTER(index));
}
}
@@ -1031,7 +1031,7 @@ int __connman_wispr_init(void)
{
DBG("");
- wispr_portal_list = g_hash_table_new_full(g_direct_hash,
+ wispr_portal_hash = g_hash_table_new_full(g_direct_hash,
g_direct_equal, NULL,
free_connman_wispr_portal);
@@ -1050,6 +1050,6 @@ void __connman_wispr_cleanup(void)
{
DBG("");
- g_hash_table_destroy(wispr_portal_list);
- wispr_portal_list = NULL;
+ g_hash_table_destroy(wispr_portal_hash);
+ wispr_portal_hash = NULL;
}