You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by me...@apache.org on 2016/05/25 15:36:58 UTC

thrift git commit: THRIFT-3841 Dart compact protocol incorrectly serializes/deserialized doubles Client: Dart Patch: Brian Shannan

Repository: thrift
Updated Branches:
  refs/heads/master 8e2320339 -> 839b9320a


THRIFT-3841 Dart compact protocol incorrectly serializes/deserialized doubles
Client: Dart
Patch: Brian Shannan <br...@workiva.com>

This closes #3841


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/839b9320
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/839b9320
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/839b9320

Branch: refs/heads/master
Commit: 839b9320a813c53fe1143a5b518d4e1f522d49d2
Parents: 8e23203
Author: Mark Erickson <me...@apache.org>
Authored: Wed May 25 10:19:52 2016 -0500
Committer: Mark Erickson <me...@apache.org>
Committed: Wed May 25 10:19:52 2016 -0500

----------------------------------------------------------------------
 lib/dart/lib/src/protocol/t_compact_protocol.dart | 4 ++--
 lib/dart/lib/thrift.dart                          | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/839b9320/lib/dart/lib/src/protocol/t_compact_protocol.dart
----------------------------------------------------------------------
diff --git a/lib/dart/lib/src/protocol/t_compact_protocol.dart b/lib/dart/lib/src/protocol/t_compact_protocol.dart
index c5dc515..72d7641 100644
--- a/lib/dart/lib/src/protocol/t_compact_protocol.dart
+++ b/lib/dart/lib/src/protocol/t_compact_protocol.dart
@@ -187,7 +187,7 @@ class TCompactProtocol extends TProtocol {
 
   void writeDouble(double d) {
     if (d == null) d = 0.0;
-    tempBD.setFloat64(0, d);
+    tempBD.setFloat64(0, d, Endianness.LITTLE_ENDIAN);
     transport.write(tempBD.buffer.asUint8List(), 0, 8);
   }
 
@@ -364,7 +364,7 @@ class TCompactProtocol extends TProtocol {
 
   double readDouble() {
     transport.readAll(tempList, 0, 8);
-    return tempList.buffer.asByteData().getFloat64(0);
+    return tempList.buffer.asByteData().getFloat64(0, Endianness.LITTLE_ENDIAN);
   }
 
   String readString() {

http://git-wip-us.apache.org/repos/asf/thrift/blob/839b9320/lib/dart/lib/thrift.dart
----------------------------------------------------------------------
diff --git a/lib/dart/lib/thrift.dart b/lib/dart/lib/thrift.dart
index 27eb546..ca23fb3 100644
--- a/lib/dart/lib/thrift.dart
+++ b/lib/dart/lib/thrift.dart
@@ -21,6 +21,7 @@ import 'dart:async';
 import 'dart:collection';
 import 'dart:convert' show Utf8Codec;
 import 'dart:typed_data' show ByteData;
+import 'dart:typed_data' show Endianness;
 import 'dart:typed_data' show Uint8List;
 
 import 'package:crypto/crypto.dart' show CryptoUtils;