diff options
| author | Tomoyuki Sahara <[email protected]> | 2013-02-15 10:52:37 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2013-02-15 10:52:37 +0900 |
| commit | fc43022c95a871ab7d77546e7f2fff37413bb148 (patch) | |
| tree | 19ed6119d6114c448a820c3d6c5573e1fe6d2588 /src | |
| parent | abe9ccfe4b5116f5eeebd6da36bda221a679b883 (diff) | |
| download | mruby-fc43022c95a871ab7d77546e7f2fff37413bb148.tar.gz mruby-fc43022c95a871ab7d77546e7f2fff37413bb148.zip | |
support "V" and "v".
Diffstat (limited to 'src')
| -rw-r--r-- | src/pack.c | 20 |
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; |
