Thrift: Whitespace cleanup.

Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.cpp b/lib/cpp/src/protocol/TBinaryProtocol.cpp
index 30bbde6..289d614 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.cpp
+++ b/lib/cpp/src/protocol/TBinaryProtocol.cpp
@@ -25,7 +25,7 @@
   //return *reinterpret_cast<To*>(&from);  // BAD!!!
   //return *static_cast<To*>(static_cast<void*>(&from));  // BAD!!!
   //return *(To*)(void*)&from;  // BAD!!!
-  
+
   // Super clean and paritally blessed by section 3.9 of the standard.
   //unsigned char c[sizeof(from)];
   //memcpy(c, &from, sizeof(from));
@@ -50,7 +50,7 @@
 }
 
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 uint32_t TBinaryProtocol::writeMessageBegin(const std::string& name,
                                             const TMessageType messageType,
@@ -99,8 +99,8 @@
 uint32_t TBinaryProtocol::writeFieldStop() {
   return
     writeByte((int8_t)T_STOP);
-}  
-                               
+}
+
 uint32_t TBinaryProtocol::writeMapBegin(const TType keyType,
                                         const TType valType,
                                         const uint32_t size) {
@@ -167,7 +167,7 @@
   trans_->write((uint8_t*)&net, 8);
   return 8;
 }
-  
+
 uint32_t TBinaryProtocol::writeDouble(const double dub) {
   BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t));
   BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559);
@@ -178,7 +178,7 @@
   return 8;
 }
 
-  
+
 uint32_t TBinaryProtocol::writeString(const string& str) {
   uint32_t size = str.size();
   uint32_t result = writeI32((int32_t)size);
@@ -250,11 +250,11 @@
   result += readI16(fieldId);
   return result;
 }
-  
+
 uint32_t TBinaryProtocol::readFieldEnd() {
   return 0;
 }
