Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix problems detected by the clang lto

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5183 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
commit e8a9d92a3dde2f4bd6f230d698780d663b4a736d 1 parent b064e52
Laurent Sansonetti authored
Showing with 6 additions and 4 deletions.
  1. +1 −1  env.c
  2. +0 −2  hash.c
  3. +5 −1 st.c
View
2  env.c
@@ -662,7 +662,7 @@ env_replace(VALUE env, SEL sel, VALUE hash)
}
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()) {
View
2  hash.c
@@ -78,7 +78,6 @@ rb_hash(VALUE obj)
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 @@ st_foreach_safe(st_table *table, int (*func)(ANYARGS), st_data_t a)
{
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);
View
6 st.c
@@ -631,13 +631,14 @@ st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
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 @@ st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
return 1;
}
/* fall through */
+#endif
case ST_CONTINUE:
break;
case ST_STOP:
@@ -669,6 +671,7 @@ st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
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 @@ st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
}
}
/* fall through */
+#endif
case ST_CONTINUE:
ptr = ptr->fore;
break;
Please sign in to comment.
Something went wrong with that request. Please try again.