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

ruby-changes:39599

From: nobu <ko1@a...>
Date: Wed, 26 Aug 2015 09:46:42 +0900 (JST)
Subject: [ruby-changes:39599] nobu:r51680 (trunk): id_table.c: constify

nobu	2015-08-26 09:46:34 +0900 (Wed, 26 Aug 2015)

  New Revision: 51680

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

  Log:
    id_table.c: constify
    
    * id_table.c (find_empty): constify static data.

  Modified files:
    trunk/id_table.c
Index: id_table.c
===================================================================
--- id_table.c	(revision 51679)
+++ id_table.c	(revision 51680)
@@ -822,13 +822,13 @@ find_empty(register sa_table* table, reg https://github.com/ruby/ruby/blob/trunk/id_table.c#L822
 {
     sa_index_t new_pos = table->free_pos-1;
     sa_entry *entry;
-    static unsigned offsets[][3] = {
-	    {1, 2, 3},
-	    {2, 3, 0},
-	    {3, 1, 0},
-	    {2, 1, 0}
+    static const unsigned offsets[][3] = {
+	{1, 2, 3},
+	{2, 3, 0},
+	{3, 1, 0},
+	{2, 1, 0}
     };
-    unsigned *check = offsets[pos&3];
+    const unsigned *const check = offsets[pos&3];
     pos &= FLOOR_TO_4;
     entry = table->entries+pos;
 

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

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