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

ruby-changes:39597

From: nobu <ko1@a...>
Date: Wed, 26 Aug 2015 09:26:22 +0900 (JST)
Subject: [ruby-changes:39597] nobu:r51678 (trunk): id_table.c: fix for C89 compilers

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

  New Revision: 51678

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

  Log:
    id_table.c: fix for C89 compilers
    
    * id_table.c (list_table_extend, hash_table_extend): remove C99
      features.  [ruby-dev:49239] [Bug #11487]

  Modified files:
    trunk/ChangeLog
    trunk/id_table.c
Index: id_table.c
===================================================================
--- id_table.c	(revision 51677)
+++ id_table.c	(revision 51678)
@@ -450,7 +450,10 @@ list_table_extend(struct list_id_table * https://github.com/ruby/ruby/blob/trunk/id_table.c#L450
 	     */
 
 	    /* memmove */
-	    // fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n", old_values, new_values, num, capa);
+	    if (0) {
+		fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n",
+			old_values, new_values, num, capa);
+	    }
 	    assert(num < capa);
 	    assert(num == 0 || old_values < new_values);
 
@@ -1274,7 +1277,8 @@ hash_table_extend(struct hash_id_table* https://github.com/ruby/ruby/blob/trunk/id_table.c#L1277
 	int new_cap = round_capa(tbl->num + (tbl->num >> 1));
 	int i;
 	item_t* old;
-	struct hash_id_table tmp_tbl = {new_cap, 0, 0};
+	struct hash_id_table tmp_tbl = {0, 0, 0};
+	tmp_tbl.capa = new_cap;
 	tmp_tbl.items = ZALLOC_N(item_t, new_cap);
 	for (i = 0; i < tbl->capa; i++) {
 	    id_key_t key = ITEM_GET_KEY(tbl, i);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51677)
+++ ChangeLog	(revision 51678)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Aug 26 09:26:00 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* id_table.c (list_table_extend, hash_table_extend): remove C99
+	  features.  [ruby-dev:49239] [Bug #11487]
+
 Tue Aug 25 06:34:43 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* win32/win32.c (w32_symlink): implement symlink().

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

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