From a80975497968e69b23f56bf15d346c65bec381f2 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 17:39:01 +0100 Subject: extensions: use UINT_MAX constants over open-coded bits (1/2) ~0 depends on the sizeof(int), so it is better to use UINT32_MAX. Signed-off-by: Jan Engelhardt --- extensions/libxt_mark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'extensions/libxt_mark.c') diff --git a/extensions/libxt_mark.c b/extensions/libxt_mark.c index 811cc77e..5a95d519 100644 --- a/extensions/libxt_mark.c +++ b/extensions/libxt_mark.c @@ -29,16 +29,16 @@ static int mark_mt_parse(int c, char **argv, int invert, unsigned int *flags, const void *entry, struct xt_entry_match **match) { struct xt_mark_mtinfo1 *info = (void *)(*match)->data; - unsigned int mark, mask = ~0U; + unsigned int mark, mask = UINT32_MAX; char *end; switch (c) { case '1': /* --mark */ param_act(P_ONLY_ONCE, "mark", "--mark", *flags & F_MARK); - if (!strtonum(optarg, &end, &mark, 0, ~0U)) + if (!strtonum(optarg, &end, &mark, 0, UINT32_MAX)) param_act(P_BAD_VALUE, "mark", "--mark", optarg); if (*end == '/') - if (!strtonum(end + 1, &end, &mask, 0, ~0U)) + if (!strtonum(end + 1, &end, &mask, 0, UINT32_MAX)) param_act(P_BAD_VALUE, "mark", "--mark", optarg); if (*end != '\0') param_act(P_BAD_VALUE, "mark", "--mark", optarg); -- cgit v1.2.3