summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-05 01:06:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-05 01:06:49 +0000
commit4614a125cca9aa314ecccb34589b69aa762721d6 (patch)
treea254794a8cd36c4f85f6aca7a555455cecc85203
parente54f12b8d237fd6706b48af8b3f99a17ccfb1481 (diff)
downloadruby-4614a125cca9aa314ecccb34589b69aa762721d6.tar.gz
ruby-4614a125cca9aa314ecccb34589b69aa762721d6.tar.xz
ruby-4614a125cca9aa314ecccb34589b69aa762721d6.zip
* include/ruby/st.h, st.c (st_init_table, st_init_table_with_size):
constified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--hash.c4
-rw-r--r--include/ruby/st.h6
-rw-r--r--parse.y4
-rw-r--r--regparse.c4
-rw-r--r--st.c8
-rw-r--r--unicode.c4
-rw-r--r--version.h6
8 files changed, 23 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index b92fa9730..f2ebafbef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 5 10:06:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/st.h, st.c (st_init_table, st_init_table_with_size):
+ constified.
+
Wed Jul 4 23:36:27 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/webrick/httpauth/authenticator.rb
diff --git a/hash.c b/hash.c
index 647c21803..b2008350c 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 d6d4479b3..2742f8fd9 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 328c7c604..c9cd63125 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 1d669212d..f924f1dff 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 880989aa3..df7b56875 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 a85b3212a..12df76f44 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 d54c253e3..7cac334c4 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[];