* internal.h (bit_length): Add casts to fix complation error with

clang 3.0 -Werror,-Wshorten-64-to-32.
  [ruby-dev:47687] reported by SASADA Koichi.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-09-02 22:29:48 +00:00
Родитель 69d0f84bfa
Коммит 3065dd71e8
2 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Sep 3 07:28:49 2013 Tanaka Akira <akr@fsij.org>
* internal.h (bit_length): Add casts to fix complation error with
clang 3.0 -Werror,-Wshorten-64-to-32.
[ruby-dev:47687] reported by SASADA Koichi.
Tue Sep 3 03:17:26 2013 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c (vm_search_super_method): use ci->argc instead of

Просмотреть файл

@ -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(x) : \
sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long(x) : \
sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long(x) : \
SIZEOF_INT128_T * CHAR_BIT - nlz_int128(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(x) : \
sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long(x) : \
SIZEOF_LONG_LONG * CHAR_BIT - nlz_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(x) : \
SIZEOF_LONG * CHAR_BIT - nlz_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 {