src/log.c

changeset 11677
89c2ab8d2ebf
parent 11503
9f15d4c089b9
child 11698
afbf0d8bdacf
equal deleted inserted replaced
11676:9589185e4997 11677:89c2ab8d2ebf
404 return ret; 404 return ret;
405 405
406 return (gint)b->type - (gint)a->type; 406 return (gint)b->type - (gint)a->type;
407 } 407 }
408 408
409 guint log_set_hash(gconstpointer key) 409 static guint
410 log_set_hash(gconstpointer key)
410 { 411 {
411 const GaimLogSet *set = key; 412 const GaimLogSet *set = key;
412 413
413 /* The account isn't hashed because we need GaimLogSets with NULL accounts 414 /* The account isn't hashed because we need GaimLogSets with NULL accounts
414 * to be found when we search by a GaimLogSet that has a non-NULL account 415 * to be found when we search by a GaimLogSet that has a non-NULL account
415 * but the same type and name. */ 416 * but the same type and name. */
416 return g_int_hash((gint *)&set->type) + g_str_hash(set->name); 417 return g_int_hash((gint *)&set->type) + g_str_hash(set->name);
417 } 418 }
418 419
419 gboolean log_set_equal(gconstpointer a, gconstpointer b) 420 static gboolean
421 log_set_equal(gconstpointer a, gconstpointer b)
420 { 422 {
421 /* I realize that the choices made for GList and GHashTable 423 /* I realize that the choices made for GList and GHashTable
422 * make sense for those data types, but I wish the comparison 424 * make sense for those data types, but I wish the comparison
423 * functions were compatible. */ 425 * functions were compatible. */
424 return !gaim_log_set_compare(a, b); 426 return !gaim_log_set_compare(a, b);
425 } 427 }
426 428
427 void log_add_log_set_to_hash(GHashTable *sets, GaimLogSet *set) 429 static void
430 log_add_log_set_to_hash(GHashTable *sets, GaimLogSet *set)
428 { 431 {
429 GaimLogSet *existing_set = g_hash_table_lookup(sets, set); 432 GaimLogSet *existing_set = g_hash_table_lookup(sets, set);
430 433
431 if (existing_set == NULL) 434 if (existing_set == NULL)
432 g_hash_table_insert(sets, set, set); 435 g_hash_table_insert(sets, set, set);

mercurial