summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-05 12:06:34 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-05 12:06:34 (GMT)
commit5ec185c86b7f5c4f6087075d38ae1b5ce2f9a67f (patch)
treed7e1dfa77127c3c7a53d7ca88a6e4480622b5cbe /pack.c
parente9382c7332645a790e855a5aa4a43c5c8d9dae91 (diff)
update comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/pack.c b/pack.c
index 6e9d254..70db20f 100644
--- a/pack.c
+++ b/pack.c
@@ -675,62 +675,62 @@ pack_pack(VALUE ary, VALUE fmt)
}
break;
- case 's': /* signed short */
+ case 's': /* s for int16_t, s! for signed short */
integer_size = NATINT_LEN(short, 2);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'S': /* unsigned short */
+ case 'S': /* S for uint16_t, S! for unsigned short */
integer_size = NATINT_LEN(short, 2);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'i': /* signed int */
+ case 'i': /* i and i! for signed int */
integer_size = (int)sizeof(int);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'I': /* unsigned int */
+ case 'I': /* I and I! for unsigned int */
integer_size = (int)sizeof(int);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'l': /* signed long */
+ case 'l': /* l for int32_t, l! for signed long */
integer_size = NATINT_LEN(long, 4);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'L': /* unsigned long */
+ case 'L': /* L for uint32_t, L! for unsigned long */
integer_size = NATINT_LEN(long, 4);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'q': /* signed long long or int64_t */
+ case 'q': /* q for int64_t, q! for signed long long */
integer_size = NATINT_LEN_Q;
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'Q': /* unsigned long long or uint64_t */
+ case 'Q': /* Q for uint64_t, Q! for unsigned long long */
integer_size = NATINT_LEN_Q;
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'n': /* unsigned short (network byte-order) */
+ case 'n': /* 16 bit (2 bytes) integer (network byte-order) */
integer_size = 2;
bigendian_p = 1;
goto pack_integer;
- case 'N': /* unsigned long (network byte-order) */
+ case 'N': /* 32 bit (4 bytes) integer (network byte-order) */
integer_size = 4;
bigendian_p = 1;
goto pack_integer;
- case 'v': /* unsigned short (VAX byte-order) */
+ case 'v': /* 16 bit (2 bytes) integer (VAX byte-order) */
integer_size = 2;
bigendian_p = 0;
goto pack_integer;
- case 'V': /* unsigned long (VAX byte-order) */
+ case 'V': /* 32 bit (4 bytes) integer (VAX byte-order) */
integer_size = 4;
bigendian_p = 0;
goto pack_integer;