diff --git a/.gdbinit b/.gdbinit index f16482fbf3..e13ac90d82 100644 --- a/.gdbinit +++ b/.gdbinit @@ -147,7 +147,7 @@ define rp else if ($flags & 0x1f) == 0x1f printf "T_NODE(" - output (enum node_type)(($flags&NODE_TYPEMASK)>>NODE_TYPESHIFT) + output (enum node_type)(($flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT) printf "): " print *(NODE *)$arg0 else @@ -190,7 +190,7 @@ document rp end define nd_type - print (enum node_type)((((NODE*)$arg0)->flags&NODE_TYPEMASK)>>NODE_TYPESHIFT) + print (enum node_type)((((NODE*)$arg0)->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT) end document nd_type Print a Ruby' node type. @@ -204,7 +204,7 @@ document nd_file end define nd_line - print ((unsigned int)((((NODE*)$arg0)->flags>>NODE_LSHIFT)&NODE_LMASK)) + print ((unsigned int)((((NODE*)$arg0)->flags>>RUBY_NODE_LSHIFT)&RUBY_NODE_LMASK)) end document nd_line Print the source line number of a node. diff --git a/ChangeLog b/ChangeLog index e4c9f04a2b..b0f973011b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Oct 7 22:00:01 2007 Tanaka Akira + + * include/ruby/node.h: make node flags as VALUE type. + enum ruby_node_flags removed. + + * ruby.c: define RUBY_NODE_* as const for gdb. + Sun Oct 7 18:57:12 2007 Tanaka Akira * include/ruby/ruby.h: enum ruby_value_flags removed. [ruby-dev:31959] diff --git a/include/ruby/node.h b/include/ruby/node.h index 4d6d73c7fd..a5b66d35f9 100644 --- a/include/ruby/node.h +++ b/include/ruby/node.h @@ -271,26 +271,18 @@ typedef struct RNode { #define RNODE(obj) (R_CAST(RNode)(obj)) - /* 0..4:T_TYPES, 5:FL_MARK, 6:reserved, 7:NODE_NEWLINE */ -enum ruby_node_flags { - NODE_NEWLINE = (1<<7), -#define NODE_NEWLINE NODE_NEWLINE +#define NODE_NEWLINE (((VALUE)1)<<7) - NODE_TYPESHIFT = 8, -#define NODE_TYPESHIFT NODE_TYPESHIFT - NODE_TYPEMASK = (0x7f<flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) #define nd_set_type(n,t) \ RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|(((t)<flags>>NODE_LSHIFT)&NODE_LMASK)) #define nd_set_line(n,l) \ RNODE(n)->flags=((RNODE(n)->flags&~(-1<