From: John Darrington Date: Sun, 3 Oct 2010 08:41:36 +0000 (+0200) Subject: Consistently use the return value from case_ref. X-Git-Tag: v0.7.6~117 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8e468c47bf5ef5148b570466cd3225b4c02a3d3;p=pspp-builds.git Consistently use the return value from case_ref. This makes debugging easier. --- diff --git a/src/data/casegrouper.c b/src/data/casegrouper.c index 8d0b0812..dee1488e 100644 --- a/src/data/casegrouper.c +++ b/src/data/casegrouper.c @@ -91,8 +91,8 @@ casegrouper_get_next_group (struct casegrouper *grouper, writer = autopaging_writer_create ( casereader_get_proto (grouper->reader)); - case_ref (group_case); - casewriter_write (writer, group_case); + + casewriter_write (writer, case_ref (group_case)); while ((tmp = casereader_peek (grouper->reader, 0)) != NULL && grouper->same_group (group_case, tmp, grouper->aux)) diff --git a/src/math/order-stats.c b/src/math/order-stats.c index e550d2b2..9f54e873 100644 --- a/src/math/order-stats.c +++ b/src/math/order-stats.c @@ -131,8 +131,6 @@ order_stats_accumulate (struct order_stats **os, size_t nos, if ( var_is_value_missing (var, case_data (cx, var), exclude)) continue; - case_unref (prev_cx); - if ( prev_value == -DBL_MAX || prev_value == this_value) c_i += weight; @@ -142,6 +140,7 @@ order_stats_accumulate (struct order_stats **os, size_t nos, c_i = weight; } + case_unref (prev_cx); cc_i += weight; prev_value = this_value; prev_cx = case_ref (cx); diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 7deb1022..9b1b26a2 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -879,7 +879,7 @@ psppire_data_store_insert_case (PsppireDataStore *ds, g_return_val_if_fail (ds, FALSE); g_return_val_if_fail (ds->datasheet, FALSE); - case_ref (cc); + cc = case_ref (cc); result = datasheet_insert_rows (ds->datasheet, posn, &cc, 1); if ( result )