You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2008/12/05 03:54:09 UTC

svn commit: r723562 - in /incubator/thrift/trunk/lib/cpp/src: Thrift.h protocol/TDebugProtocol.h protocol/TProtocolException.h transport/TBufferTransports.h transport/TFDTransport.h transport/TTransportException.h

Author: dreiss
Date: Thu Dec  4 18:54:09 2008
New Revision: 723562

URL: http://svn.apache.org/viewvc?rev=723562&view=rev
Log:
THRIFT-203. cpp: Make library headers compile under g++ -pedantic

It turns out that trailing commas in enum definitions are
not actually valid C++.

Modified:
    incubator/thrift/trunk/lib/cpp/src/Thrift.h
    incubator/thrift/trunk/lib/cpp/src/protocol/TDebugProtocol.h
    incubator/thrift/trunk/lib/cpp/src/protocol/TProtocolException.h
    incubator/thrift/trunk/lib/cpp/src/transport/TBufferTransports.h
    incubator/thrift/trunk/lib/cpp/src/transport/TFDTransport.h
    incubator/thrift/trunk/lib/cpp/src/transport/TTransportException.h

Modified: incubator/thrift/trunk/lib/cpp/src/Thrift.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/Thrift.h?rev=723562&r1=723561&r2=723562&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/Thrift.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/Thrift.h Thu Dec  4 18:54:09 2008
@@ -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() :

Modified: incubator/thrift/trunk/lib/cpp/src/protocol/TDebugProtocol.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/protocol/TDebugProtocol.h?rev=723562&r1=723561&r2=723562&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/protocol/TDebugProtocol.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/protocol/TDebugProtocol.h Thu Dec  4 18:54:09 2008
@@ -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:

Modified: incubator/thrift/trunk/lib/cpp/src/protocol/TProtocolException.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/protocol/TProtocolException.h?rev=723562&r1=723561&r2=723562&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/protocol/TProtocolException.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/protocol/TProtocolException.h Thu Dec  4 18:54:09 2008
@@ -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() :

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TBufferTransports.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TBufferTransports.h?rev=723562&r1=723561&r2=723562&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TBufferTransports.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TBufferTransports.h Thu Dec  4 18:54:09 2008
@@ -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
   };
 
   /**

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TFDTransport.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TFDTransport.h?rev=723562&r1=723561&r2=723562&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TFDTransport.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TFDTransport.h Thu Dec  4 18:54:09 2008
@@ -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)

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TTransportException.h
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TTransportException.h?rev=723562&r1=723561&r2=723562&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TTransportException.h (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TTransportException.h Thu Dec  4 18:54:09 2008
@@ -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() :