From 4aff49ed80b386d5055e89ac2dbe94e8b8f90535 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 28 Nov 2015 21:03:38 +0000 Subject: [PATCH] correct return value FIXME items Not all markups were quite right. The output_* functions must return an int. The rest were as a matter of fact correct. Signed-off-by: Sami Kerola --- src/analyze.c | 12 ++++-------- src/dhcpd-pools.c | 6 ++---- src/dhcpd-pools.h | 6 +++--- src/output.c | 23 ++++++----------------- 4 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/analyze.c b/src/analyze.c index 4c39b62..072c07e 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -46,20 +46,17 @@ #include "dhcpd-pools.h" /*! \brief Prepare data for analysis. The function will sort leases and - * ranges. - * FIXME: This function should return void. */ -int prepare_data(void) + * ranges. */ +void prepare_data(void) { /* Sort leases */ HASH_SORT(leases, leasecomp); /* Sort ranges */ qsort(ranges, (size_t)num_ranges, sizeof(struct range_t), &rangecomp); - return 0; } -/*! \brief Perform counting. Join leases with ranges, and update counters. - * FIXME: This function should return void. */ -int do_counting(void) +/*! \brief Perform counting. Join leases with ranges, and update counters. */ +void do_counting(void) { struct range_t *restrict range_p; const struct leases_t *restrict l = leases; @@ -121,5 +118,4 @@ int do_counting(void) shared_networks->backups += range_p->backups; range_p++; } - return 0; } diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c index 8c92b3a..ef22153 100644 --- a/src/dhcpd-pools.c +++ b/src/dhcpd-pools.c @@ -287,9 +287,8 @@ int main(int argc, char **argv) } /*! \brief Run time initialization. Global allocations, counter - * initializations, etc are here. - * FIXME: This function should return void. */ -int prepare_memory(void) + * initializations, etc are here. */ +void prepare_memory(void) { config.dhcp_version = VERSION_UNKNOWN; RANGES = 64; @@ -301,5 +300,4 @@ int prepare_memory(void) shared_networks->used = 0; shared_networks->touched = 0; shared_networks->backups = 0; - return 0; } diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h index afee609..a6bc03b 100644 --- a/src/dhcpd-pools.h +++ b/src/dhcpd-pools.h @@ -219,13 +219,13 @@ extern struct leases_t *leases; extern unsigned int RANGES; /* Function prototypes */ -extern int prepare_memory(void); +extern void prepare_memory(void); extern void set_ipv_functions(int version); extern int parse_leases(void); extern void parse_config(int, const char *__restrict, struct shared_network_t *__restrict) __attribute__ ((nonnull(2, 3))); -extern int prepare_data(void); -extern int do_counting(void); +extern void prepare_data(void); +extern void do_counting(void); extern void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges) __attribute__ ((nonnull(1, 2))); /* support functions */ diff --git a/src/output.c b/src/output.c index add823f..58080e2 100644 --- a/src/output.c +++ b/src/output.c @@ -58,8 +58,7 @@ #include "dhcpd-pools.h" -/*! \brief Text output format, which is the default. - * FIXME: This function should return void. */ +/*! \brief Text output format, which is the default. */ int output_txt(void) { unsigned int i; @@ -214,9 +213,7 @@ int output_txt(void) return 0; } -/*! \brief The xml output formats. - * FIXME: This function should return void. - */ +/*! \brief The xml output formats. */ int output_xml(void) { unsigned int i; @@ -319,9 +316,7 @@ int output_xml(void) return 0; } -/*! \brief The json output formats. - * FIXME: This function should return void. - */ +/*! \brief The json output formats. */ int output_json(void) { unsigned int i = 0; @@ -598,9 +593,7 @@ static void newsection(FILE *restrict f, char const *restrict title) output_line(f, "h3", title); } -/*! \brief Output html format. - * FIXME: This function should return void. - */ +/*! \brief Output html format. */ int output_html(void) { unsigned int i; @@ -788,9 +781,7 @@ int output_html(void) return 0; } -/*! \brief Output cvs format. - * FIXME: This function should return void. - */ +/*! \brief Output cvs format. */ int output_csv(void) { unsigned int i; @@ -932,9 +923,7 @@ int output_csv(void) return 0; } -/*! \brief Output alarm text, and return program exit value. - * FIXME: This function should return void. - */ +/*! \brief Output alarm text, and return program exit value. */ int output_alarming(void) { FILE *outfile;