comparison src/dbus-server.c @ 11291:57fccea36e36

[gaim-migrate @ 13491] Gaim should pretty much never call g_assert. If any of these changes are in your code, you should try to take a look at the change and make sure Gaim won't crash after the function g_return_if_fails. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 18 Aug 2005 03:14:29 +0000
parents 421a8523ad04
children c9312177821a
comparison
equal deleted inserted replaced
11290:b284c703d398 11291:57fccea36e36
75 75
76 void gaim_dbus_register_pointer(gpointer node, GaimDBusType *type) 76 void gaim_dbus_register_pointer(gpointer node, GaimDBusType *type)
77 { 77 {
78 static gint last_id = 0; 78 static gint last_id = 0;
79 79
80 g_assert(map_node_id); 80 g_return_if_fail(map_node_id);
81 g_assert(g_hash_table_lookup(map_node_id, node) == NULL); 81 g_return_if_fail(g_hash_table_lookup(map_node_id, node) == NULL);
82 82
83 last_id++; 83 last_id++;
84 g_hash_table_insert(map_node_id, node, GINT_TO_POINTER(last_id)); 84 g_hash_table_insert(map_node_id, node, GINT_TO_POINTER(last_id));
85 g_hash_table_insert(map_id_node, GINT_TO_POINTER(last_id), node); 85 g_hash_table_insert(map_id_node, GINT_TO_POINTER(last_id), node);
86 g_hash_table_insert(map_id_type, GINT_TO_POINTER(last_id), type); 86 g_hash_table_insert(map_id_type, GINT_TO_POINTER(last_id), type);
631 guint xuint; 631 guint xuint;
632 gboolean xboolean; 632 gboolean xboolean;
633 gpointer ptr = NULL; 633 gpointer ptr = NULL;
634 if (gaim_value_is_outgoing(gaim_values[i])) { 634 if (gaim_value_is_outgoing(gaim_values[i])) {
635 ptr = my_arg(gpointer); 635 ptr = my_arg(gpointer);
636 g_assert(ptr); 636 g_return_if_fail(ptr);
637 } 637 }
638 638
639 switch(gaim_values[i]->type) { 639 switch(gaim_values[i]->type) {
640 case GAIM_TYPE_INT: 640 case GAIM_TYPE_INT:
641 xint = my_arg(gint); 641 xint = my_arg(gint);
659 case GAIM_TYPE_BOXED: 659 case GAIM_TYPE_BOXED:
660 id = gaim_dbus_pointer_to_id(my_arg(gpointer)); 660 id = gaim_dbus_pointer_to_id(my_arg(gpointer));
661 dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &id); 661 dbus_message_iter_append_basic(iter, DBUS_TYPE_INT32, &id);
662 break; 662 break;
663 default: /* no conversion implemented */ 663 default: /* no conversion implemented */
664 g_assert_not_reached(); 664 g_return_if_reached();
665 } 665 }
666 } 666 }
667 } 667 }
668 668
669 #undef my_arg 669 #undef my_arg