From ba563e4a410eb8f01709cc2f37a42361f5998311 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 5 Jul 2007 01:06:49 +0000 Subject: * include/ruby/st.h, st.c (st_init_table, st_init_table_with_size): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ hash.c | 4 ++-- include/ruby/st.h | 6 +++--- parse.y | 4 ++-- regparse.c | 4 ++-- st.c | 8 ++++---- unicode.c | 4 ++-- version.h | 6 +++--- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index b92fa9730b..f2ebafbef9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 5 10:06:47 2007 Nobuyoshi Nakada + + * include/ruby/st.h, st.c (st_init_table, st_init_table_with_size): + constified. + Wed Jul 4 23:36:27 2007 NAKAMURA, Hiroshi * lib/webrick/httpauth/authenticator.rb diff --git a/hash.c b/hash.c index 647c21803c..b2008350c2 100644 --- a/hash.c +++ b/hash.c @@ -94,7 +94,7 @@ rb_any_hash(VALUE a) } } -static struct st_hash_type objhash = { +static const struct st_hash_type objhash = { rb_any_cmp, rb_any_hash, }; @@ -1614,7 +1614,7 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash) return ary; } -static struct st_hash_type identhash = { +static const struct st_hash_type identhash = { st_numcmp, st_numhash, }; diff --git a/include/ruby/st.h b/include/ruby/st.h index d6d4479b3e..2742f8fd97 100644 --- a/include/ruby/st.h +++ b/include/ruby/st.h @@ -30,7 +30,7 @@ struct st_hash_type { }; struct st_table { - struct st_hash_type *type; + const struct st_hash_type *type; int num_bins; int num_entries; struct st_table_entry **bins; @@ -51,8 +51,8 @@ enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK}; # endif #endif -st_table *st_init_table(struct st_hash_type *); -st_table *st_init_table_with_size(struct st_hash_type *, int); +st_table *st_init_table(const struct st_hash_type *); +st_table *st_init_table_with_size(const struct st_hash_type *, int); st_table *st_init_numtable(void); st_table *st_init_numtable_with_size(int); st_table *st_init_strtable(void); diff --git a/parse.y b/parse.y index 328c7c604c..c9cd631254 100644 --- a/parse.y +++ b/parse.y @@ -8239,7 +8239,7 @@ static struct symbols { VALUE op_sym[tLAST_TOKEN]; } global_symbols = {tLAST_TOKEN}; -static struct st_hash_type symhash = { +static const struct st_hash_type symhash = { rb_str_cmp, rb_str_hash, }; @@ -8264,7 +8264,7 @@ ivar2_hash(struct ivar2_key *key) return (key->id << 8) ^ (key->klass >> 2); } -static struct st_hash_type ivar2_hash_type = { +static const struct st_hash_type ivar2_hash_type = { ivar2_cmp, ivar2_hash, }; diff --git a/regparse.c b/regparse.c index 1d669212d5..f924f1dfff 100644 --- a/regparse.c +++ b/regparse.c @@ -312,7 +312,7 @@ typedef struct { static int strend_cmp(st_strend_key*, st_strend_key*); static int strend_hash(st_strend_key*); -static struct st_hash_type type_strend_hash = { +static const struct st_hash_type type_strend_hash = { strend_cmp, strend_hash, }; @@ -4736,7 +4736,7 @@ static int type_cclass_hash(type_cclass_key* key) return val + (val >> 5); } -static struct st_hash_type type_type_cclass_hash = { +static const struct st_hash_type type_type_cclass_hash = { type_cclass_cmp, type_cclass_hash, }; diff --git a/st.c b/st.c index 880989aa34..df7b568753 100644 --- a/st.c +++ b/st.c @@ -39,14 +39,14 @@ struct st_table_entry { * */ -static struct st_hash_type type_numhash = { +static const struct st_hash_type type_numhash = { st_numcmp, st_numhash, }; /* extern int strcmp(const char *, const char *); */ static int strhash(const char *); -static struct st_hash_type type_strhash = { +static const struct st_hash_type type_strhash = { strcmp, strhash, }; @@ -145,7 +145,7 @@ stat_col() #endif st_table* -st_init_table_with_size(struct st_hash_type *type, int size) +st_init_table_with_size(const struct st_hash_type *type, int size) { st_table *tbl; @@ -168,7 +168,7 @@ st_init_table_with_size(struct st_hash_type *type, int size) } st_table* -st_init_table(struct st_hash_type *type) +st_init_table(const struct st_hash_type *type) { return st_init_table_with_size(type, 0); } diff --git a/unicode.c b/unicode.c index a85b3212af..12df76f449 100644 --- a/unicode.c +++ b/unicode.c @@ -10861,7 +10861,7 @@ code2_hash(OnigCodePoint* x) return (int )(x[0] + x[1]); } -static struct st_hash_type type_code2_hash = { +static const struct st_hash_type type_code2_hash = { code2_cmp, code2_hash, }; @@ -10879,7 +10879,7 @@ code3_hash(OnigCodePoint* x) return (int )(x[0] + x[1] + x[2]); } -static struct st_hash_type type_code3_hash = { +static const struct st_hash_type type_code3_hash = { code3_cmp, code3_hash, }; diff --git a/version.h b/version.h index d54c253e39..7cac334c4b 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-07-04" +#define RUBY_RELEASE_DATE "2007-07-05" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20070704 +#define RUBY_RELEASE_CODE 20070705 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 4 +#define RUBY_RELEASE_DAY 5 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- cgit v1.2.3