Skip to content

Commit 2406c22

Browse files
committed
Add casts to CONF_HANDLE_T_U().
This avoids signed/unsigned comparison warnings when specifying integer constants as inputs. Clean up whitespace and add clarifying parentheses for CONF_HANDLE_SIZE_T(opt_lg_chunk, ...).
1 parent e723f99 commit 2406c22

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/jemalloc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,18 +1075,18 @@ malloc_conf_init(void)
10751075
k, klen, v, vlen); \
10761076
} else if (clip) { \
10771077
if (CONF_MIN_##check_min(um, \
1078-
(min))) \
1078+
(t)(min))) \
10791079
o = (t)(min); \
10801080
else if (CONF_MAX_##check_max( \
1081-
um, (max))) \
1081+
um, (t)(max))) \
10821082
o = (t)(max); \
10831083
else \
10841084
o = (t)um; \
10851085
} else { \
10861086
if (CONF_MIN_##check_min(um, \
1087-
(min)) || \
1087+
(t)(min)) || \
10881088
CONF_MAX_##check_max(um, \
1089-
(max))) { \
1089+
(t)(max))) { \
10901090
malloc_conf_error( \
10911091
"Out-of-range " \
10921092
"conf value", \
@@ -1145,8 +1145,8 @@ malloc_conf_init(void)
11451145
* accommodates all these constraints.
11461146
*/
11471147
CONF_HANDLE_SIZE_T(opt_lg_chunk, "lg_chunk", LG_PAGE +
1148-
LG_SIZE_CLASS_GROUP + 1 + (config_cache_oblivious ||
1149-
config_fill ? 1 : 0), (sizeof(size_t) << 3) - 1,
1148+
LG_SIZE_CLASS_GROUP + 1 + ((config_cache_oblivious
1149+
|| config_fill) ? 1 : 0), (sizeof(size_t) << 3) - 1,
11501150
yes, yes, true)
11511151
if (strncmp("dss", k, klen) == 0) {
11521152
int i;

0 commit comments

Comments
 (0)