diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-10 06:08:20 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-10 06:08:20 +0000 |
| commit | 5b1eda83d022aafec18c3bb3f05b1bdadb4e05ab (patch) | |
| tree | a2691158beb0b8aa840a7fa40875b4fa26283095 | |
| parent | b9e8643735fa287cc4acb04b4bedfd3468ae7a7c (diff) | |
| download | ruby-5b1eda83d022aafec18c3bb3f05b1bdadb4e05ab.tar.gz ruby-5b1eda83d022aafec18c3bb3f05b1bdadb4e05ab.tar.xz ruby-5b1eda83d022aafec18c3bb3f05b1bdadb4e05ab.zip | |
* parse.y (POINTER_P): pointer may be larger than long.
* parse.y (vtable_size, vtable_included, vtable_tblcpy,
vtable_to_tbl): constified.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | parse.y | 10 |
2 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,10 @@ +Thu May 10 15:09:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (POINTER_P): pointer may be larger than long. + + * parse.y (vtable_size, vtable_included, vtable_tblcpy, + vtable_to_tbl): constified. + Thu May 10 10:13:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * thread.c (rb_thread_priority): rdoc fix; the initial value is @@ -122,11 +122,11 @@ struct local_vars { #define DVARS_INHERIT ((void*)1) #define DVARS_TOPSCOPE NULL #define DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl)) -#define POINTER_P(val) ((unsigned long)(val) & ~3UL) +#define POINTER_P(val) ((VALUE)(val) & ~(VALUE)3) #ifndef RIPPER static int -vtable_size(struct vtable *tbl) +vtable_size(const struct vtable *tbl) { if (POINTER_P(tbl)) { return tbl->pos; @@ -180,7 +180,7 @@ vtable_add(struct vtable *tbl, ID id) } static int -vtable_included(struct vtable * tbl, ID id) +vtable_included(const struct vtable * tbl, ID id) { int i; @@ -7964,7 +7964,7 @@ local_pop_gen(struct parser_params *parser) } static ID* -vtable_tblcpy(ID *buf, struct vtable *src) +vtable_tblcpy(ID *buf, const struct vtable *src) { int i, cnt = vtable_size(src); @@ -7979,7 +7979,7 @@ vtable_tblcpy(ID *buf, struct vtable *src) } static ID* -vtable_to_tbl(struct vtable *src) +vtable_to_tbl(const struct vtable *src) { int cnt = vtable_size(src); ID *buf; |
