Squashed warnings

This commit is contained in:
Sergey Lyubka 2014-08-25 08:20:56 +01:00
parent 4e9adb59f3
commit 7db6cc09d8

6
slre.c
View File

@ -28,7 +28,7 @@
#define FAIL_IF(condition, error_code) if (condition) return (error_code)
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(ar) (int) (sizeof(ar) / sizeof((ar)[0]))
#define ARRAY_SIZE(ar) (sizeof(ar) / sizeof((ar)[0]))
#endif
#ifdef SLRE_DEBUG
@ -377,7 +377,7 @@ static int foo(const char *re, int re_len, const char *s, int s_len,
step = get_op_len(re + i, re_len - i);
if (re[i] == '|') {
FAIL_IF(info->num_branches >= ARRAY_SIZE(info->branches),
FAIL_IF(info->num_branches >= (int) ARRAY_SIZE(info->branches),
SLRE_TOO_MANY_BRANCHES);
info->branches[info->num_branches].bracket_index =
info->brackets[info->num_brackets - 1].len == -1 ?
@ -397,7 +397,7 @@ static int foo(const char *re, int re_len, const char *s, int s_len,
SLRE_INVALID_METACHARACTER);
}
} else if (re[i] == '(') {
FAIL_IF(info->num_brackets >= ARRAY_SIZE(info->brackets),
FAIL_IF(info->num_brackets >= (int) ARRAY_SIZE(info->brackets),
SLRE_TOO_MANY_BRACKETS);
depth++; /* Order is important here. Depth increments first. */
info->brackets[info->num_brackets].ptr = re + i + 1;