summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-15 02:17:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-15 02:17:48 +0000
commit375258ed9833762bb4ff19ccb3aba31aa2cd9cda (patch)
treead60c00d0d39a9477b1603fa31b69bdf33901362
parentafdeb2d35ec63079a37bffbc81b5e7c54760ee5d (diff)
* include/ruby/ruby.h ({RSTRING,RBIGNUM}_EMBED_LEN_MAX): made int.
* include/ruby/ruby.h (OBJ_{TAINTED,UNTRUSTED,FROZEN}): return int. * include/ruby/encoding.h (ENC_CODERANGE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--include/ruby/ruby.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 301a68f9004..ecffd6048b6 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -605,7 +605,7 @@ struct RFloat {
#define ELTS_SHARED FL_USER2
-#define RSTRING_EMBED_LEN_MAX ((sizeof(VALUE)*3)/sizeof(char)-1)
+#define RSTRING_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(char)-1))
struct RString {
struct RBasic basic;
union {
@@ -756,7 +756,7 @@ struct RStruct {
RSTRUCT(st)->as.ary : \
RSTRUCT(st)->as.heap.ptr)
-#define RBIGNUM_EMBED_LEN_MAX ((sizeof(VALUE)*3)/sizeof(BDIGIT))
+#define RBIGNUM_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(BDIGIT)))
struct RBignum {
struct RBasic basic;
union {
@@ -849,13 +849,13 @@ struct RBignum {
#define FL_UNSET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags &= ~(f);} while (0)
#define FL_REVERSE(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags ^= (f);} while (0)
-#define OBJ_TAINTED(x) FL_TEST((x), FL_TAINT)
+#define OBJ_TAINTED(x) (!!FL_TEST((x), FL_TAINT))
#define OBJ_TAINT(x) FL_SET((x), FL_TAINT)
-#define OBJ_UNTRUSTED(x) FL_TEST((x), FL_UNTRUSTED)
+#define OBJ_UNTRUSTED(x) (!!FL_TEST((x), FL_UNTRUSTED))
#define OBJ_UNTRUST(x) FL_SET((x), FL_UNTRUSTED)
#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & (FL_TAINT | FL_UNTRUSTED);} while (0)
-#define OBJ_FROZEN(x) FL_TEST((x), FL_FREEZE)
+#define OBJ_FROZEN(x) (!!FL_TEST((x), FL_FREEZE))
#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
#define ALLOC_N(type,n) (type*)xmalloc2((n),sizeof(type))