Fixed some fatal networking bugs during the first run.
[udpgate.git] / src / packet.c
index 82dbecb..142c1bf 100644 (file)
@@ -56,7 +56,7 @@ guint32 value_guint32_htonl=htonl(value_guint32);
 
        g_return_if_fail(gstring!=NULL);
 
-       g_assert(sizeof(value_guint32_htonl)==4);
+       g_assert(4==sizeof(value_guint32_htonl));
        packet_assembly_guint32(gstring,sizeof(value_guint32_htonl));
        packet_assembly_guint32(gstring,value_guint32_htonl);
 }
@@ -67,7 +67,7 @@ guint16 value_guint16_htonl=htons(value_guint16);
 
        g_return_if_fail(gstring!=NULL);
 
-       g_assert(sizeof(value_guint16_htonl)==4);
+       g_assert(2==sizeof(value_guint16_htonl));
        packet_assembly_guint32(gstring,sizeof(value_guint16_htonl));
        packet_assembly_guint16(gstring,value_guint16_htonl);
 }
@@ -269,8 +269,8 @@ GSList *items;
        g_return_val_if_fail(packet!=NULL,NULL);
 
        r=g_hash_table_new_full(
-                       g_int_hash,     /* hash_func */
-                       g_int_equal,    /* key_equal_func */
+                       g_direct_hash,  /* hash_func */
+                       g_direct_equal, /* key_equal_func */
                        NULL,   /* key_destroy_func */
                        packet_disassembly_value_destroy_func); /* value_destroy_func */
        packet_end=packet+packet_length;