Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit a871bb6

Browse files
committed
Converter: Rename MIN and MAX macros
Those names are really common and they are confliting with the definition of another macro on Contiki, so renaming then. Signed-off-by: José Roberto de Souza <[email protected]>
1 parent b132c9e commit a871bb6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/modules/flow/converter/string-format.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848

4949
#include "string-format.h"
5050

51-
#define MIN(x, y) (((x) > (y)) ? (y) : (x))
52-
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
51+
#define SF_MIN(x, y) (((x) > (y)) ? (y) : (x))
52+
#define SF_MAX(x, y) (((x) > (y)) ? (x) : (y))
5353

5454
struct format_spec_data {
5555
ssize_t width;
@@ -632,9 +632,9 @@ insert_thousands_grouping(
632632
}
633633

634634
while ((l = group_generator_next(&groupgen)) > 0) {
635-
l = MIN(l, MAX(MAX(remaining, min_width), 1));
636-
n_zeros = MAX(0, l - remaining);
637-
n_chars = MAX(0, MIN(remaining, l));
635+
l = SF_MIN(l, SF_MAX(SF_MAX(remaining, min_width), 1));
636+
n_zeros = SF_MAX(0, l - remaining);
637+
n_chars = SF_MAX(0, SF_MIN(remaining, l));
638638

639639
/* Use n_zero zero's and n_chars chars */
640640
/* Count only, don't do anything. */
@@ -661,9 +661,9 @@ insert_thousands_grouping(
661661
if (!loop_broken) {
662662
/* We left the loop without using a break statement. */
663663

664-
l = MAX(MAX(remaining, min_width), 1);
665-
n_zeros = MAX(0, l - remaining);
666-
n_chars = MAX(0, MIN(remaining, l));
664+
l = SF_MAX(SF_MAX(remaining, min_width), 1);
665+
n_zeros = SF_MAX(0, l - remaining);
666+
n_chars = SF_MAX(0, SF_MIN(remaining, l));
667667

668668
/* Use n_zero zero's and n_chars chars */
669669
count += (use_separator ? thousands_sep_len : 0) + n_zeros + n_chars;

0 commit comments

Comments
 (0)