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"
/*! \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;
}

View file

@ -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;
}

View file

@ -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 */

View file

@ -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;