]> code.delx.au - pulseaudio/blobdiff - src/modules/gconf/module-gconf.c
gconf: Remove unused variable
[pulseaudio] / src / modules / gconf / module-gconf.c
index c60d0f05d1d873d38d63f2949dd23e6df213aba4..d791b00789089e23bea40ddab3bf2d4fa5641f10 100644 (file)
@@ -45,7 +45,7 @@
 PA_MODULE_AUTHOR("Lennart Poettering");
 PA_MODULE_DESCRIPTION("GConf Adapter");
 PA_MODULE_VERSION(PACKAGE_VERSION);
-PA_MODULE_LOAD_ONCE(TRUE);
+PA_MODULE_LOAD_ONCE(true);
 
 #define MAX_MODULES 10
 #define BUF_MAX 2048
@@ -143,7 +143,7 @@ static void unload_one_module(struct module_info *m, unsigned i) {
         return;
 
     pa_log_debug("Unloading module #%i", m->items[i].index);
-    pa_module_unload_by_index(u->core, m->items[i].index, TRUE);
+    pa_module_unload_by_index(u->core, m->items[i].index, true);
     m->items[i].index = PA_INVALID_INDEX;
     pa_xfree(m->items[i].name);
     pa_xfree(m->items[i].args);
@@ -166,7 +166,7 @@ static void load_module(
         unsigned i,
         const char *name,
         const char *args,
-        pa_bool_t is_new) {
+        bool is_new) {
 
     struct userdata *u;
     pa_module *mod;
@@ -215,7 +215,7 @@ static int handle_event(struct userdata *u) {
     int ret = 0;
 
     do {
-        if ((opcode = read_byte(u)) < 0){
+        if ((opcode = read_byte(u)) < 0) {
             if (errno == EINTR || errno == EAGAIN)
                 break;
             goto fail;
@@ -284,16 +284,11 @@ static int handle_event(struct userdata *u) {
 
             case '-': {
                 char *name;
-                struct module_info *m;
 
                 if (!(name = read_string(u)))
                     goto fail;
 
-                if ((m = pa_hashmap_get(u->module_infos, name))) {
-                    pa_hashmap_remove(u->module_infos, name);
-                    module_info_free(m);
-                }
-
+                pa_hashmap_remove_and_free(u->module_infos, name);
                 pa_xfree(name);
 
                 break;
@@ -324,7 +319,7 @@ static void io_event_cb(
             u->io_event = NULL;
         }
 
-        pa_module_unload_request(u->module, TRUE);
+        pa_module_unload_request(u->module, true);
     }
 }
 
@@ -336,7 +331,7 @@ int pa__init(pa_module*m) {
     u->core = m->core;
     u->module = m;
     m->userdata = u;
-    u->module_infos = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
+    u->module_infos = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, (pa_free_cb_t) module_info_free);
     u->pid = (pid_t) -1;
     u->fd = -1;
     u->fd_type = 0;
@@ -401,7 +396,7 @@ void pa__done(pa_module*m) {
         pa_close(u->fd);
 
     if (u->module_infos)
-        pa_hashmap_free(u->module_infos, (pa_free_cb_t) module_info_free);
+        pa_hashmap_free(u->module_infos);
 
     pa_xfree(u);
 }