summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2013-07-06 09:28:49 +0200
committerJens Geyer <jensg@apache.org>2013-07-06 09:30:30 +0200
commitee353e6c98f8c8712d43d626c483217a45a4089d (patch)
tree07b80ddeb7e1918def75f709038f5700cb60f4bb
parent049f5f3375e442865d790460596caeb5e942fa13 (diff)
downloadthrift-ee353e6c98f8c8712d43d626c483217a45a4089d.tar.gz
THRIFT-1709 Warning "Bitwise-or operator used on a sign-extended operand; consider casting to a smaller unsigned type first" in TBinaryProtocol.cs at ReadInt64()
Patch: Jens Geyer
-rw-r--r--lib/csharp/src/Protocol/TBinaryProtocol.cs18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/csharp/src/Protocol/TBinaryProtocol.cs b/lib/csharp/src/Protocol/TBinaryProtocol.cs
index 27c2c940c..e16b8371a 100644
--- a/lib/csharp/src/Protocol/TBinaryProtocol.cs
+++ b/lib/csharp/src/Protocol/TBinaryProtocol.cs
@@ -341,12 +341,14 @@ namespace Thrift.Protocol
{
ReadAll(i32in, 0, 4);
return (int)(((i32in[0] & 0xff) << 24) | ((i32in[1] & 0xff) << 16) | ((i32in[2] & 0xff) << 8) | ((i32in[3] & 0xff)));
- }
-
- private byte[] i64in = new byte[8];
+ }
+
+#pragma warning disable 675
+
+ private byte[] i64in = new byte[8];
public override long ReadI64()
{
- ReadAll(i64in, 0, 8);
+ ReadAll(i64in, 0, 8);
unchecked {
return (long)(
((long)(i64in[0] & 0xff) << 56) |
@@ -358,9 +360,11 @@ namespace Thrift.Protocol
((long)(i64in[6] & 0xff) << 8) |
((long)(i64in[7] & 0xff)));
}
- }
-
- public override double ReadDouble()
+ }
+
+#pragma warning restore 675
+
+ public override double ReadDouble()
{
#if !SILVERLIGHT
return BitConverter.Int64BitsToDouble(ReadI64());