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

ruby-changes:23057

From: nobu <ko1@a...>
Date: Thu, 22 Mar 2012 18:37:55 +0900 (JST)
Subject: [ruby-changes:23057] nobu:r35107 (trunk): * regint.h (BITS_IN_ROOM, BS_ROOM, BS_BIT): suppress warnings.

nobu	2012-03-22 18:37:44 +0900 (Thu, 22 Mar 2012)

  New Revision: 35107

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

  Log:
    * regint.h (BITS_IN_ROOM, BS_ROOM, BS_BIT): suppress warnings.

  Modified files:
    trunk/regint.h

Index: regint.h
===================================================================
--- regint.h	(revision 35106)
+++ regint.h	(revision 35107)
@@ -390,7 +390,7 @@
 /* bitset */
 #define BITS_PER_BYTE      8
 #define SINGLE_BYTE_SIZE   (1 << BITS_PER_BYTE)
-#define BITS_IN_ROOM       (sizeof(Bits) * BITS_PER_BYTE)
+#define BITS_IN_ROOM       ((int)sizeof(Bits) * BITS_PER_BYTE)
 #define BITSET_SIZE        (SINGLE_BYTE_SIZE / BITS_IN_ROOM)
 
 #ifdef PLATFORM_UNALIGNED_WORD_ACCESS
@@ -408,8 +408,8 @@
   for (i = 0; i < (int )BITSET_SIZE; i++) { (bs)[i] = 0; }	\
 } while (0)
 
-#define BS_ROOM(bs,pos)            (bs)[pos / BITS_IN_ROOM]
-#define BS_BIT(pos)                (1 << (pos % BITS_IN_ROOM))
+#define BS_ROOM(bs,pos)            (bs)[(int)(pos) / BITS_IN_ROOM]
+#define BS_BIT(pos)                (1 << ((int)(pos) % BITS_IN_ROOM))
 
 #define BITSET_AT(bs, pos)         (BS_ROOM(bs,pos) & BS_BIT(pos))
 #define BITSET_SET_BIT(bs, pos)     BS_ROOM(bs,pos) |= BS_BIT(pos)

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

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