summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-10-02 12:27:09 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-03 13:08:58 +0300
commit9a8f7ff3e9ba7e5f56605c7b4f7508a2ebe30b98 (patch)
treeb4fcc0eb5b731dd8100dfa9f465dc8febb1c5270 /src/technology.c
parentd8e03ce8afcb54cd015853fdb59a3ea06da05ba9 (diff)
downloadconnman-9a8f7ff3e9ba7e5f56605c7b4f7508a2ebe30b98.tar.gz
connman-9a8f7ff3e9ba7e5f56605c7b4f7508a2ebe30b98.tar.bz2
connman-9a8f7ff3e9ba7e5f56605c7b4f7508a2ebe30b98.zip
technology: Handle rfkill hash table in a saner way
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/technology.c b/src/technology.c
index d78e7b3b..001208d6 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -1288,7 +1288,7 @@ int __connman_technology_add_rfkill(unsigned int index,
DBG("index %u type %d soft %u hard %u", index, type,
softblock, hardblock);
- rfkill = g_hash_table_lookup(rfkill_list, &index);
+ rfkill = g_hash_table_lookup(rfkill_list, GINT_TO_POINTER(index));
if (rfkill != NULL)
goto done;
@@ -1301,7 +1301,7 @@ int __connman_technology_add_rfkill(unsigned int index,
rfkill->softblock = softblock;
rfkill->hardblock = hardblock;
- g_hash_table_insert(rfkill_list, &rfkill->index, rfkill);
+ g_hash_table_insert(rfkill_list, GINT_TO_POINTER(index), rfkill);
done:
technology = technology_get(type);
@@ -1342,7 +1342,7 @@ int __connman_technology_update_rfkill(unsigned int index,
DBG("index %u soft %u hard %u", index, softblock, hardblock);
- rfkill = g_hash_table_lookup(rfkill_list, &index);
+ rfkill = g_hash_table_lookup(rfkill_list, GINT_TO_POINTER(index));
if (rfkill == NULL)
return -ENXIO;
@@ -1381,11 +1381,11 @@ int __connman_technology_remove_rfkill(unsigned int index,
DBG("index %u", index);
- rfkill = g_hash_table_lookup(rfkill_list, &index);
+ rfkill = g_hash_table_lookup(rfkill_list, GINT_TO_POINTER(index));
if (rfkill == NULL)
return -ENXIO;
- g_hash_table_remove(rfkill_list, &index);
+ g_hash_table_remove(rfkill_list, GINT_TO_POINTER(index));
technology = technology_find(type);
if (technology == NULL)
@@ -1402,7 +1402,7 @@ int __connman_technology_init(void)
connection = connman_dbus_get_connection();
- rfkill_list = g_hash_table_new_full(g_int_hash, g_int_equal,
+ rfkill_list = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, free_rfkill);
global_offlinemode = connman_technology_load_offlinemode();