some 'some make style' suggestions applied to C++ files
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/7f4be5f1 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/7f4be5f1 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/7f4be5f1 Branch: refs/heads/master Commit: 7f4be5f188409cfe80059f501cc59ad40c6b969d Parents: 673c941 Author: Konrad Grochowski <[email protected]> Authored: Thu Nov 5 20:23:11 2015 +0100 Committer: Konrad Grochowski <[email protected]> Committed: Thu Nov 5 20:23:11 2015 +0100 ---------------------------------------------------------------------- compiler/cpp/src/audit/t_audit.h | 9 ++- compiler/cpp/src/generate/t_cpp_generator.cc | 71 +++++++++----------- compiler/cpp/src/main.cc | 35 +++++----- compiler/cpp/src/main.h | 2 +- .../thrift/async/TConcurrentClientSyncInfo.h | 71 ++++++++++---------- .../src/thrift/concurrency/ThreadManager.cpp | 4 +- lib/cpp/src/thrift/protocol/TBinaryProtocol.h | 22 +++--- lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc | 30 +++++---- lib/cpp/src/thrift/protocol/TProtocolTypes.h | 10 +-- .../src/thrift/server/TNonblockingServer.cpp | 5 +- lib/cpp/src/thrift/transport/THeaderTransport.h | 2 +- lib/cpp/src/thrift/transport/TPipe.h | 4 +- lib/cpp/src/thrift/windows/config.h | 2 +- 13 files changed, 131 insertions(+), 136 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/compiler/cpp/src/audit/t_audit.h ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/audit/t_audit.h b/compiler/cpp/src/audit/t_audit.h index fd0013a..be79e31 100644 --- a/compiler/cpp/src/audit/t_audit.h +++ b/compiler/cpp/src/audit/t_audit.h @@ -2,10 +2,13 @@ #define T_AUDIT_H void compare_namespace(t_program* newProgram, t_program* oldProgram); -void compare_enums(const std::vector<t_enum*>& newEnumList, const std::vector<t_enum*>& oldEnumList); +void compare_enums(const std::vector<t_enum*>& newEnumList, + const std::vector<t_enum*>& oldEnumList); bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault); -void compare_structs(const std::vector<t_struct*>& newStructList, const std::vector<t_struct*>& oldStructList); -void compare_services(const std::vector<t_service*>& newServices, const std::vector<t_service*>& oldServices); +void compare_structs(const std::vector<t_struct*>& newStructList, + const std::vector<t_struct*>& oldStructList); +void compare_services(const std::vector<t_service*>& newServices, + const std::vector<t_service*>& oldServices); void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst); #endif http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/compiler/cpp/src/generate/t_cpp_generator.cc ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc index 91c5b29..8770ade 100644 --- a/compiler/cpp/src/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/generate/t_cpp_generator.cc @@ -1625,11 +1625,10 @@ void t_cpp_generator::generate_service(t_service* tservice) { f_header_ << endl << ns_open_ << endl << endl; - f_header_ << - "#ifdef _WIN32\n" - " #pragma warning( push )\n" - " #pragma warning (disable : 4250 ) //inheriting methods via dominance \n" - "#endif\n\n"; + f_header_ << "#ifdef _WIN32\n" + " #pragma warning( push )\n" + " #pragma warning (disable : 4250 ) //inheriting methods via dominance \n" + "#endif\n\n"; // Service implementation file includes string f_service_name = get_out_dir() + svcname + ".cpp"; @@ -1682,10 +1681,9 @@ void t_cpp_generator::generate_service(t_service* tservice) { generate_service_async_skeleton(tservice); } - f_header_ << - "#ifdef _WIN32\n" - " #pragma warning( pop )\n" - "#endif\n\n"; + f_header_ << "#ifdef _WIN32\n" + " #pragma warning( pop )\n" + "#endif\n\n"; // Close the namespace f_service_ << ns_close_ << endl << endl; @@ -2151,12 +2149,10 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) } // Generate the header portion - if(style == "Concurrent") - { - f_header_ << - "// The \'concurrent\' client is a thread safe client that correctly handles\n" - "// out of order responses. It is slower than the regular client, so should\n" - "// only be used when you need to share a connection among multiple threads\n"; + if (style == "Concurrent") { + f_header_ << "// The \'concurrent\' client is a thread safe client that correctly handles\n" + "// out of order responses. It is slower than the regular client, so should\n" + "// only be used when you need to share a connection among multiple threads\n"; } f_header_ << template_header << "class " << service_name_ << style << "Client" << short_suffix << " : " @@ -2270,36 +2266,34 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) { indent(f_header_) << function_signature(*f_iter, ifstyle) << ";" << endl; // TODO(dreiss): Use private inheritance to avoid generating thise in cob-style. - if(style == "Concurrent" && !(*f_iter)->is_oneway()) { + if (style == "Concurrent" && !(*f_iter)->is_oneway()) { // concurrent clients need to move the seqid from the send function to the // recv function. Oneway methods don't have a recv function, so we don't need to // move the seqid for them. Attempting to do so would result in a seqid leak. t_function send_function(g_type_i32, /*returning seqid*/ - string("send_") + (*f_iter)->get_name(), - (*f_iter)->get_arglist()); + string("send_") + (*f_iter)->get_name(), + (*f_iter)->get_arglist()); indent(f_header_) << function_signature(&send_function, "") << ";" << endl; - } - else { + } else { t_function send_function(g_type_void, - string("send_") + (*f_iter)->get_name(), - (*f_iter)->get_arglist()); + string("send_") + (*f_iter)->get_name(), + (*f_iter)->get_arglist()); indent(f_header_) << function_signature(&send_function, "") << ";" << endl; } if (!(*f_iter)->is_oneway()) { - if(style == "Concurrent") { + if (style == "Concurrent") { t_field seqIdArg(g_type_i32, "seqid"); t_struct seqIdArgStruct(program_); seqIdArgStruct.append(&seqIdArg); t_function recv_function((*f_iter)->get_returntype(), - string("recv_") + (*f_iter)->get_name(), - &seqIdArgStruct); + string("recv_") + (*f_iter)->get_name(), + &seqIdArgStruct); indent(f_header_) << function_signature(&recv_function, "") << ";" << endl; - } - else { + } else { t_struct noargs(program_); t_function recv_function((*f_iter)->get_returntype(), - string("recv_") + (*f_iter)->get_name(), - &noargs); + string("recv_") + (*f_iter)->get_name(), + &noargs); indent(f_header_) << function_signature(&recv_function, "") << ";" << endl; } } @@ -2410,7 +2404,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) // if (style != "Cob") // TODO(dreiss): Libify the client and don't generate this for cob-style if (true) { - t_type *send_func_return_type = g_type_void; + t_type* send_func_return_type = g_type_void; if (style == "Concurrent" && !(*f_iter)->is_oneway()) { send_func_return_type = g_type_i32; } @@ -2431,7 +2425,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) string resultname = tservice->get_name() + "_" + (*f_iter)->get_name() + "_presult"; string cseqidVal = "0"; - if(style == "Concurrent") { + if (style == "Concurrent") { if (!(*f_iter)->is_oneway()) { cseqidVal = "this->sync_.generateSeqId()"; } @@ -2461,13 +2455,10 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) << "oprot_->getTransport()->flush();" << endl; if (style == "Concurrent") { - out << - endl << - indent() << "sentry.commit();" << endl; + out << endl << indent() << "sentry.commit();" << endl; - if(!(*f_iter)->is_oneway()) { - out << - indent() << "return cseqid;" << endl; + if (!(*f_iter)->is_oneway()) { + out << indent() << "return cseqid;" << endl; } } scope_down(out); @@ -2481,8 +2472,8 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) t_struct seqIdArgStruct(program_); seqIdArgStruct.append(&seqIdArg); - t_struct *recv_function_args = &noargs; - if(style == "Concurrent") { + t_struct* recv_function_args = &noargs; + if (style == "Concurrent") { recv_function_args = &seqIdArgStruct; } @@ -2653,7 +2644,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice, string style) "TApplicationException::MISSING_RESULT, \"" << (*f_iter)->get_name() << " failed: unknown result\");" << endl; } - if(style == "Concurrent") { + if (style == "Concurrent") { indent_down(); indent_down(); out << http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/compiler/cpp/src/main.cc ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc index 6e5258b..0674594 100644 --- a/compiler/cpp/src/main.cc +++ b/compiler/cpp/src/main.cc @@ -642,20 +642,20 @@ void check_for_list_of_bytes(t_type* list_elem_type) { } } - static bool g_byte_warning_emitted = false; /** * Emits a one-time warning on byte type, promoting the new i8 type instead */ void emit_byte_type_warning() { - if( ! g_byte_warning_emitted) { - pwarning(1, "The \"byte\" type is a compatibility alias for \"i8\". Use \"i8\" to emphasize the signedness of this type.\n"); - g_byte_warning_emitted = true; - } + if (!g_byte_warning_emitted) { + pwarning(1, + "The \"byte\" type is a compatibility alias for \"i8\". Use \"i8\" to emphasize the " + "signedness of this type.\n"); + g_byte_warning_emitted = true; + } } - /** * Prints the version number */ @@ -1025,17 +1025,19 @@ void generate(t_program* program, const vector<string>& generator_strings) { } } -void audit(t_program* new_program, t_program* old_program, string new_thrift_include_path, string old_thrift_include_path) -{ +void audit(t_program* new_program, + t_program* old_program, + string new_thrift_include_path, + string old_thrift_include_path) { vector<string> temp_incl_searchpath = g_incl_searchpath; - if(!old_thrift_include_path.empty()) { + if (!old_thrift_include_path.empty()) { g_incl_searchpath.push_back(old_thrift_include_path); } parse(old_program, NULL); g_incl_searchpath = temp_incl_searchpath; - if(!new_thrift_include_path.empty()) { + if (!new_thrift_include_path.empty()) { g_incl_searchpath.push_back(new_thrift_include_path); } @@ -1154,7 +1156,7 @@ int main(int argc, char** argv) { failure("Could not open input file with realpath: %s", arg); } old_input_file = string(old_thrift_file_rp); - } else if(strcmp(arg, "-audit-nofatal") == 0){ + } else if (strcmp(arg, "-audit-nofatal") == 0) { g_audit_fatal = false; } else if (strcmp(arg, "-Iold") == 0) { arg = argv[++i]; @@ -1165,9 +1167,9 @@ int main(int argc, char** argv) { old_thrift_include_path = string(arg); } else if (strcmp(arg, "-Inew") == 0) { arg = argv[++i]; - if(arg == NULL) { - fprintf(stderr, "Missing Include directory for new thrift file\n"); - usage(); + if (arg == NULL) { + fprintf(stderr, "Missing Include directory for new thrift file\n"); + usage(); } new_thrift_include_path = string(arg); } else { @@ -1205,8 +1207,7 @@ int main(int argc, char** argv) { g_type_i64 = new t_base_type("i64", t_base_type::TYPE_I64); g_type_double = new t_base_type("double", t_base_type::TYPE_DOUBLE); - if(g_audit) - { + if (g_audit) { // Audit operation if (old_input_file.empty()) { @@ -1231,7 +1232,7 @@ int main(int argc, char** argv) { } else { // Generate options - + // You gotta generate something! if (generator_strings.empty()) { fprintf(stderr, "No output language(s) specified\n"); http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/compiler/cpp/src/main.h ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/main.h b/compiler/cpp/src/main.h index 4933432..8751dd5 100644 --- a/compiler/cpp/src/main.h +++ b/compiler/cpp/src/main.h @@ -100,7 +100,7 @@ void check_for_list_of_bytes(t_type* list_elem_type); * Emits a one-time warning on byte type, promoting the new i8 type instead */ void emit_byte_type_warning(); - + /** * Flex utilities */ http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h b/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h index 8997a23..7afcbc2 100644 --- a/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h +++ b/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h @@ -27,76 +27,75 @@ #include <string> #include <map> -namespace apache { namespace thrift { namespace async { +namespace apache { +namespace thrift { +namespace async { class TConcurrentClientSyncInfo; -class TConcurrentSendSentry -{ +class TConcurrentSendSentry { public: - explicit TConcurrentSendSentry(TConcurrentClientSyncInfo *sync); + explicit TConcurrentSendSentry(TConcurrentClientSyncInfo* sync); ~TConcurrentSendSentry(); void commit(); + private: - TConcurrentClientSyncInfo &sync_; + TConcurrentClientSyncInfo& sync_; bool committed_; }; -class TConcurrentRecvSentry -{ +class TConcurrentRecvSentry { public: - TConcurrentRecvSentry(TConcurrentClientSyncInfo *sync, int32_t seqid); + TConcurrentRecvSentry(TConcurrentClientSyncInfo* sync, int32_t seqid); ~TConcurrentRecvSentry(); void commit(); + private: - TConcurrentClientSyncInfo &sync_; + TConcurrentClientSyncInfo& sync_; int32_t seqid_; bool committed_; }; -class TConcurrentClientSyncInfo -{ -private: //typedefs +class TConcurrentClientSyncInfo { +private: // typedefs typedef boost::shared_ptr< ::apache::thrift::concurrency::Monitor> MonitorPtr; typedef std::map<int32_t, MonitorPtr> MonitorMap; + public: TConcurrentClientSyncInfo(); int32_t generateSeqId(); - bool getPending( - std::string &fname, - ::apache::thrift::protocol::TMessageType &mtype, - int32_t &rseqid); /* requires readMutex_ */ + bool getPending(std::string& fname, + ::apache::thrift::protocol::TMessageType& mtype, + int32_t& rseqid); /* requires readMutex_ */ - void updatePending( - const std::string &fname, - ::apache::thrift::protocol::TMessageType mtype, - int32_t rseqid); /* requires readMutex_ */ + void updatePending(const std::string& fname, + ::apache::thrift::protocol::TMessageType mtype, + int32_t rseqid); /* requires readMutex_ */ void waitForWork(int32_t seqid); /* requires readMutex_ */ - ::apache::thrift::concurrency::Mutex &getReadMutex() {return readMutex_;} - ::apache::thrift::concurrency::Mutex &getWriteMutex() {return writeMutex_;} + ::apache::thrift::concurrency::Mutex& getReadMutex() { return readMutex_; } + ::apache::thrift::concurrency::Mutex& getWriteMutex() { return writeMutex_; } -private: //constants - enum {MONITOR_CACHE_SIZE = 10}; -private: //functions +private: // constants + enum { MONITOR_CACHE_SIZE = 10 }; + +private: // functions MonitorPtr newMonitor_( - const ::apache::thrift::concurrency::Guard &seqidGuard); /* requires seqidMutex_ */ - void deleteMonitor_( - const ::apache::thrift::concurrency::Guard &seqidGuard, - MonitorPtr &m); /*noexcept*/ /* requires seqidMutex_ */ + const ::apache::thrift::concurrency::Guard& seqidGuard); /* requires seqidMutex_ */ + void deleteMonitor_(const ::apache::thrift::concurrency::Guard& seqidGuard, MonitorPtr& m); + /*noexcept*/ /* requires seqidMutex_ */ void wakeupAnyone_( - const ::apache::thrift::concurrency::Guard &seqidGuard); /* requires seqidMutex_ */ - void markBad_( - const ::apache::thrift::concurrency::Guard &seqidGuard); /* requires seqidMutex_ */ + const ::apache::thrift::concurrency::Guard& seqidGuard); /* requires seqidMutex_ */ + void markBad_(const ::apache::thrift::concurrency::Guard& seqidGuard); /* requires seqidMutex_ */ void throwBadSeqId_(); void throwDeadConnection_(); -private: //data members +private: // data members volatile bool stop_; ::apache::thrift::concurrency::Mutex seqidMutex_; @@ -117,11 +116,11 @@ private: //data members ::apache::thrift::protocol::TMessageType mtypePending_; // end readMutex_ protected members - friend class TConcurrentSendSentry; friend class TConcurrentRecvSentry; }; - -}}} // apache::thrift::async +} +} +} // apache::thrift::async #endif // _THRIFT_TCONCURRENTCLIENTSYNCINFO_H_ http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/concurrency/ThreadManager.cpp ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/concurrency/ThreadManager.cpp b/lib/cpp/src/thrift/concurrency/ThreadManager.cpp index a2b44d4..71b8fec 100644 --- a/lib/cpp/src/thrift/concurrency/ThreadManager.cpp +++ b/lib/cpp/src/thrift/concurrency/ThreadManager.cpp @@ -276,8 +276,8 @@ public: /* If we have a pending task max and we just dropped below it, wakeup any thread that might be blocked on add. */ if (manager_->pendingTaskCountMax_ != 0 - && manager_->tasks_.size() <= manager_->pendingTaskCountMax_ - 1) { - manager_->maxMonitor_.notify(); + && manager_->tasks_.size() <= manager_->pendingTaskCountMax_ - 1) { + manager_->maxMonitor_.notify(); } } else { idle_ = true; http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/protocol/TBinaryProtocol.h ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/protocol/TBinaryProtocol.h b/lib/cpp/src/thrift/protocol/TBinaryProtocol.h index 92491b0..87c53f7 100644 --- a/lib/cpp/src/thrift/protocol/TBinaryProtocol.h +++ b/lib/cpp/src/thrift/protocol/TBinaryProtocol.h @@ -216,19 +216,17 @@ public: boost::shared_ptr<Transport_> specific_trans = boost::dynamic_pointer_cast<Transport_>(trans); TProtocol* prot; if (specific_trans) { - prot = new TBinaryProtocolT<Transport_, ByteOrder_>( - specific_trans, - string_limit_, - container_limit_, - strict_read_, - strict_write_); + prot = new TBinaryProtocolT<Transport_, ByteOrder_>(specific_trans, + string_limit_, + container_limit_, + strict_read_, + strict_write_); } else { - prot = new TBinaryProtocolT<TTransport, ByteOrder_>( - trans, - string_limit_, - container_limit_, - strict_read_, - strict_write_); + prot = new TBinaryProtocolT<TTransport, ByteOrder_>(trans, + string_limit_, + container_limit_, + strict_read_, + strict_write_); } return boost::shared_ptr<TProtocol>(prot); http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc index ae350df..d6f6dbb 100644 --- a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc @@ -30,8 +30,8 @@ namespace protocol { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMessageBegin(const std::string& name, - const TMessageType messageType, - const int32_t seqid) { + const TMessageType messageType, + const int32_t seqid) { if (this->strict_write_) { int32_t version = (VERSION_1) | ((int32_t)messageType); uint32_t wsize = 0; @@ -66,8 +66,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeStructEnd() { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeFieldBegin(const char* name, - const TType fieldType, - const int16_t fieldId) { + const TType fieldType, + const int16_t fieldId) { (void)name; uint32_t wsize = 0; wsize += writeByte((int8_t)fieldType); @@ -87,8 +87,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeFieldStop() { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMapBegin(const TType keyType, - const TType valType, - const uint32_t size) { + const TType valType, + const uint32_t size) { uint32_t wsize = 0; wsize += writeByte((int8_t)keyType); wsize += writeByte((int8_t)valType); @@ -102,7 +102,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMapEnd() { } template <class Transport_, class ByteOrder_> -uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeListBegin(const TType elemType, const uint32_t size) { +uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeListBegin(const TType elemType, + const uint32_t size) { uint32_t wsize = 0; wsize += writeByte((int8_t)elemType); wsize += writeI32((int32_t)size); @@ -115,7 +116,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeListEnd() { } template <class Transport_, class ByteOrder_> -uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeSetBegin(const TType elemType, const uint32_t size) { +uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeSetBegin(const TType elemType, + const uint32_t size) { uint32_t wsize = 0; wsize += writeByte((int8_t)elemType); wsize += writeI32((int32_t)size); @@ -196,8 +198,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeBinary(const std::string template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readMessageBegin(std::string& name, - TMessageType& messageType, - int32_t& seqid) { + TMessageType& messageType, + int32_t& seqid) { uint32_t result = 0; int32_t sz; result += readI32(sz); @@ -245,8 +247,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readStructEnd() { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readFieldBegin(std::string& name, - TType& fieldType, - int16_t& fieldId) { + TType& fieldType, + int16_t& fieldId) { (void)name; uint32_t result = 0; int8_t type; @@ -267,8 +269,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readFieldEnd() { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readMapBegin(TType& keyType, - TType& valType, - uint32_t& size) { + TType& valType, + uint32_t& size) { int8_t k, v; uint32_t result = 0; int32_t sizei; http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/protocol/TProtocolTypes.h ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/protocol/TProtocolTypes.h b/lib/cpp/src/thrift/protocol/TProtocolTypes.h index ca22b54..6898b24 100644 --- a/lib/cpp/src/thrift/protocol/TProtocolTypes.h +++ b/lib/cpp/src/thrift/protocol/TProtocolTypes.h @@ -20,15 +20,17 @@ #ifndef THRIFT_PROTOCOL_TPROTOCOLTYPES_H_ #define THRIFT_PROTOCOL_TPROTOCOLTYPES_H_ 1 -namespace apache { namespace thrift { namespace protocol { +namespace apache { +namespace thrift { +namespace protocol { enum PROTOCOL_TYPES { T_BINARY_PROTOCOL = 0, T_JSON_PROTOCOL = 1, T_COMPACT_PROTOCOL = 2, }; - -}}} // apache::thrift::protocol +} +} +} // apache::thrift::protocol #endif // #define _THRIFT_PROTOCOL_TPROTOCOLTYPES_H_ 1 - http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/server/TNonblockingServer.cpp ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp index ede34c4..7344b8b 100644 --- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp +++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp @@ -394,7 +394,7 @@ void TNonblockingServer::TConnection::init(THRIFT_SOCKET socket, // Create protocol if (server_->getHeaderTransport()) { inputProtocol_ = server_->getInputProtocolFactory()->getProtocol(factoryInputTransport_, - factoryOutputTransport_); + factoryOutputTransport_); outputProtocol_ = inputProtocol_; } else { inputProtocol_ = server_->getInputProtocolFactory()->getProtocol(factoryInputTransport_); @@ -542,13 +542,12 @@ void TNonblockingServer::TConnection::workSocket() { } bool TNonblockingServer::getHeaderTransport() { - // Currently if there is no output protocol factory, + // Currently if there is no output protocol factory, // we assume header transport (without having to create // a new transport and check) return getOutputProtocolFactory() == NULL; } - /** * This is called when the application transitions from one state into * another. This means that it has finished writing the data that it needed http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/transport/THeaderTransport.h ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/transport/THeaderTransport.h b/lib/cpp/src/thrift/transport/THeaderTransport.h index 0cef56d..d3b851e 100644 --- a/lib/cpp/src/thrift/transport/THeaderTransport.h +++ b/lib/cpp/src/thrift/transport/THeaderTransport.h @@ -130,7 +130,7 @@ public: void readHeaderFormat(uint16_t headerSize, uint32_t sz); /** - * Untransform the data based on the recieved header flags + * Untransform the data based on the received header flags * On conclusion of function, setReadBuffer is called with the * untransformed data. * http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/transport/TPipe.h ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/transport/TPipe.h b/lib/cpp/src/thrift/transport/TPipe.h index fdb17ee..5dd8f9a 100644 --- a/lib/cpp/src/thrift/transport/TPipe.h +++ b/lib/cpp/src/thrift/transport/TPipe.h @@ -51,8 +51,8 @@ public: // Constructs a new pipe object. TPipe(); // Named pipe constructors - - explicit TPipe(HANDLE Pipe); // HANDLE is a void* - explicit TPipe(TAutoHandle &Pipe); // this ctor will clear out / move from Pipe + explicit TPipe(HANDLE Pipe); // HANDLE is a void* + explicit TPipe(TAutoHandle& Pipe); // this ctor will clear out / move from Pipe // need a const char * overload so string literals don't go to the HANDLE overload explicit TPipe(const char* pipename); explicit TPipe(const std::string& pipename); http://git-wip-us.apache.org/repos/asf/thrift/blob/7f4be5f1/lib/cpp/src/thrift/windows/config.h ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/windows/config.h b/lib/cpp/src/thrift/windows/config.h index 24a94f8..108e05b 100644 --- a/lib/cpp/src/thrift/windows/config.h +++ b/lib/cpp/src/thrift/windows/config.h @@ -94,6 +94,6 @@ typedef boost::uint8_t uint8_t; #else #pragma comment(lib, "Ws2_32.lib") #pragma comment(lib, "advapi32.lib") // For security APIs in TPipeServer -#pragma comment(lib, "Shlwapi.lib") // For StrStrIA in TPipeServer +#pragma comment(lib, "Shlwapi.lib") // For StrStrIA in TPipeServer #endif #endif // _THRIFT_WINDOWS_CONFIG_H_
