summaryrefslogtreecommitdiff
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
commite07cb859cc882adc05f818466b45e75f1d5a1e39 (patch)
treebdb9cf7c15bd7db7fdaa0ddf4ee53e03e58f5780 /eval.c
parent0f6d9dfc96c145e69b94d24d51d98480abd72ae1 (diff)
* suppressed shorten-64-to-32 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/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 6d6b6acd00..94978a9e90 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;
}
}