diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-20 10:13:36 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-20 10:13:36 +0900 |
| commit | 8e91316bd64aa39b3afeffb0ade5eb38b05d3953 (patch) | |
| tree | fabce96f895417c6d2252860211aeb7b4df97a31 /mrbgems/mruby-pack/src | |
| parent | 3820ef791f3ccb766956d12534ae519f4923ac7e (diff) | |
| parent | cb85fa6787ea9467f81be41570a36b475b7ef061 (diff) | |
| download | mruby2-draft.tar.gz mruby2-draft.zip | |
Merge branch 'no-implicit-conversion' into mruby2-draftmruby2-draft
Diffstat (limited to 'mrbgems/mruby-pack/src')
| -rw-r--r-- | mrbgems/mruby-pack/src/pack.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c index f970d9339..0fa8c90bd 100644 --- a/mrbgems/mruby-pack/src/pack.c +++ b/mrbgems/mruby-pack/src/pack.c @@ -1124,14 +1124,16 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary) o = mrb_ary_ref(mrb, ary, aidx); if (type == PACK_TYPE_INTEGER) { o = mrb_to_int(mrb, o); + } #ifndef MRB_WITHOUT_FLOAT - } else if (type == PACK_TYPE_FLOAT) { + else if (type == PACK_TYPE_FLOAT) { if (!mrb_float_p(o)) { mrb_float f = mrb_to_flo(mrb, o); o = mrb_float_value(mrb, f); } + } #endif - } else if (type == PACK_TYPE_STRING) { + else if (type == PACK_TYPE_STRING) { if (!mrb_string_p(o)) { mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into String", mrb_class_path(mrb, mrb_obj_class(mrb, o))); } |
