diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h index 80e422d..2bb365c 100644 --- a/src/dhcpd-pools.h +++ b/src/dhcpd-pools.h @@ -279,7 +279,7 @@ extern void set_ipv_functions(struct conf_t *state, int version); extern void flip_ranges(struct conf_t *state); extern void clean_up(struct conf_t *state); extern void parse_cidr(struct conf_t *state, struct range_t *range_p, const char *word); -extern int parse_color_mode(const char *restrict optarg); +extern int parse_color_mode(const char *restrict arg); extern double strtod_or_err(const char *restrict str, const char *restrict errmesg); extern void __attribute__ ((noreturn)) print_version(void); extern void __attribute__ ((noreturn)) usage(int status); diff --git a/src/output.c b/src/output.c index c99eba2..a2f0c29 100644 --- a/src/output.c +++ b/src/output.c @@ -219,7 +219,6 @@ static void close_outfile(FILE *outfile) /*! \brief Text output format, which is the default. */ static int output_txt(struct conf_t *state) { - unsigned int i; struct range_t *range_p; struct shared_network_t *shared_p; struct output_helper_t oh; @@ -249,6 +248,7 @@ static int output_txt(struct conf_t *state) fprintf(outfile, "\n"); } if (state->number_limit & R_BIT) { + unsigned int i; for (i = 0; i < state->num_ranges; i++) { int color_set = 0; @@ -366,7 +366,6 @@ static int output_txt(struct conf_t *state) /*! \brief The xml output formats. */ static int output_xml(struct conf_t *state) { - unsigned int i; struct range_t *range_p; struct shared_network_t *shared_p; struct output_helper_t oh; @@ -394,6 +393,7 @@ static int output_xml(struct conf_t *state) } if (state->number_limit & R_BIT) { + unsigned int i; for (i = 0; i < state->num_ranges; i++) { if (range_output_helper(state, &oh, range_p)) { range_p++; @@ -762,7 +762,6 @@ static void newsection(FILE *restrict f, char const *restrict title) /*! \brief Output html format. */ static int output_html(struct conf_t *state) { - unsigned int i; struct range_t *range_p; struct shared_network_t *shared_p; struct output_helper_t oh; @@ -877,6 +876,7 @@ static int output_html(struct conf_t *state) end_tag(outfile, "thead"); } if (state->number_limit & R_BIT) { + unsigned int i; start_tag(outfile, "tbody"); for (i = 0; i < state->num_ranges; i++) { if (range_output_helper(state, &oh, range_p)) { @@ -916,7 +916,6 @@ static int output_html(struct conf_t *state) /*! \brief Output cvs format. */ static int output_csv(struct conf_t *state) { - unsigned int i; struct range_t *range_p; struct shared_network_t *shared_p; struct output_helper_t oh; @@ -935,6 +934,7 @@ static int output_csv(struct conf_t *state) fprintf(outfile, "\n"); } if (state->number_limit & R_BIT) { + unsigned int i; for (i = 0; i < state->num_ranges; i++) { if (range_output_helper(state, &oh, range_p)) { range_p++; diff --git a/src/sort.c b/src/sort.c index 2c3a05f..ab252c0 100644 --- a/src/sort.c +++ b/src/sort.c @@ -286,7 +286,6 @@ void mergesort_ranges(struct conf_t *state, struct range_t *restrict orig, unsig struct range_t *restrict temp, const int root_call) { unsigned int left, i, u_right; - int s_right; struct range_t hold; /* Merge sort split size */ static const unsigned int MIN_MERGE_SIZE = 8; @@ -296,6 +295,8 @@ void mergesort_ranges(struct conf_t *state, struct range_t *restrict orig, unsig if (size < MIN_MERGE_SIZE) { for (left = 0; left < size; left++) { + int s_right; + hold = *(orig + left); for (s_right = left - 1; 0 <= s_right; s_right--) { if (merge(state, (orig + s_right), &hold))