You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by kc...@apache.org on 2009/03/24 17:04:44 UTC

svn commit: r757870 - in /incubator/thrift/trunk: lib/erl/src/thrift_binary_protocol.erl test/ThriftTest.thrift

Author: kclark
Date: Tue Mar 24 16:04:36 2009
New Revision: 757870

URL: http://svn.apache.org/viewvc?rev=757870&view=rev
Log:
THRIFT-192. erl: Fix handling of booleans

Modified:
    incubator/thrift/trunk/lib/erl/src/thrift_binary_protocol.erl
    incubator/thrift/trunk/test/ThriftTest.thrift

Modified: incubator/thrift/trunk/lib/erl/src/thrift_binary_protocol.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/src/thrift_binary_protocol.erl?rev=757870&r1=757869&r2=757870&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/erl/src/thrift_binary_protocol.erl (original)
+++ incubator/thrift/trunk/lib/erl/src/thrift_binary_protocol.erl Tue Mar 24 16:04:36 2009
@@ -231,9 +231,10 @@
 %%
 
 read(This, bool) ->
-    Byte = read(This, byte),
-    {ok, (Byte /= 0)};
-
+    case read(This, byte) of
+        {ok, Byte} -> {ok, Byte /= 0};
+        Else -> Else
+    end;
 
 read(This, byte) ->
     case read(This, 1) of

Modified: incubator/thrift/trunk/test/ThriftTest.thrift
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/ThriftTest.thrift?rev=757870&r1=757869&r2=757870&view=diff
==============================================================================
--- incubator/thrift/trunk/test/ThriftTest.thrift (original)
+++ incubator/thrift/trunk/test/ThriftTest.thrift Tue Mar 24 16:04:36 2009
@@ -22,6 +22,11 @@
   2: i32 type
 }
 
+struct Bools {
+  1: bool im_true,
+  2: bool im_false,
+}
+
 struct Xtruct
 {
   1:  string string_thing,