summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 01:17:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 01:17:36 +0000
commitf7754943be4fe6a2baa21b4b1d047394c74793a8 (patch)
treeb302da56bba560581ba0dcd00ce4dc27a5045b5f /internal.h
parent6d18cc288a6115751e96965dc56d56319b2868a8 (diff)
internal.h: parenthesize argument
* internal.h (bit_length): parenthesize cast operands of a macro argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal.h b/internal.h
index 37a595e111..9d7ce97b4c 100644
--- a/internal.h
+++ b/internal.h
@@ -217,19 +217,19 @@ nlz_int128(uint128_t x)
#if defined(HAVE_UINT128_T)
# define bit_length(x) \
- (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)x) : \
- sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)x) : \
- sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)x) : \
- SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)x))
+ (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
+ sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
+ sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)) : \
+ SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
#elif defined(HAVE_LONG_LONG)
# define bit_length(x) \
- (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)x) : \
- sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)x) : \
- SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)x))
+ (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
+ sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
+ SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)))
#else
# define bit_length(x) \
- (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)x) : \
- SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)x))
+ (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
+ SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)))
#endif
struct rb_deprecated_classext_struct {