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

ruby-changes:1836

From: ko1@a...
Date: 1 Sep 2007 14:24:36 +0900
Subject: [ruby-changes:1836] nobu - Ruby:r13327 (trunk): * include/ruby/st.h (rb_index_t): use st_data_t for the platforms it

nobu	2007-09-01 14:24:25 +0900 (Sat, 01 Sep 2007)

  New Revision: 13327

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/st.h

  Log:
    * include/ruby/st.h (rb_index_t): use st_data_t for the platforms it
      is larger than int.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/st.h?r1=13327&r2=13326
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13327&r2=13326

Index: include/ruby/st.h
===================================================================
--- include/ruby/st.h	(revision 13326)
+++ include/ruby/st.h	(revision 13327)
@@ -49,15 +49,14 @@
     int (*hash)(ANYARGS /*st_data_t*/);               /* st_hash_func* */
 };
 
-typedef unsigned int st_index_t;
-#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT - 1)
+typedef st_data_t st_index_t;
+#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
 
 struct st_table {
     const struct st_hash_type *type;
     unsigned int entries_packed : 1;
-    st_index_t num_bins : ST_INDEX_BITS;
-    unsigned int st_dummy_bit : 1;
-    st_index_t num_entries : ST_INDEX_BITS;
+    st_index_t num_bins : ST_INDEX_BITS - 1;
+    st_index_t num_entries;
     struct st_table_entry **bins;
     struct st_table_entry *head;
 };
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13326)
+++ ChangeLog	(revision 13327)
@@ -1,12 +1,12 @@
-Sat Sep  1 11:14:38 2007  Nobuyoshi Nakada  <nobu@r...>
+Sat Sep  1 14:24:23 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* st.c (st_numcmp, st_numhash): use st_data_t instead of long, because
 	  the former may be larger than the latter.
 
 	* include/ruby/st.h (CHAR_BIT): get rid of magic number.
 
-	* include/ruby/st.h (struct st_table): num_entries never exceed
-	  num_bins.
+	* include/ruby/st.h (rb_index_t): use st_data_t for the platforms it
+	  is larger than int.
 
 Fri Aug 31 07:12:24 2007  NAKAMURA Usaku  <usa@r...>
 

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

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