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 bb2b14a..eb5000e 100644
--- a/lib/cpp/src/Thrift.h
+++ b/lib/cpp/src/Thrift.h
@@ -99,13 +99,13 @@
   /**
    * 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 c08720b..dbad1e3 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.h
+++ b/lib/cpp/src/protocol/TDebugProtocol.h
@@ -36,13 +36,13 @@
  */
 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 ea0ae21..b3146d5 100644
--- a/lib/cpp/src/protocol/TProtocolException.h
+++ b/lib/cpp/src/protocol/TProtocolException.h
@@ -26,13 +26,13 @@
   /**
    * 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 ccf4ce3..334ad51 100644
--- a/lib/cpp/src/transport/TBufferTransports.h
+++ b/lib/cpp/src/transport/TBufferTransports.h
@@ -453,10 +453,10 @@
    *   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 e70f987..7cb6140 100644
--- a/lib/cpp/src/transport/TFDTransport.h
+++ b/lib/cpp/src/transport/TFDTransport.h
@@ -22,9 +22,9 @@
  */
 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 2854761..e254aac 100644
--- a/lib/cpp/src/transport/TTransportException.h
+++ b/lib/cpp/src/transport/TTransportException.h
@@ -26,16 +26,16 @@
   /**
    * 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() :