From ee353e6c98f8c8712d43d626c483217a45a4089d Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Sat, 6 Jul 2013 09:28:49 +0200 Subject: [PATCH] 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 --- lib/csharp/src/Protocol/TBinaryProtocol.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/csharp/src/Protocol/TBinaryProtocol.cs b/lib/csharp/src/Protocol/TBinaryProtocol.cs index 27c2c940..e16b8371 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()); -- 2.17.1