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
diff --git a/lib/csharp/src/Protocol/TBinaryProtocol.cs b/lib/csharp/src/Protocol/TBinaryProtocol.cs
index 27c2c94..e16b837 100644
--- a/lib/csharp/src/Protocol/TBinaryProtocol.cs
+++ b/lib/csharp/src/Protocol/TBinaryProtocol.cs
@@ -341,12 +341,14 @@
{
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 @@
((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());