]> Dogcows Code - chaz/openbox/commitdiff
use g_hash_table properly
authorDana Jansens <danakj@orodu.net>
Mon, 24 Mar 2003 22:03:38 +0000 (22:03 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 24 Mar 2003 22:03:38 +0000 (22:03 +0000)
engines/openbox/openbox.c
openbox/client.c
openbox/event.c

index 7bf386b251cf39fbaf87670b6409d7f2df62358c..5b91ae6550a7a6fd6c11a38c36dcc352e9e05fdc 100644 (file)
@@ -570,18 +570,18 @@ void frame_grab_client(ObFrame *self, Client *client)
     frame_adjust_area(self, TRUE, TRUE);
 
     /* set all the windows for the frame in the client_map */
-    g_hash_table_insert(client_map, (gpointer)self->frame.window, client);
-    g_hash_table_insert(client_map, (gpointer)self->frame.plate, client);
-    g_hash_table_insert(client_map, (gpointer)self->title, client);
-    g_hash_table_insert(client_map, (gpointer)self->label, client);
-    g_hash_table_insert(client_map, (gpointer)self->max, client);
-    g_hash_table_insert(client_map, (gpointer)self->close, client);
-    g_hash_table_insert(client_map, (gpointer)self->desk, client);
-    g_hash_table_insert(client_map, (gpointer)self->icon, client);
-    g_hash_table_insert(client_map, (gpointer)self->iconify, client);
-    g_hash_table_insert(client_map, (gpointer)self->handle, client);
-    g_hash_table_insert(client_map, (gpointer)self->lgrip, client);
-    g_hash_table_insert(client_map, (gpointer)self->rgrip, client);
+    g_hash_table_insert(client_map, &self->frame.window, client);
+    g_hash_table_insert(client_map, &self->frame.plate, client);
+    g_hash_table_insert(client_map, &self->title, client);
+    g_hash_table_insert(client_map, &self->label, client);
+    g_hash_table_insert(client_map, &self->max, client);
+    g_hash_table_insert(client_map, &self->close, client);
+    g_hash_table_insert(client_map, &self->desk, client);
+    g_hash_table_insert(client_map, &self->icon, client);
+    g_hash_table_insert(client_map, &self->iconify, client);
+    g_hash_table_insert(client_map, &self->handle, client);
+    g_hash_table_insert(client_map, &self->lgrip, client);
+    g_hash_table_insert(client_map, &self->rgrip, client);
 }
 
 void frame_release_client(ObFrame *self, Client *client)
@@ -605,18 +605,18 @@ void frame_release_client(ObFrame *self, Client *client)
     }
 
     /* remove all the windows for the frame from the client_map */
-    g_hash_table_remove(client_map, (gpointer)self->frame.window);
-    g_hash_table_remove(client_map, (gpointer)self->frame.plate);
-    g_hash_table_remove(client_map, (gpointer)self->title);
-    g_hash_table_remove(client_map, (gpointer)self->label);
-    g_hash_table_remove(client_map, (gpointer)self->max);
-    g_hash_table_remove(client_map, (gpointer)self->close);
-    g_hash_table_remove(client_map, (gpointer)self->desk);
-    g_hash_table_remove(client_map, (gpointer)self->icon);
-    g_hash_table_remove(client_map, (gpointer)self->iconify);
-    g_hash_table_remove(client_map, (gpointer)self->handle);
-    g_hash_table_remove(client_map, (gpointer)self->lgrip);
-    g_hash_table_remove(client_map, (gpointer)self->rgrip);
+    g_hash_table_remove(client_map, &self->frame.window);
+    g_hash_table_remove(client_map, &self->frame.plate);
+    g_hash_table_remove(client_map, &self->title);
+    g_hash_table_remove(client_map, &self->label);
+    g_hash_table_remove(client_map, &self->max);
+    g_hash_table_remove(client_map, &self->close);
+    g_hash_table_remove(client_map, &self->desk);
+    g_hash_table_remove(client_map, &self->icon);
+    g_hash_table_remove(client_map, &self->iconify);
+    g_hash_table_remove(client_map, &self->handle);
+    g_hash_table_remove(client_map, &self->lgrip);
+    g_hash_table_remove(client_map, &self->rgrip);
 
     frame_free(self);
 }
index de1b2c9c253bf19c146c881893aa17e1fd3cb3c4..e47742a64a2814f471ea1e684c589e3e8e6fcaea 100644 (file)
@@ -38,8 +38,8 @@ static Client *search_focus_tree(Client *node, Client *skip);
 static void client_apply_startup_state(Client *self);
 static Client *search_modal_tree(Client *node, Client *skip);
 
-static guint map_hash(Window w) { return w; }
-static gboolean map_key_comp(Window w1, Window w2) { return w1 == w2; }
+static guint map_hash(Window *w) { return *w; }
+static gboolean map_key_comp(Window *w1, Window *w2) { return *w1 == *w2; }
 
 void client_startup()
 {
@@ -186,8 +186,8 @@ void client_manage(Window window)
      
     client_list = g_slist_append(client_list, client);
     stacking_list = g_list_append(stacking_list, client);
-    g_assert(!g_hash_table_lookup(client_map, (gpointer)client->window));
-    g_hash_table_insert(client_map, (gpointer)window, client);
+    g_assert(!g_hash_table_lookup(client_map, &client->window));
+    g_hash_table_insert(client_map, &client->window, client);
 
     /* update the focus lists */
     if (client->desktop == DESKTOP_ALL) {
@@ -241,7 +241,7 @@ void client_unmanage(Client *client)
 
     client_list = g_slist_remove(client_list, client);
     stacking_list = g_list_remove(stacking_list, client);
-    g_hash_table_remove(client_map, (gpointer)client->window);
+    g_hash_table_remove(client_map, &client->window);
 
     /* update the focus lists */
     if (client->desktop == DESKTOP_ALL) {
@@ -528,7 +528,7 @@ void client_update_transient_for(Client *self)
     if (XGetTransientForHint(ob_display, self->window, &t) &&
        t != self->window) { /* cant be transient to itself! */
        self->transient = TRUE;
-       c = g_hash_table_lookup(client_map, (gpointer)t);
+       c = g_hash_table_lookup(client_map, &t);
        g_assert(c != self);/* if this happens then we need to check for it*/
 
        if (!c /*XXX: && _group*/) {
index 4be03d9445d71668f4040175a5a39212a309b0dc..3448194ef022813e49b95a8273c4060a96db5f0b 100644 (file)
@@ -253,7 +253,7 @@ void event_process(XEvent *e)
        break;
     }
 
-    client = g_hash_table_lookup(client_map, (gpointer)window);
+    client = g_hash_table_lookup(client_map, &window);
 
     /* deal with it in the kernel */
     if (client)
This page took 0.03351 seconds and 4 git commands to generate.