summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-18 08:05:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-18 08:05:32 +0000
commitc3c29381b8c90a4cc27e08f1e8a337a95037c90f (patch)
treebdb9cf7c15bd7db7fdaa0ddf4ee53e03e58f5780 /eval.c
parent932b5cf7115dcd87435f2c2ab2f054e94b9ef367 (diff)
downloadruby-c3c29381b8c90a4cc27e08f1e8a337a95037c90f.tar.gz
ruby-c3c29381b8c90a4cc27e08f1e8a337a95037c90f.tar.xz
ruby-c3c29381b8c90a4cc27e08f1e8a337a95037c90f.zip
* suppressed shorten-64-to-32 warnings.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 6d6b6acd0..94978a9e9 100644
--- a/eval.c
+++ b/eval.c
@@ -15,6 +15,8 @@
#include "iseq.h"
#include "gc.h"
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
+
VALUE proc_invoke(VALUE, VALUE, VALUE, VALUE);
VALUE rb_binding_new(void);
NORETURN(void rb_raise_jump(VALUE));
@@ -157,7 +159,7 @@ ruby_cleanup(volatile int ex)
POP_TAG();
rb_thread_stop_timer_thread();
- for (nerr = 0; nerr < sizeof(errs) / sizeof(errs[0]); ++nerr) {
+ for (nerr = 0; nerr < numberof(errs); ++nerr) {
VALUE err = errs[nerr];
if (!RTEST(err)) continue;
@@ -534,10 +536,10 @@ rb_block_given_p(void)
if ((th->cfp->lfp[0] & 0x02) == 0 &&
GC_GUARDED_PTR_REF(th->cfp->lfp[0])) {
- return Qtrue;
+ return TRUE;
}
else {
- return Qfalse;
+ return FALSE;
}
}
@@ -577,13 +579,13 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
th->cfp = cfp; /* restore */
if (state == TAG_RAISE) {
- int handle = Qfalse;
+ int handle = FALSE;
VALUE eclass;
va_init_list(args, data2);
while ((eclass = va_arg(args, VALUE)) != 0) {
if (rb_obj_is_kind_of(th->errinfo, eclass)) {
- handle = Qtrue;
+ handle = TRUE;
break;
}
}