From: David Reiss Date: Fri, 5 Dec 2008 02:54:09 +0000 (+0000) Subject: THRIFT-203. cpp: Make library headers compile under g++ -pedantic X-Git-Tag: 0.2.0~395 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=322e595c2ac8a7ff4ef53cc472882d85e36000a0;p=common%2Fthrift.git THRIFT-203. cpp: Make library headers compile under g++ -pedantic It turns out that trailing commas in enum definitions are not actually valid C++. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@723562 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/Thrift.h index bb2b14a5..eb5000e0 100644 --- a/lib/cpp/src/Thrift.h +++ b/lib/cpp/src/Thrift.h @@ -99,13 +99,13 @@ class TApplicationException : public TException { /** * Error codes for the various types of exceptions. */ - enum TApplicationExceptionType { - UNKNOWN = 0, - UNKNOWN_METHOD = 1, - INVALID_MESSAGE_TYPE = 2, - WRONG_METHOD_NAME = 3, - BAD_SEQUENCE_ID = 4, - MISSING_RESULT = 5, + enum TApplicationExceptionType + { UNKNOWN = 0 + , UNKNOWN_METHOD = 1 + , INVALID_MESSAGE_TYPE = 2 + , WRONG_METHOD_NAME = 3 + , BAD_SEQUENCE_ID = 4 + , MISSING_RESULT = 5 }; TApplicationException() : diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/protocol/TDebugProtocol.h index c08720b7..dbad1e32 100644 --- a/lib/cpp/src/protocol/TDebugProtocol.h +++ b/lib/cpp/src/protocol/TDebugProtocol.h @@ -36,13 +36,13 @@ Complaints are not. :R */ class TDebugProtocol : public TWriteOnlyProtocol { private: - enum write_state_t { - UNINIT, - STRUCT, - LIST, - SET, - MAP_KEY, - MAP_VALUE, + enum write_state_t + { UNINIT + , STRUCT + , LIST + , SET + , MAP_KEY + , MAP_VALUE }; public: diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/protocol/TProtocolException.h index ea0ae21a..b3146d5c 100644 --- a/lib/cpp/src/protocol/TProtocolException.h +++ b/lib/cpp/src/protocol/TProtocolException.h @@ -26,13 +26,13 @@ class TProtocolException : public facebook::thrift::TException { /** * Error codes for the various types of exceptions. */ - enum TProtocolExceptionType { - UNKNOWN = 0, - INVALID_DATA = 1, - NEGATIVE_SIZE = 2, - SIZE_LIMIT = 3, - BAD_VERSION = 4, - NOT_IMPLEMENTED = 5, + enum TProtocolExceptionType + { UNKNOWN = 0 + , INVALID_DATA = 1 + , NEGATIVE_SIZE = 2 + , SIZE_LIMIT = 3 + , BAD_VERSION = 4 + , NOT_IMPLEMENTED = 5 }; TProtocolException() : diff --git a/lib/cpp/src/transport/TBufferTransports.h b/lib/cpp/src/transport/TBufferTransports.h index ccf4ce3c..334ad51f 100644 --- a/lib/cpp/src/transport/TBufferTransports.h +++ b/lib/cpp/src/transport/TBufferTransports.h @@ -453,10 +453,10 @@ class TMemoryBuffer : public TBufferBase { * and will be responsible for freeing it. * The membory must have been allocated with malloc. */ - enum MemoryPolicy { - OBSERVE = 1, - COPY = 2, - TAKE_OWNERSHIP = 3, + enum MemoryPolicy + { OBSERVE = 1 + , COPY = 2 + , TAKE_OWNERSHIP = 3 }; /** diff --git a/lib/cpp/src/transport/TFDTransport.h b/lib/cpp/src/transport/TFDTransport.h index e70f987f..7cb61400 100644 --- a/lib/cpp/src/transport/TFDTransport.h +++ b/lib/cpp/src/transport/TFDTransport.h @@ -22,9 +22,9 @@ namespace facebook { namespace thrift { namespace transport { */ class TFDTransport : public TTransport { public: - enum ClosePolicy { - NO_CLOSE_ON_DESTROY = 0, - CLOSE_ON_DESTROY = 1, + enum ClosePolicy + { NO_CLOSE_ON_DESTROY = 0 + , CLOSE_ON_DESTROY = 1 }; TFDTransport(int fd, ClosePolicy close_policy = NO_CLOSE_ON_DESTROY) diff --git a/lib/cpp/src/transport/TTransportException.h b/lib/cpp/src/transport/TTransportException.h index 28547617..e254aac4 100644 --- a/lib/cpp/src/transport/TTransportException.h +++ b/lib/cpp/src/transport/TTransportException.h @@ -26,16 +26,16 @@ class TTransportException : public facebook::thrift::TException { /** * Error codes for the various types of exceptions. */ - enum TTransportExceptionType { - UNKNOWN = 0, - NOT_OPEN = 1, - ALREADY_OPEN = 2, - TIMED_OUT = 3, - END_OF_FILE = 4, - INTERRUPTED = 5, - BAD_ARGS = 6, - CORRUPTED_DATA = 7, - INTERNAL_ERROR = 8, + enum TTransportExceptionType + { UNKNOWN = 0 + , NOT_OPEN = 1 + , ALREADY_OPEN = 2 + , TIMED_OUT = 3 + , END_OF_FILE = 4 + , INTERRUPTED = 5 + , BAD_ARGS = 6 + , CORRUPTED_DATA = 7 + , INTERNAL_ERROR = 8 }; TTransportException() :