From 7cdc73235aee44599b99a89369edbaa61f4204bc Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 12 Mar 2009 08:56:31 +0000 Subject: * st.c: use st_index_t for indexes instead of int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ st.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 225e3e0f9e..e261f64226 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 12 17:56:29 2009 Nobuyoshi Nakada + + * st.c: use st_index_t for indexes instead of int. + Thu Mar 12 09:30:54 2009 Nobuyoshi Nakada * configure.in (RUBY_CHECK_SIZEOF): if same size type is found, no diff --git a/st.c b/st.c index b5d115261c..1401ba0180 100644 --- a/st.c +++ b/st.c @@ -227,7 +227,7 @@ void st_clear(st_table *table) { register st_table_entry *ptr, *next; - int i; + st_index_t i; if (table->entries_packed) { table->num_entries = 0; @@ -284,7 +284,7 @@ st_lookup(st_table *table, register st_data_t key, st_data_t *value) register st_table_entry *ptr; if (table->entries_packed) { - int i; + st_index_t i; for (i = 0; i < table->num_entries; i++) { if ((st_data_t)table->bins[i*2] == key) { if (value !=0) *value = (st_data_t)table->bins[i*2+1]; @@ -313,7 +313,7 @@ st_get_key(st_table *table, register st_data_t key, st_data_t *result) register st_table_entry *ptr; if (table->entries_packed) { - int i; + st_index_t i; for (i = 0; i < table->num_entries; i++) { if ((st_data_t)table->bins[i*2] == key) { if (result !=0) *result = (st_data_t)table->bins[i*2]; @@ -385,7 +385,7 @@ st_insert(register st_table *table, register st_data_t key, st_data_t value) register st_table_entry *ptr; if (table->entries_packed) { - int i; + st_index_t i; for (i = 0; i < table->num_entries; i++) { if ((st_data_t)table->bins[i*2] == key) { table->bins[i*2+1] = (struct st_table_entry*)value; @@ -536,7 +536,7 @@ st_delete(register st_table *table, register st_data_t *key, st_data_t *value) register st_table_entry *ptr; if (table->entries_packed) { - int i; + st_index_t i; for (i = 0; i < table->num_entries; i++) { if ((st_data_t)table->bins[i*2] == *key) { if (value != 0) *value = (st_data_t)table->bins[i*2+1]; @@ -594,7 +594,7 @@ void st_cleanup_safe(st_table *table, st_data_t never) { st_table_entry *ptr, **last, *tmp; - int i; + st_index_t i; for (i = 0; i < table->num_bins; i++) { ptr = *(last = &table->bins[i]); @@ -616,11 +616,11 @@ st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg) { st_table_entry *ptr, **last, *tmp; enum st_retval retval; - int i; + st_index_t i; if (table->entries_packed) { for (i = 0; i < table->num_entries; i++) { - int j; + st_index_t j; st_data_t key, val; key = (st_data_t)table->bins[i*2]; val = (st_data_t)table->bins[i*2+1]; -- cgit v1.2.3