clean up: fix couple compiler warnings

src/sort.c:255:5: warning: no previous prototype for 'merge'
src/sort.c:290:2: warning: ISO C90 forbids mixed declarations and code
src/mustach-dhcpd-pools.c:67:5: warning: no previous prototype for 'must_put_err'
src/output.c:109:26: warning: comparing floating point with == or != is unsafe (x5)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-13 10:34:21 +00:00
parent 88a3f1eb53
commit 8fba5c5e6b
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
5 changed files with 27 additions and 24 deletions

View file

@ -252,7 +252,7 @@ comparer_t field_selector(char c)
* \param right The right side of the merge sort.
* \return Relevant for merge sort decision.
*/
int merge(struct conf_t *state, struct range_t *restrict left, struct range_t *restrict right)
static int merge(struct conf_t *state, struct range_t *restrict left, struct range_t *restrict right)
{
struct output_sort *p;
int ret;
@ -282,13 +282,12 @@ void mergesort_ranges(struct conf_t *state, struct range_t *restrict orig, unsig
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;
if (temp == NULL)
temp = xmalloc(sizeof(struct range_t) * size);
/* Merge sort split size */
static const unsigned int MIN_MERGE_SIZE = 8;
if (size < MIN_MERGE_SIZE) {
for (left = 0; left < size; left++) {
hold = *(orig + left);