- 
+
 uint32_t TBinaryProtocol::readMapBegin(TType& keyType,
                                        TType& valType,
                                        uint32_t& size) {
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/protocol/TBinaryProtocol.h
index 89958ec..c7e2791 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.h
+++ b/lib/cpp/src/protocol/TBinaryProtocol.h
@@ -11,7 +11,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 /**
  * The default binary protocol for thrift. Writes all data in a very basic
@@ -90,7 +90,7 @@
   uint32_t writeFieldEnd();
 
   uint32_t writeFieldStop();
-                                       
+
   uint32_t writeMapBegin(const TType keyType,
                          const TType valType,
                          const uint32_t size);
@@ -140,9 +140,9 @@
   uint32_t readFieldBegin(std::string& name,
                           TType& fieldType,
                           int16_t& fieldId);
-  
+
   uint32_t readFieldEnd();
- 
+
   uint32_t readMapBegin(TType& keyType,
                         TType& valType,
                         uint32_t& size);
@@ -151,7 +151,7 @@
 
   uint32_t readListBegin(TType& elemType,
                          uint32_t& size);
-  
+
   uint32_t readListEnd();
 
   uint32_t readSetBegin(TType& elemType,
diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/protocol/TDebugProtocol.cpp
index 5d28b78..2f23b11 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.cpp
+++ b/lib/cpp/src/protocol/TDebugProtocol.cpp
@@ -25,7 +25,7 @@
 }
 
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 string TDebugProtocol::fieldTypeName(TType type) {
   switch (type) {
@@ -171,7 +171,7 @@
 
   return writeIndented(
       id_str + ": " +
-      name + " (" + 
+      name + " (" +
       fieldTypeName(fieldType) + ") = ");
 }
 
@@ -183,8 +183,8 @@
 uint32_t TDebugProtocol::writeFieldStop() {
   return 0;
     //writeIndented("***STOP***\n");
-}  
-                               
+}
+
 uint32_t TDebugProtocol::writeMapBegin(const TType keyType,
                                        const TType valType,
                                        const uint32_t size) {
@@ -273,12 +273,12 @@
 uint32_t TDebugProtocol::writeI64(const int64_t i64) {
   return writeItem(boost::lexical_cast<string>(i64));
 }
-  
+
 uint32_t TDebugProtocol::writeDouble(const double dub) {
   return writeItem(boost::lexical_cast<string>(dub));
 }
 
-  
+
 uint32_t TDebugProtocol::writeString(const string& str) {
   // XXX Raw/UTF-8?
 
diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/protocol/TDebugProtocol.h
index 0dd60d8..90b7688 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.h
+++ b/lib/cpp/src/protocol/TDebugProtocol.h
@@ -14,7 +14,7 @@
 
 #include <transport/TTransportUtils.h>
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 /*
 
@@ -73,7 +73,7 @@
   uint32_t writeFieldEnd();
 
   uint32_t writeFieldStop();
-                                       
+
   uint32_t writeMapBegin(const TType keyType,
                          const TType valType,
                          const uint32_t size);
@@ -140,7 +140,7 @@
 }}} // facebook::thrift::protocol
 
 
-namespace facebook { namespace thrift { 
+namespace facebook { namespace thrift {
 
 template<typename ThriftStruct>
 std::string ThriftDebugString(const ThriftStruct& ts) {
diff --git a/lib/cpp/src/protocol/TDenseProtocol.h b/lib/cpp/src/protocol/TDenseProtocol.h
index 0902e15..dae2c18 100644
--- a/lib/cpp/src/protocol/TDenseProtocol.h
+++ b/lib/cpp/src/protocol/TDenseProtocol.h
@@ -20,7 +20,7 @@
  * The dense protocol is designed to use as little space as possible.
  *
  * There are two types of dense protocol instances.  Standalone instances
- * are not used for RPC and just encoded and decode structures of 
+ * are not used for RPC and just encoded and decode structures of
  * a predetermined type.  Non-standalone instances are used for RPC.
  * Currently, only standalone instances exist.
  *
diff --git a/lib/cpp/src/protocol/TOneWayProtocol.h b/lib/cpp/src/protocol/TOneWayProtocol.h
index 635744c..245f830 100644
--- a/lib/cpp/src/protocol/TOneWayProtocol.h
+++ b/lib/cpp/src/protocol/TOneWayProtocol.h
@@ -9,7 +9,7 @@
 
 #include "TProtocol.h"
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 /**
  * Abstract class for implementing a protocol that can only be written,
@@ -62,12 +62,12 @@
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
         subclass_ + " does not support reading (yet).");
   }
-  
+
   uint32_t readFieldEnd() {
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
         subclass_ + " does not support reading (yet).");
   }
- 
+
   uint32_t readMapBegin(TType& keyType,
                         TType& valType,
                         uint32_t& size) {
@@ -85,7 +85,7 @@
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
         subclass_ + " does not support reading (yet).");
   }
-  
+
   uint32_t readListEnd() {
     throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
         subclass_ + " does not support reading (yet).");
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h
index 7fa3de8..85cc48a 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/protocol/TProtocol.h
@@ -17,7 +17,7 @@
 #include <string>
 #include <map>
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 using facebook::thrift::transport::TTransport;
 
@@ -118,9 +118,9 @@
 
 
   virtual uint32_t writeStructBegin(const std::string& name) = 0;
-  
+
   virtual uint32_t writeStructEnd() = 0;
-  
+
   virtual uint32_t writeFieldBegin(const std::string& name,
                                    const TType fieldType,
                                    const int16_t fieldId) = 0;
@@ -128,13 +128,13 @@
   virtual uint32_t writeFieldEnd() = 0;
 
   virtual uint32_t writeFieldStop() = 0;
-                                      
+
   virtual uint32_t writeMapBegin(const TType keyType,
                                  const TType valType,
                                  const uint32_t size) = 0;
 
   virtual uint32_t writeMapEnd() = 0;
-  
+
   virtual uint32_t writeListBegin(const TType elemType,
                                   const uint32_t size) = 0;
 
@@ -166,7 +166,7 @@
   virtual uint32_t readMessageBegin(std::string& name,
                                     TMessageType& messageType,
                                     int32_t& seqid) = 0;
-  
+
   virtual uint32_t readMessageEnd() = 0;
 
   virtual uint32_t readStructBegin(std::string& name) = 0;
@@ -176,9 +176,9 @@
   virtual uint32_t readFieldBegin(std::string& name,
                                   TType& fieldType,
                                   int16_t& fieldId) = 0;
-  
+
   virtual uint32_t readFieldEnd() = 0;
- 
+
   virtual uint32_t readMapBegin(TType& keyType,
                                 TType& valType,
                                 uint32_t& size) = 0;
@@ -328,7 +328,7 @@
     ptrans_(ptrans) {
     trans_ = ptrans.get();
   }
-    
+
   boost::shared_ptr<TTransport> ptrans_;
   TTransport* trans_;
 
diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/protocol/TProtocolException.h
index 4429a62..0532ec5 100644
--- a/lib/cpp/src/protocol/TProtocolException.h
+++ b/lib/cpp/src/protocol/TProtocolException.h
@@ -10,7 +10,7 @@
 #include <boost/lexical_cast.hpp>
 #include <string>
 
-namespace facebook { namespace thrift { namespace protocol { 
+namespace facebook { namespace thrift { namespace protocol {
 
 /**
  * Class to encapsulate all the possible types of protocol errors that may
@@ -41,7 +41,7 @@
     type_(UNKNOWN) {}
 
   TProtocolException(TProtocolExceptionType type) :
-    facebook::thrift::TException(), 
+    facebook::thrift::TException(),
     type_(type) {}
 
   TProtocolException(const std::string& message) :
@@ -81,11 +81,11 @@
   }
 
  protected:
-  /** 
+  /**
    * Error code
    */
   TProtocolExceptionType type_;
- 
+
 };
 
 }}} // facebook::thrift::protocol