[macruby-changes] [5183] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Jan 19 19:08:29 PST 2011


Revision: 5183
          http://trac.macosforge.org/projects/ruby/changeset/5183
Author:   lsansonetti at apple.com
Date:     2011-01-19 19:08:29 -0800 (Wed, 19 Jan 2011)
Log Message:
-----------
fix problems detected by the clang lto

Modified Paths:
--------------
    MacRuby/trunk/env.c
    MacRuby/trunk/hash.c
    MacRuby/trunk/st.c

Modified: MacRuby/trunk/env.c
===================================================================
--- MacRuby/trunk/env.c	2011-01-18 03:00:21 UTC (rev 5182)
+++ MacRuby/trunk/env.c	2011-01-20 03:08:29 UTC (rev 5183)
@@ -662,7 +662,7 @@
 }
 
 static int
-env_update_i(VALUE key, VALUE val)
+env_update_i(VALUE key, VALUE val, VALUE ctx)
 {
     if (key != Qundef) {
 	if (rb_block_given_p()) {

Modified: MacRuby/trunk/hash.c
===================================================================
--- MacRuby/trunk/hash.c	2011-01-18 03:00:21 UTC (rev 5182)
+++ MacRuby/trunk/hash.c	2011-01-20 03:08:29 UTC (rev 5183)
@@ -78,7 +78,6 @@
 typedef int st_foreach_func(st_data_t, st_data_t, st_data_t);
 
 struct foreach_safe_arg {
-    st_table *tbl;
     st_foreach_func *func;
     st_data_t arg;
 };
@@ -101,7 +100,6 @@
 {
     struct foreach_safe_arg arg;
 
-    arg.tbl = table;
     arg.func = (st_foreach_func *)func;
     arg.arg = a;
     st_foreach(table, foreach_safe_i, (st_data_t)&arg);

Modified: MacRuby/trunk/st.c
===================================================================
--- MacRuby/trunk/st.c	2011-01-18 03:00:21 UTC (rev 5182)
+++ MacRuby/trunk/st.c	2011-01-20 03:08:29 UTC (rev 5183)
@@ -631,13 +631,14 @@
 
     if (table->entries_packed) {
         for (i = 0; i < table->num_entries; i++) {
-            int j;
+            //int j;
             st_data_t key, val;
             key = (st_data_t)table->bins[i*2];
             val = (st_data_t)table->bins[i*2+1];
             retval = (*func)(key, val, arg);
             switch (retval) {
 	      case ST_CHECK:	/* check if hash is modified during iteration */
+#if 0 // XXX disabled because unused and causes clang errors
                 for (j = 0; j < table->num_entries; j++) {
                     if ((st_data_t)table->bins[j*2] == key)
                         break;
@@ -648,6 +649,7 @@
                     return 1;
                 }
 		/* fall through */
+#endif
 	      case ST_CONTINUE:
 		break;
 	      case ST_STOP:
@@ -669,6 +671,7 @@
 	    retval = (*func)(ptr->key, ptr->record, arg);
 	    switch (retval) {
 	      case ST_CHECK:	/* check if hash is modified during iteration */
+#if 0 // XXX disabled because unused and causes clang errors
 		i = ptr->hash % table->num_bins;
 		for (tmp = table->bins[i]; tmp != ptr; tmp = tmp->next) {
 		    if (!tmp) {
@@ -678,6 +681,7 @@
 		    }
 		}
 		/* fall through */
+#endif
 	      case ST_CONTINUE:
 		ptr = ptr->fore;
 		break;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110119/344c6c60/attachment.html>


More information about the macruby-changes mailing list