# HG changeset patch # User William Pitcock # Date 1186649281 18000 # Node ID b78d3197c70d4eb5fca43ad2656c52827c1d7275 # Parent be80d9b2c9ef1a105c23832d1ca46abbe9068b10 Tuple (final version) diff -r be80d9b2c9ef -r b78d3197c70d src/audacious/tuple.c --- a/src/audacious/tuple.c Thu Aug 09 03:35:05 2007 -0500 +++ b/src/audacious/tuple.c Thu Aug 09 03:48:01 2007 -0500 @@ -42,7 +42,7 @@ /* iterative destructor of tuple values. */ static void -tuple_value_destroy(mowgli_dictionary_elem_t *delem, void *privdata) +tuple_value_destroy(mowgli_dictionary_elem_t *delem, gpointer privdata) { TupleValue *value = (TupleValue *) delem->data; @@ -53,8 +53,10 @@ } static void -tuple_destroy(Tuple *tuple) +tuple_destroy(gpointer data) { + Tuple *tuple = (Tuple *) data; + mowgli_dictionary_destroy(tuple->dict, tuple_value_destroy, NULL); mowgli_heap_free(tuple_heap, tuple); } @@ -159,8 +161,8 @@ { TupleValue *value; - g_return_if_fail(tuple != NULL, NULL); - g_return_if_fail(field != NULL, NULL); + g_return_val_if_fail(tuple != NULL, NULL); + g_return_val_if_fail(field != NULL, NULL); if ((value = mowgli_dictionary_retrieve(tuple->dict, field)) == NULL) return NULL; @@ -176,14 +178,14 @@ { TupleValue *value; - g_return_if_fail(tuple != NULL, 0); - g_return_if_fail(field != NULL, 0); + g_return_val_if_fail(tuple != NULL, 0); + g_return_val_if_fail(field != NULL, 0); if ((value = mowgli_dictionary_retrieve(tuple->dict, field)) == NULL) - return NULL; + return 0; if (value->type != TUPLE_INT) - mowgli_throw_exception_val(audacious.tuple.invalid_type_request, NULL); + mowgli_throw_exception_val(audacious.tuple.invalid_type_request, 0); return value->value.integer; }