mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
151d11b5b1
commit
ba563e4a41
8 changed files with 23 additions and 18 deletions
|
@ -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
|
||||
|
|
4
hash.c
4
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,
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
4
parse.y
4
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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
8
st.c
8
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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue