summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-30 07:46:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-30 07:46:44 +0000
commitd06f74d736311f128f5303a995cf01071531a6f4 (patch)
treedb64c20e47e7c48407b1ab649cd51b3e232561bb
parent7259c3f2e005cf2e5182796d3589b5032b7b58c4 (diff)
* insns.def, tool/instruction.rb: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--insns.def25
-rw-r--r--tool/instruction.rb2
3 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index ed84290..3cbd318 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jun 30 16:46:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insns.def, tool/instruction.rb: fixed types.
+
Tue Jun 30 11:08:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/oniguruma.h, include/ruby/re.h, re.c, regcomp.c,
diff --git a/insns.def b/insns.def
index e1e77c6..363a8ed 100644
--- a/insns.def
+++ b/insns.def
@@ -113,7 +113,7 @@ getdynamic
()
(VALUE val)
{
- int i;
+ rb_num_t i;
VALUE *dfp2 = GET_DFP();
for (i = 0; i < level; i++) {
dfp2 = GET_PREV_DFP(dfp2);
@@ -134,7 +134,7 @@ setdynamic
(VALUE val)
()
{
- int i;
+ rb_num_t i;
VALUE *dfp2 = GET_DFP();
for (i = 0; i < level; i++) {
dfp2 = GET_PREV_DFP(dfp2);
@@ -387,10 +387,10 @@ concatstrings
(...)
(VALUE val) // inc += 1 - num;
{
- int i;
+ rb_num_t i = num;
val = rb_str_new(0, 0);
- for (i = num - 1; i >= 0; i--) {
+ while (i-- > 0) {
const VALUE v = TOPN(i);
rb_str_append(val, v);
}
@@ -424,13 +424,13 @@ toregexp
(VALUE val) // inc += 1 - cnt;
{
VALUE rb_reg_new_ary(VALUE ary, int options);
- int i;
+ rb_num_t i;
const VALUE ary = rb_ary_tmp_new(cnt);
for (i = 0; i < cnt; i++) {
rb_ary_store(ary, cnt-i-1, TOPN(i));
}
POPN(cnt);
- val = rb_reg_new_ary(ary, opt);
+ val = rb_reg_new_ary(ary, (int)opt);
rb_ary_clear(ary);
}
@@ -481,7 +481,7 @@ expandarray
(..., VALUE ary)
(...) // inc += num - 1 + (flag & 1 ? 1 : 0);
{
- vm_expandarray(GET_CFP(), ary, num, flag);
+ vm_expandarray(GET_CFP(), ary, num, (int)flag);
}
/**
@@ -605,7 +605,7 @@ newrange
(VALUE low, VALUE high)
(VALUE val)
{
- val = rb_range_new(low, high, flag);
+ val = rb_range_new(low, high, (int)flag);
}
/**********************************************************/
@@ -652,7 +652,7 @@ dupn
(...)
(...) // inc += n;
{
- int i;
+ rb_num_t i;
VALUE *sp = STACK_ADDR_FROM_TOP(n);
for (i = 0; i < n; i++) {
GET_SP()[i] = sp[i];
@@ -851,7 +851,7 @@ trace
()
()
{
- rb_event_flag_t flag = nf;
+ rb_event_flag_t flag = (rb_event_flag_t)nf;
EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
}
@@ -982,7 +982,7 @@ send
NODE *mn;
VALUE recv, klass;
rb_block_t *blockptr = 0;
- rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag, op_argc,
+ rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag, (int)op_argc,
(rb_iseq_t *)blockiseq, &blockptr);
rb_num_t flag = op_flag;
ID id = op_id;
@@ -1014,7 +1014,8 @@ invokesuper
(VALUE val) // inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));
{
rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0;
- int num = caller_setup_args(th, GET_CFP(), op_flag, op_argc, blockiseq, &blockptr);
+ rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag,
+ (int)op_argc, blockiseq, &blockptr);
VALUE recv, klass;
NODE *mn;
ID id;
diff --git a/tool/instruction.rb b/tool/instruction.rb
index 7ecc84b..4e60f04 100644
--- a/tool/instruction.rb
+++ b/tool/instruction.rb
@@ -63,7 +63,7 @@ class RubyVM
rets.any?{|t, v| v == '...'})
# user definision
raise "no sp increase definition" if @sp_inc.nil?
- ret = "int inc = 0;\n"
+ ret = "rb_num_t inc = 0;\n"
@opes.each_with_index{|(t, v), i|
if t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc ||