[Spice-devel] [spice-gtk v1] channel-display: always name GHashFunc and GEqualFunc

Victor Toso victortoso at redhat.com
Thu Apr 19 04:54:09 UTC 2018


From: Victor Toso <me at victortoso.com>

g_hash_table_new() allows to pass NULL for GHashFunc and GEqualFunc
which defaults to g_direct_hash() and g_direct_equal().

This is the only place in our code that uses NULL while in
channel-main and channel-smartcard and spice-file-transfer-task we
name it.

Changing for consistency and clarity.

Signed-off-by: Victor Toso <victortoso at redhat.com>
---
 src/channel-display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/channel-display.c b/src/channel-display.c
index 589ba45..0f094d5 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -907,7 +907,7 @@ static void spice_display_channel_init(SpiceDisplayChannel *channel)
 
     c = channel->priv = SPICE_DISPLAY_CHANNEL_GET_PRIVATE(channel);
 
-    c->surfaces = g_hash_table_new_full(NULL, NULL, NULL, destroy_surface);
+    c->surfaces = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_surface);
     c->image_cache.ops = &image_cache_ops;
     c->palette_cache.ops = &palette_cache_ops;
     c->image_surfaces.ops = &image_surfaces_ops;
-- 
2.16.2



More information about the Spice-devel mailing list