From: Ben Pfaff Date: Wed, 10 May 2006 04:11:07 +0000 (+0000) Subject: Add WARN_UNUSED_RESULT to procedure function prototypes X-Git-Tag: v0.6.0~861 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=321aff454c80b141d1d85fc1e3ea0c4eb05ab437;p=pspp-builds.git Add WARN_UNUSED_RESULT to procedure function prototypes and fix up one user who needed it. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index fa71f598..87fb23ee 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +Tue May 9 21:09:17 2006 Ben Pfaff + + * procedure.h: Add WARN_UNUSED_RESULT to procedure function + prototypes. + Tue May 9 21:08:05 2006 Ben Pfaff * casefile.c: Convert many uses of `int' to `bool'. diff --git a/src/data/procedure.h b/src/data/procedure.h index 3c43e712..35678ce6 100644 --- a/src/data/procedure.h +++ b/src/data/procedure.h @@ -22,7 +22,9 @@ #include #include + #include +#include struct ccase; struct casefile; @@ -63,17 +65,21 @@ void proc_set_sink (struct case_sink *); struct casefile *proc_capture_output (void); bool procedure (bool (*proc_func) (const struct ccase *, void *), - void *aux); + void *aux) + WARN_UNUSED_RESULT; bool procedure_with_splits (void (*begin_func) (const struct ccase *, void *), bool (*proc_func) (const struct ccase *, void *), void (*end_func) (void *), - void *aux); + void *aux) + WARN_UNUSED_RESULT; bool multipass_procedure (bool (*proc_func) (const struct casefile *, void *), - void *aux); + void *aux) + WARN_UNUSED_RESULT; bool multipass_procedure_with_splits (bool (*) (const struct ccase *, const struct casefile *, void *), - void *aux); + void *aux) + WARN_UNUSED_RESULT; time_t time_of_last_procedure (void); /* Number of cases to lag. */ diff --git a/src/math/ChangeLog b/src/math/ChangeLog index c78f51a8..b36a8440 100644 --- a/src/math/ChangeLog +++ b/src/math/ChangeLog @@ -1,3 +1,8 @@ +Tue May 9 21:09:37 2006 Ben Pfaff + + * sort.c (sort_active_file_to_casefile): Check return value of + multipass_procedure(). + Wed May 3 23:06:43 2006 Ben Pfaff Continue reforming procedure execution. In this phase, get rid of diff --git a/src/math/sort.c b/src/math/sort.c index 310fae9c..01e95533 100644 --- a/src/math/sort.c +++ b/src/math/sort.c @@ -112,8 +112,11 @@ sort_active_file_to_casefile (const struct sort_criteria *criteria) cb_data.criteria = criteria; cb_data.output = NULL; - multipass_procedure (sort_to_casefile_callback, &cb_data); - + if (!multipass_procedure (sort_to_casefile_callback, &cb_data)) + { + casefile_destroy (cb_data.output); + return NULL; + } return cb_data.output; }