[前][次][番号順一覧][スレッド一覧]

ruby-changes:30712

From: nobu <ko1@a...>
Date: Tue, 3 Sep 2013 10:17:42 +0900 (JST)
Subject: [ruby-changes:30712] nobu:r42791 (trunk): internal.h: parenthesize argument

nobu	2013-09-03 10:17:36 +0900 (Tue, 03 Sep 2013)

  New Revision: 42791

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42791

  Log:
    internal.h: parenthesize argument
    
    * internal.h (bit_length): parenthesize cast operands of a macro
      argument.

  Modified files:
    trunk/internal.h
Index: internal.h
===================================================================
--- internal.h	(revision 42790)
+++ internal.h	(revision 42791)
@@ -217,19 +217,19 @@ nlz_int128(uint128_t x) https://github.com/ruby/ruby/blob/trunk/internal.h#L217
 
 #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 {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]