You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2013/08/21 23:56:28 UTC
git commit: THRIFT-1351 Compiler does not care about binary strings
Updated Branches:
refs/heads/master b5948eb37 -> d4a0b27ad
THRIFT-1351 Compiler does not care about binary strings
Patch: Wade Simmons & Jens Geyer
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d4a0b27a
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d4a0b27a
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d4a0b27a
Branch: refs/heads/master
Commit: d4a0b27ad0e57f0cd681f3334847492decf35c2e
Parents: b5948eb
Author: Jens Geyer <je...@apache.org>
Authored: Wed Aug 21 23:55:29 2013 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Wed Aug 21 23:55:29 2013 +0200
----------------------------------------------------------------------
compiler/cpp/src/generate/t_js_generator.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/d4a0b27a/compiler/cpp/src/generate/t_js_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc
index e27f5de..9f7fa04 100644
--- a/compiler/cpp/src/generate/t_js_generator.cc
+++ b/compiler/cpp/src/generate/t_js_generator.cc
@@ -1259,7 +1259,7 @@ void t_js_generator::generate_deserialize_field(ofstream &out,
name;
break;
case t_base_type::TYPE_STRING:
- out << "readString()";
+ out << (((t_base_type*)type)->is_binary() ? "readBinary()" : "readString()");
break;
case t_base_type::TYPE_BOOL:
out << "readBool()";
@@ -1498,7 +1498,7 @@ void t_js_generator::generate_serialize_field(ofstream &out,
"compiler error: cannot serialize void field in a struct: " + name;
break;
case t_base_type::TYPE_STRING:
- out << "writeString(" << name << ")";
+ out << (((t_base_type*)type)->is_binary() ? "writeBinary(" : "writeString(") << name << ")";
break;
case t_base_type::TYPE_BOOL:
out << "writeBool(" << name << ")";