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/06/15 03:05:35 UTC
git commit: THRIFT-2030 Thrift allows for inconsistent use of "oneway"
Updated Branches:
refs/heads/master b310ae781 -> 70a576273
THRIFT-2030 Thrift allows for inconsistent use of "oneway"
Patch: Jens Geyer
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/70a57627
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/70a57627
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/70a57627
Branch: refs/heads/master
Commit: 70a5762736eaa3511ca5e4f02461bf1ca22453a4
Parents: b310ae7
Author: Jens Geyer <je...@apache.org>
Authored: Fri Jun 14 18:48:15 2013 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Sat Jun 15 03:05:03 2013 +0200
----------------------------------------------------------------------
compiler/cpp/src/parse/t_function.h | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/70a57627/compiler/cpp/src/parse/t_function.h
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/parse/t_function.h b/compiler/cpp/src/parse/t_function.h
index 0da2fd6..ae8c2f6 100644
--- a/compiler/cpp/src/parse/t_function.h
+++ b/compiler/cpp/src/parse/t_function.h
@@ -42,6 +42,9 @@ class t_function : public t_doc {
arglist_(arglist),
oneway_(oneway) {
xceptions_ = new t_struct(NULL);
+ if (oneway_ && (! returntype_->is_void())) {
+ pwarning(1, "Oneway methods should return void.\n");
+ }
}
t_function(t_type* returntype,
@@ -58,6 +61,9 @@ class t_function : public t_doc {
if (oneway_ && !xceptions_->get_members().empty()) {
throw std::string("Oneway methods can't throw exceptions.");
}
+ if (oneway_ && (! returntype_->is_void())) {
+ pwarning(1, "Oneway methods should return void.\n");
+ }
}
~t_function() {}