summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@apache.org>2008-12-05 02:54:09 +0000
committerDavid Reiss <dreiss@apache.org>2008-12-05 02:54:09 +0000
commit322e595c2ac8a7ff4ef53cc472882d85e36000a0 (patch)
tree62b7512e2549ccf03fb825683c0f14d05427d8e5
parentfbb14ef1b33db23cb0862975af58bbba957d2378 (diff)
downloadthrift-322e595c2ac8a7ff4ef53cc472882d85e36000a0.tar.gz
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
-rw-r--r--lib/cpp/src/Thrift.h14
-rw-r--r--lib/cpp/src/protocol/TDebugProtocol.h14
-rw-r--r--lib/cpp/src/protocol/TProtocolException.h14
-rw-r--r--lib/cpp/src/transport/TBufferTransports.h8
-rw-r--r--lib/cpp/src/transport/TFDTransport.h6
-rw-r--r--lib/cpp/src/transport/TTransportException.h20
6 files changed, 38 insertions, 38 deletions
diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/Thrift.h
index bb2b14a5a..eb5000e01 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 c08720b77..dbad1e32e 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 ea0ae21a1..b3146d5c2 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 ccf4ce3c4..334ad51ff 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 e70f987f9..7cb614009 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 28547617e..e254aac46 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() :