1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/node.h (NODE_LMASK, nd_line): shouldn't use int and/or

long carelessly.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2007-06-25 09:01:27 +00:00
parent 4bdb5ced9a
commit a00c1ed672
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Mon Jun 25 17:59:32 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* include/ruby/node.h (NODE_LMASK, nd_line): shouldn't use int and/or
long carelessly.
Mon Jun 25 11:36:35 2007 Koichi Sasada <ko1@atdot.net>
* gc.h: add RUBY_ prefix to debug macros.

View file

@ -173,8 +173,8 @@ typedef struct RNode {
RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|(((t)<<NODE_TYPESHIFT)&NODE_TYPEMASK))
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
#define NODE_LMASK (((long)1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
#define nd_line(n) ((unsigned int)(((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK))
#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
#define nd_line(n) ((VALUE)(((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK))
#define nd_set_line(n,l) \
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))