summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorfrsyuki <frsyuki@5a5092ae-2292-43ba-b2d5-dcab9c1a2731>2009-02-15 09:09:58 +0000
committerfrsyuki <frsyuki@5a5092ae-2292-43ba-b2d5-dcab9c1a2731>2009-02-15 09:09:58 +0000
commit31659738110f7d73d8fd4fe2d6fc62991ac7912f (patch)
tree3296e710cb71a4414fa04e406878a943aa37c292 /ruby
parenta7936ba05b15ec7a19e8dc75667fec2df13b7ea7 (diff)
downloadmsgpack-python-31659738110f7d73d8fd4fe2d6fc62991ac7912f.tar.gz
lang/c/msgpack: fix compile optimization flag
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@70 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
Diffstat (limited to 'ruby')
-rw-r--r--ruby/extconf.rb2
-rw-r--r--ruby/test_pack.rb2
-rw-r--r--ruby/unpack.c10
3 files changed, 8 insertions, 6 deletions
diff --git a/ruby/extconf.rb b/ruby/extconf.rb
index 88abb55..e6d4bd6 100644
--- a/ruby/extconf.rb
+++ b/ruby/extconf.rb
@@ -1,4 +1,4 @@
require 'mkmf'
-$CFLAGS << " -I.. -Wall -O9"
+$CFLAGS << " -I.. -Wall -O4"
create_makefile('msgpack')
diff --git a/ruby/test_pack.rb b/ruby/test_pack.rb
index 16a8ccf..6873d57 100644
--- a/ruby/test_pack.rb
+++ b/ruby/test_pack.rb
@@ -21,6 +21,8 @@ check 256
check 65535
check 65536
check -1
+check -32
+check -33
check -128
check -129
check -32768
diff --git a/ruby/unpack.c b/ruby/unpack.c
index b948aa6..8ab425c 100644
--- a/ruby/unpack.c
+++ b/ruby/unpack.c
@@ -176,13 +176,13 @@ static VALUE MessagePack_Unpacker_execute_impl(VALUE args)
int ret;
if(from >= dlen) {
- rb_raise(eUnpackError, "Requested start is after data buffer end.");
+ rb_raise(eUnpackError, "offset is bigger than data buffer size.");
}
ret = msgpack_unpacker_execute(mp, dptr, (size_t)dlen, &from);
if(ret < 0) {
- rb_raise(eUnpackError, "Parse error.");
+ rb_raise(eUnpackError, "parse error.");
} else if(ret > 0) {
mp->user.finished = 1;
return ULONG2NUM(from);
@@ -242,12 +242,12 @@ static VALUE MessagePack_unpack_impl(VALUE args)
ret = msgpack_unpacker_execute(mp, dptr, (size_t)dlen, &from);
if(ret < 0) {
- rb_raise(eUnpackError, "Parse error.");
+ rb_raise(eUnpackError, "parse error.");
} else if(ret == 0) {
- rb_raise(eUnpackError, "Insufficient bytes.");
+ rb_raise(eUnpackError, "insufficient bytes.");
} else {
if(from < dlen) {
- rb_raise(eUnpackError, "Extra bytes.");
+ rb_raise(eUnpackError, "extra bytes.");
}
return msgpack_unpacker_data(mp);
}