diff options
| author | Tomoyuki Sahara <[email protected]> | 2015-05-22 09:41:39 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2015-05-22 09:41:39 +0900 |
| commit | 15de80a7cdf3a21ebedc5c39b8ec3478098279b9 (patch) | |
| tree | d22479ba688c6a66c5c8cead18e3bcd55d203fc1 | |
| parent | 121475638d3d043a7666163a5e49544a88aea89a (diff) | |
| download | mruby-15de80a7cdf3a21ebedc5c39b8ec3478098279b9.tar.gz mruby-15de80a7cdf3a21ebedc5c39b8ec3478098279b9.zip | |
style.
| -rw-r--r-- | src/pack.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pack.c b/src/pack.c index fa8b5ef66..6dfcab29e 100644 --- a/src/pack.c +++ b/src/pack.c @@ -13,8 +13,8 @@ #include <ctype.h> #include <errno.h> #include <limits.h> -#include <string.h> #include <stdio.h> +#include <string.h> struct tmpl { mrb_value str; @@ -51,7 +51,7 @@ enum { #define PACK_FLAG_SIGNED 0x00000008 /* native size ("_" "!") */ #define PACK_FLAG_GT 0x00000010 /* big endian (">") */ #define PACK_FLAG_LT 0x00000020 /* little endian ("<") */ -#define PACK_FLAG_WIDTH 0x00000040 /* */ +#define PACK_FLAG_WIDTH 0x00000040 /* "count" is "width" */ #define PACK_FLAG_LSB 0x00000080 /* LSB / low nibble first */ #define PACK_FLAG_COUNT2 0x00000100 /* "count" is special... */ #define PACK_FLAG_LITTLEENDIAN 0x00000200 /* little endian actually */ @@ -868,17 +868,17 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary) if (type == PACK_TYPE_INTEGER) { if (mrb_float_p(o)) { o = mrb_funcall(mrb, o, "to_i", 0); - } else if (!mrb_fixnum_p(o)) { - mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into Integer", mrb_class_path(mrb, mrb_obj_class(mrb, o))); - } + } else if (!mrb_fixnum_p(o)) { + mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into Integer", mrb_class_path(mrb, mrb_obj_class(mrb, o))); + } } else if (type == PACK_TYPE_FLOAT) { if (!mrb_float_p(o)) { o = mrb_funcall(mrb, o, "to_f", 0); } } 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))); - } + mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into String", mrb_class_path(mrb, mrb_obj_class(mrb, o))); + } } switch (dir) { |
