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

ruby-changes:45065

From: nobu <ko1@a...>
Date: Wed, 21 Dec 2016 20:20:08 +0900 (JST)
Subject: [ruby-changes:45065] nobu:r57138 (trunk): st.c: suppress a warning

nobu	2016-12-21 20:20:02 +0900 (Wed, 21 Dec 2016)

  New Revision: 57138

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57138

  Log:
    st.c: suppress a warning
    
    * st.c (st_hash): suppress unused label warning on 32bit
      platforms.  fix up r57134.

  Modified files:
    trunk/st.c
Index: st.c
===================================================================
--- st.c	(revision 57137)
+++ st.c	(revision 57138)
@@ -1714,6 +1714,7 @@ st_hash(const void *ptr, size_t len, st_ https://github.com/ruby/ruby/blob/trunk/st.c#L1714
 #else
 #define UNALIGNED_ADD_ALL UNALIGNED_ADD_4
 #endif
+#undef SKIP_TAIL
     if (len >= sizeof(st_index_t)) {
 #if !UNALIGNED_WORD_ACCESS
 	int align = (int)((st_data_t)data % sizeof(st_index_t));
@@ -1778,6 +1779,7 @@ st_hash(const void *ptr, size_t len, st_ https://github.com/ruby/ruby/blob/trunk/st.c#L1779
 #endif
 
 	    if (len < (size_t)align) goto skip_tail;
+# define SKIP_TAIL 1
 	    h = murmur_step(h, t);
 	    data += pack;
 	    len -= pack;
@@ -1804,6 +1806,7 @@ st_hash(const void *ptr, size_t len, st_ https://github.com/ruby/ruby/blob/trunk/st.c#L1806
 	case 4:
 	    t |= (st_index_t)*(uint32_t*)data;
 	    goto skip_tail;
+# define SKIP_TAIL 1
 #endif
 	case 3: t |= data_at(2) << 16;
 	case 2: t |= data_at(1) << 8;
@@ -1819,7 +1822,7 @@ st_hash(const void *ptr, size_t len, st_ https://github.com/ruby/ruby/blob/trunk/st.c#L1822
 	UNALIGNED_ADD_ALL;
 #undef UNALIGNED_ADD
 #endif
-#if !UNALIGNED_WORD_ACCESS || (SIZEOF_ST_INDEX_T <= 8 && CHAR_BIT == 8)
+#ifdef SKIP_TAIL
       skip_tail:
 #endif
 	h ^= t; h -= ROTL(t, 7);

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

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