summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2013-02-15 10:52:37 +0900
committerTomoyuki Sahara <[email protected]>2013-02-15 10:52:37 +0900
commitfc43022c95a871ab7d77546e7f2fff37413bb148 (patch)
tree19ed6119d6114c448a820c3d6c5573e1fe6d2588
parentabe9ccfe4b5116f5eeebd6da36bda221a679b883 (diff)
downloadmruby-fc43022c95a871ab7d77546e7f2fff37413bb148.tar.gz
mruby-fc43022c95a871ab7d77546e7f2fff37413bb148.zip
support "V" and "v".
-rw-r--r--src/pack.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/pack.c b/src/pack.c
index 290f3a3f8..fc2248a1a 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -562,6 +562,11 @@ read_tmpl(mrb_state *mrb, struct tmpl *tmpl, int *dirp, int *typep, int *sizep,
size = 4;
flags |= PACK_FLAG_SIGNED;
break;
+ case 'm':
+ dir = PACK_DIR_BASE64;
+ type = PACK_TYPE_STRING;
+ flags |= PACK_FLAG_WIDTH;
+ break;
case 'N': /* = "L>" */
dir = PACK_DIR_LONG;
type = PACK_TYPE_INTEGER;
@@ -585,10 +590,17 @@ read_tmpl(mrb_state *mrb, struct tmpl *tmpl, int *dirp, int *typep, int *sizep,
size = 2;
flags |= PACK_FLAG_SIGNED;
break;
- case 'm':
- dir = PACK_DIR_BASE64;
- type = PACK_TYPE_STRING;
- flags |= PACK_FLAG_WIDTH;
+ case 'V': /* = "L<" */
+ dir = PACK_DIR_LONG;
+ type = PACK_TYPE_INTEGER;
+ size = 4;
+ flags |= PACK_FLAG_LT;
+ break;
+ case 'v': /* = "S<" */
+ dir = PACK_DIR_SHORT;
+ type = PACK_TYPE_INTEGER;
+ size = 2;
+ flags |= PACK_FLAG_LT;
break;
case 'Z':
dir = PACK_DIR_STR;