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 2016/04/16 23:55:18 UTC

thrift git commit: THRIFT-3559 Fix awkward extra semi-colons with Cocoa container literals Client: Cocoa Patch: Kevin Wooten

Repository: thrift
Updated Branches:
  refs/heads/master 9f7f11e73 -> 4b7abedb0


THRIFT-3559 Fix awkward extra semi-colons with Cocoa container literals
Client: Cocoa
Patch: Kevin Wooten

This closes #797


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

Branch: refs/heads/master
Commit: 4b7abedb0463fb55a15b389fb9f12b77cf5194f8
Parents: 9f7f11e
Author: Kevin Wooten <ke...@wooten.com>
Authored: Sun Jan 17 11:53:17 2016 -0700
Committer: Jens Geyer <je...@apache.org>
Committed: Sat Apr 16 23:54:04 2016 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_cocoa_generator.cc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/4b7abedb/compiler/cpp/src/generate/t_cocoa_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_cocoa_generator.cc b/compiler/cpp/src/generate/t_cocoa_generator.cc
index 4f135f4..4258965 100644
--- a/compiler/cpp/src/generate/t_cocoa_generator.cc
+++ b/compiler/cpp/src/generate/t_cocoa_generator.cc
@@ -2767,7 +2767,7 @@ void t_cocoa_generator::print_const_value(ostream& out,
         mapout << ", ";
       }
     }
-    mapout << "};" << endl;
+    mapout << "}";
     out << mapout.str();
   } else if (type->is_list()) {
     ostringstream listout;
@@ -2784,7 +2784,7 @@ void t_cocoa_generator::print_const_value(ostream& out,
         listout << ", ";
       }
     }
-    listout << "];" << endl;
+    listout << "]";
     out << listout.str();
   } else if (type->is_set()) {
     ostringstream setout;
@@ -2794,14 +2794,14 @@ void t_cocoa_generator::print_const_value(ostream& out,
     vector<t_const_value*>::const_iterator v_iter;
     if (defval)
       setout << type_name(type) << " ";
-    setout << name << " = [[NSSet alloc] initWithArray:@[";
+    setout << name << " = [NSSet setWithArray:@[";
     for (v_iter = val.begin(); v_iter != val.end();) {
       setout << render_const_value(out, etype, *v_iter, true);
       if (++v_iter != val.end()) {
         setout << ", ";
       }
     }
-    setout << "]];" << endl;
+    setout << "]]";
     out << setout.str();
   } else {
     throw "compiler error: no const of type " + type->get_name();
@@ -2849,6 +2849,7 @@ string t_cocoa_generator::render_const_value(ostream& out,
   } else {
     string t = tmp("tmp");
     print_const_value(out, t, type, value, true);
+    out << ";" << endl;
     render << t;
   }