summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-31 13:11:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-31 13:11:02 +0000
commitf6003894b91987f309cfd0164561db86d5eaa82c (patch)
treea607e11c70085ad8b6301a0f3a1084db9c42e8d6
parentfa98c5752d1f6624a7cdf272606a06fb109ea4a9 (diff)
* compile.c (new_child_iseq): adjust argument types.
* iseq.c (prepare_iseq_build, rb_iseq_new), (rb_iseq_new_with_bopt_and_opt, rb_iseq_new_with_opt), (rb_iseq_new_with_bopt): ditto. * compile.c (iseq_set_exception_table): suppress warnings. * insns.def (putspecialobject, defined): ditto. * iseq.c (iseq_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog14
-rw-r--r--compile.c4
-rw-r--r--insns.def4
-rw-r--r--iseq.c12
-rw-r--r--vm_core.h6
5 files changed, 27 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2393964a2d..3c1b9d7461 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Sun Oct 31 22:10:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (new_child_iseq): adjust argument types.
+
+ * iseq.c (prepare_iseq_build, rb_iseq_new),
+ (rb_iseq_new_with_bopt_and_opt, rb_iseq_new_with_opt),
+ (rb_iseq_new_with_bopt): ditto.
+
+ * compile.c (iseq_set_exception_table): suppress warnings.
+
+ * insns.def (putspecialobject, defined): ditto.
+
+ * iseq.c (iseq_load): ditto.
+
Sun Oct 31 09:30:51 2010 Koichi Sasada <ko1@atdot.net>
* vm_core.h: some refactoring.
diff --git a/compile.c b/compile.c
index c852b2c234..971020d535 100644
--- a/compile.c
+++ b/compile.c
@@ -910,7 +910,7 @@ new_insn_send(rb_iseq_t *iseq, int line_no,
static VALUE
new_child_iseq(rb_iseq_t *iseq, NODE *node,
- VALUE name, VALUE parent, VALUE type, int line_no)
+ VALUE name, VALUE parent, enum iseq_type type, int line_no)
{
VALUE ret;
@@ -1559,7 +1559,7 @@ iseq_set_exception_table(rb_iseq_t *iseq)
for (i = 0; i < tlen; i++) {
ptr = RARRAY_PTR(tptr[i]);
entry = &iseq->catch_table[i];
- entry->type = ptr[0] & 0xffff;
+ entry->type = (enum catch_type)(ptr[0] & 0xffff);
entry->start = label_get_position((LABEL *)(ptr[1] & ~1));
entry->end = label_get_position((LABEL *)(ptr[2] & ~1));
entry->iseq = ptr[3];
diff --git a/insns.def b/insns.def
index ea20320e75..e45609b880 100644
--- a/insns.def
+++ b/insns.def
@@ -336,7 +336,7 @@ putspecialobject
()
(VALUE val)
{
- enum vm_special_object_type type = value_type;
+ enum vm_special_object_type type = (enum vm_special_object_type)value_type;
switch (type) {
case VM_SPECIAL_OBJECT_VMCORE:
@@ -754,7 +754,7 @@ defined
{
VALUE klass;
const char *expr_type = 0;
- enum defined_type type = op_type;
+ enum defined_type type = (enum defined_type)op_type;
val = Qnil;
diff --git a/iseq.c b/iseq.c
index fedc00e1ab..2b82aa89b2 100644
--- a/iseq.c
+++ b/iseq.c
@@ -225,7 +225,7 @@ VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
static VALUE
prepare_iseq_build(rb_iseq_t *iseq,
VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
- VALUE parent, VALUE type, VALUE block_opt,
+ VALUE parent, enum iseq_type type, VALUE block_opt,
const rb_compile_option_t *option)
{
OBJ_FREEZE(name);
@@ -378,7 +378,7 @@ make_compile_option_value(rb_compile_option_t *option)
VALUE
rb_iseq_new(NODE *node, VALUE name, VALUE filename, VALUE filepath,
- VALUE parent, VALUE type)
+ VALUE parent, enum iseq_type type)
{
return rb_iseq_new_with_opt(node, name, filename, filepath, INT2FIX(0), parent, type,
&COMPILE_OPTION_DEFAULT);
@@ -402,7 +402,7 @@ rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath)
static VALUE
rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
- VALUE parent, VALUE type, VALUE bopt,
+ VALUE parent, enum iseq_type type, VALUE bopt,
const rb_compile_option_t *option)
{
rb_iseq_t *iseq;
@@ -419,7 +419,7 @@ rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename, VALUE file
VALUE
rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
- VALUE parent, VALUE type,
+ VALUE parent, enum iseq_type type,
const rb_compile_option_t *option)
{
/* TODO: argument check */
@@ -429,7 +429,7 @@ rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VAL
VALUE
rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
- VALUE parent, VALUE type, VALUE bopt)
+ VALUE parent, enum iseq_type type, VALUE bopt)
{
/* TODO: argument check */
return rb_iseq_new_with_bopt_and_opt(node, name, filename, filepath, line_no, parent, type,
@@ -515,7 +515,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
make_compile_option(&option, opt);
prepare_iseq_build(iseq, name, filename, filepath, line_no,
- parent, (VALUE)iseq_type, 0, &option);
+ parent, (enum iseq_type)iseq_type, 0, &option);
rb_iseq_build_from_ary(iseq, locals, args, exception, body);
diff --git a/vm_core.h b/vm_core.h
index 651f905404..f0e72ef3e7 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -486,11 +486,11 @@ typedef struct rb_thread_struct {
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
-VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE);
+VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE, enum iseq_type);
VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE parent);
VALUE rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath);
-VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
-VALUE rb_iseq_new_with_opt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, const rb_compile_option_t*);
+VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, VALUE);
+VALUE rb_iseq_new_with_opt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, const rb_compile_option_t*);
VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line);
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
VALUE rb_iseq_disasm(VALUE self);