Silence compiler warnings for unreachable code.

Reported by Ingvar Hagelund.
This commit is contained in:
Jason Evans 2015-08-19 23:28:34 -07:00
parent d01fd19755
commit b5c2a347d7

View File

@ -659,12 +659,13 @@ arena_mapbits_size_decode(size_t mapbits)
{
size_t size;
if (CHUNK_MAP_SIZE_SHIFT > 0)
#if CHUNK_MAP_SIZE_SHIFT > 0
size = (mapbits & CHUNK_MAP_SIZE_MASK) >> CHUNK_MAP_SIZE_SHIFT;
else if (CHUNK_MAP_SIZE_SHIFT == 0)
#elif CHUNK_MAP_SIZE_SHIFT == 0
size = mapbits & CHUNK_MAP_SIZE_MASK;
else
#else
size = (mapbits & CHUNK_MAP_SIZE_MASK) << -CHUNK_MAP_SIZE_SHIFT;
#endif
return (size);
}
@ -776,12 +777,13 @@ arena_mapbits_size_encode(size_t size)
{
size_t mapbits;
if (CHUNK_MAP_SIZE_SHIFT > 0)
#if CHUNK_MAP_SIZE_SHIFT > 0
mapbits = size << CHUNK_MAP_SIZE_SHIFT;
else if (CHUNK_MAP_SIZE_SHIFT == 0)
#elif CHUNK_MAP_SIZE_SHIFT == 0
mapbits = size;
else
#else
mapbits = size >> -CHUNK_MAP_SIZE_SHIFT;
#endif
assert((mapbits & ~CHUNK_MAP_SIZE_MASK) == 0);
return (mapbits);