summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-03-03 06:41:32 (GMT)
committerJason Evans <jasone@canonware.com>2016-03-03 06:45:37 (GMT)
commit022f6891faf1fffa435f2bc613c25e8482a32702 (patch)
treee5e4e5f31abbeabb31ef843b14de15fed1c63a2b /src
parent33184bf69813087bf1885b0993685f9d03320c69 (diff)
downloadjemalloc-022f6891faf1fffa435f2bc613c25e8482a32702.zip
jemalloc-022f6891faf1fffa435f2bc613c25e8482a32702.tar.gz
jemalloc-022f6891faf1fffa435f2bc613c25e8482a32702.tar.bz2
Avoid a potential innocuous compiler warning.
Add a cast to avoid comparing a ssize_t value to a uint64_t value that is always larger than a 32-bit ssize_t. This silences an innocuous compiler warning from e.g. gcc 4.2.1 about the comparison always having the same result.
Diffstat (limited to 'src')
-rw-r--r--src/arena.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/arena.c b/src/arena.c
index 965c0fe..f436959 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -1352,7 +1352,11 @@ static bool
arena_decay_time_valid(ssize_t decay_time)
{
- return (decay_time >= -1 && decay_time <= NSTIME_SEC_MAX);
+ if (decay_time < -1)
+ return (false);
+ if (decay_time == -1 || (uint64_t)decay_time <= NSTIME_SEC_MAX)
+ return (true);
+ return (false);
}
ssize_t