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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2015-11-28 21:03:38 +00:00
parent f11ca0bec2
commit 4aff49ed80
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
4 changed files with 15 additions and 32 deletions

View file

@ -46,20 +46,17 @@
#include "dhcpd-pools.h" #include "dhcpd-pools.h"
/*! \brief Prepare data for analysis. The function will sort leases and /*! \brief Prepare data for analysis. The function will sort leases and
* ranges. * ranges. */
* FIXME: This function should return void. */ void prepare_data(void)
int prepare_data(void)
{ {
/* Sort leases */ /* Sort leases */
HASH_SORT(leases, leasecomp); HASH_SORT(leases, leasecomp);
/* Sort ranges */ /* Sort ranges */
qsort(ranges, (size_t)num_ranges, sizeof(struct range_t), &rangecomp); qsort(ranges, (size_t)num_ranges, sizeof(struct range_t), &rangecomp);
return 0;
} }
/*! \brief Perform counting. Join leases with ranges, and update counters. /*! \brief Perform counting. Join leases with ranges, and update counters. */
* FIXME: This function should return void. */ void do_counting(void)
int do_counting(void)
{ {
struct range_t *restrict range_p; struct range_t *restrict range_p;
const struct leases_t *restrict l = leases; const struct leases_t *restrict l = leases;
@ -121,5 +118,4 @@ int do_counting(void)
shared_networks->backups += range_p->backups; shared_networks->backups += range_p->backups;
range_p++; range_p++;
} }
return 0;
} }

View file

@ -287,9 +287,8 @@ int main(int argc, char **argv)
} }
/*! \brief Run time initialization. Global allocations, counter /*! \brief Run time initialization. Global allocations, counter
* initializations, etc are here. * initializations, etc are here. */
* FIXME: This function should return void. */ void prepare_memory(void)
int prepare_memory(void)
{ {
config.dhcp_version = VERSION_UNKNOWN; config.dhcp_version = VERSION_UNKNOWN;
RANGES = 64; RANGES = 64;
@ -301,5 +300,4 @@ int prepare_memory(void)
shared_networks->used = 0; shared_networks->used = 0;
shared_networks->touched = 0; shared_networks->touched = 0;
shared_networks->backups = 0; shared_networks->backups = 0;
return 0;
} }

View file

@ -219,13 +219,13 @@ extern struct leases_t *leases;
extern unsigned int RANGES; extern unsigned int RANGES;
/* Function prototypes */ /* Function prototypes */
extern int prepare_memory(void); extern void prepare_memory(void);
extern void set_ipv_functions(int version); extern void set_ipv_functions(int version);
extern int parse_leases(void); extern int parse_leases(void);
extern void parse_config(int, const char *__restrict, struct shared_network_t *__restrict) extern void parse_config(int, const char *__restrict, struct shared_network_t *__restrict)
__attribute__ ((nonnull(2, 3))); __attribute__ ((nonnull(2, 3)));
extern int prepare_data(void); extern void prepare_data(void);
extern int do_counting(void); extern void do_counting(void);
extern void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges) extern void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges)
__attribute__ ((nonnull(1, 2))); __attribute__ ((nonnull(1, 2)));
/* support functions */ /* support functions */

View file

@ -58,8 +58,7 @@
#include "dhcpd-pools.h" #include "dhcpd-pools.h"
/*! \brief Text output format, which is the default. /*! \brief Text output format, which is the default. */
* FIXME: This function should return void. */
int output_txt(void) int output_txt(void)
{ {
unsigned int i; unsigned int i;
@ -214,9 +213,7 @@ int output_txt(void)
return 0; return 0;
} }
/*! \brief The xml output formats. /*! \brief The xml output formats. */
* FIXME: This function should return void.
*/
int output_xml(void) int output_xml(void)
{ {
unsigned int i; unsigned int i;
@ -319,9 +316,7 @@ int output_xml(void)
return 0; return 0;
} }
/*! \brief The json output formats. /*! \brief The json output formats. */
* FIXME: This function should return void.
*/
int output_json(void) int output_json(void)
{ {
unsigned int i = 0; unsigned int i = 0;
@ -598,9 +593,7 @@ static void newsection(FILE *restrict f, char const *restrict title)
output_line(f, "h3", title); output_line(f, "h3", title);
} }
/*! \brief Output html format. /*! \brief Output html format. */
* FIXME: This function should return void.
*/
int output_html(void) int output_html(void)
{ {
unsigned int i; unsigned int i;
@ -788,9 +781,7 @@ int output_html(void)
return 0; return 0;
} }
/*! \brief Output cvs format. /*! \brief Output cvs format. */
* FIXME: This function should return void.
*/
int output_csv(void) int output_csv(void)
{ {
unsigned int i; unsigned int i;
@ -932,9 +923,7 @@ int output_csv(void)
return 0; return 0;
} }
/*! \brief Output alarm text, and return program exit value. /*! \brief Output alarm text, and return program exit value. */
* FIXME: This function should return void.
*/
int output_alarming(void) int output_alarming(void)
{ {
FILE *outfile; FILE *outfile;