diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-07 04:58:07 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-07 04:58:07 +0000 |
| commit | ae58564f890f2755c9f1ec421b1a16a1b581f2d1 (patch) | |
| tree | 532b4429d919ad1070f2936d122329140ed76e9a /include/ruby/ruby.h | |
| parent | 8b9f85f4065592ce90361850b14ca9f95ce84f75 (diff) | |
| download | ruby-ae58564f890f2755c9f1ec421b1a16a1b581f2d1.tar.gz ruby-ae58564f890f2755c9f1ec421b1a16a1b581f2d1.tar.xz ruby-ae58564f890f2755c9f1ec421b1a16a1b581f2d1.zip | |
* include/ruby/ruby.h (ruby_special_consts): added RUBY_SPECIAL_SHIFT.
* .gdbinit: some improvements.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
| -rw-r--r-- | include/ruby/ruby.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 893142167..905ff7d4a 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -209,9 +209,9 @@ VALUE rb_ull2inum(unsigned LONG_LONG); #define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK) -#define SYMBOL_P(x) (((VALUE)(x)&0xff)==SYMBOL_FLAG) -#define ID2SYM(x) ((VALUE)(((long)(x))<<8|SYMBOL_FLAG)) -#define SYM2ID(x) RSHIFT((unsigned long)x,8) +#define SYMBOL_P(x) (((VALUE)(x)&~(~(VALUE)0<<RUBY_SPECIAL_SHIFT))==SYMBOL_FLAG) +#define ID2SYM(x) (((VALUE)(x)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG) +#define SYM2ID(x) RSHIFT((unsigned long)x,RUBY_SPECIAL_SHIFT) /* special contants - i.e. non-zero and non-fixnum constants */ enum ruby_special_consts { @@ -223,6 +223,7 @@ enum ruby_special_consts { RUBY_IMMEDIATE_MASK = 0x03, RUBY_FIXNUM_FLAG = 0x01, RUBY_SYMBOL_FLAG = 0x0e, + RUBY_SPECIAL_SHIFT = 8, }; #define Qfalse ((VALUE)RUBY_Qfalse) |
