THRIFT-2849: spelling errors fixed using codespell tool

Client: All
Patch: Anatol Pomozov

This closes #281
diff --git a/lib/cpp/libthrift.vcxproj.filters b/lib/cpp/libthrift.vcxproj.filters
index c38516b..4effa87 100644
--- a/lib/cpp/libthrift.vcxproj.filters
+++ b/lib/cpp/libthrift.vcxproj.filters
@@ -25,19 +25,19 @@
       <Filter>concurrency</Filter>
     </ClCompile>
     <ClCompile Include="src\thrift\protocol\TDebugProtocol.cpp">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClCompile>
     <ClCompile Include="src\thrift\protocol\TDenseProtocol.cpp">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClCompile>
     <ClCompile Include="src\thrift\protocol\TBase64Utils.cpp">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClCompile>
     <ClCompile Include="src\thrift\protocol\TJSONProtocol.cpp">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClCompile>
     <ClCompile Include="src\thrift\protocol\TMultiplexedProtocol.cpp">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClCompile>
     <ClCompile Include="src\thrift\transport\TFDTransport.cpp">
       <Filter>transport</Filter>
@@ -120,7 +120,7 @@
       <Filter>transport</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TBinaryProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\Thrift.h" />
     <ClInclude Include="src\thrift\TProcessor.h" />
@@ -153,10 +153,10 @@
       <Filter>windows</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TVirtualProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\server\TServer.h">
       <Filter>server</Filter>
@@ -201,16 +201,16 @@
       <Filter>transport</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TJSONProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TMultiplexedProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TDenseProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\protocol\TDebugProtocol.h">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </ClInclude>
     <ClInclude Include="src\thrift\transport\TServerSocket.h">
       <Filter>transport</Filter>
@@ -247,7 +247,7 @@
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <Filter Include="protocal">
+    <Filter Include="protocol">
       <UniqueIdentifier>{07ced19b-b72a-4105-9ffb-6d2bcf64497e}</UniqueIdentifier>
     </Filter>
     <Filter Include="transport">
@@ -274,7 +274,7 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="src\thrift\protocol\TBinaryProtocol.tcc">
-      <Filter>protocal</Filter>
+      <Filter>protocol</Filter>
     </None>
     <None Include="src\thrift\windows\tr1\functional">
       <Filter>windows\tr1</Filter>
diff --git a/lib/cpp/src/thrift/TLogging.h b/lib/cpp/src/thrift/TLogging.h
index 096054c..07ff030 100644
--- a/lib/cpp/src/thrift/TLogging.h
+++ b/lib/cpp/src/thrift/TLogging.h
@@ -62,7 +62,7 @@
 #endif
 
 /**
- * analagous to T_DEBUG but also prints the time
+ * analogous to T_DEBUG but also prints the time
  *
  * @param string  format_string input: printf style format string
  */
@@ -88,7 +88,7 @@
 #endif
 
 /**
- * analagous to T_DEBUG but uses input level to determine whether or not the string
+ * analogous to T_DEBUG but uses input level to determine whether or not the string
  * should be logged.
  *
  * @param int     level: specified debug level
@@ -120,7 +120,7 @@
   }
 
 /**
- * Analagous to T_ERROR, additionally aborting the process.
+ * Analogous to T_ERROR, additionally aborting the process.
  * WARNING: macro calls abort(), ending program execution
  *
  * @param string  format_string input: printf style format string
diff --git a/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
index 4004231..b26d296 100644
--- a/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
+++ b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
@@ -46,7 +46,7 @@
    *
    * Absolute priority is determined by scheduler policy and OS. This
    * enumeration specifies relative priorities such that one can specify a
-   * priority withing a giving scheduler policy without knowing the absolute
+   * priority within a giving scheduler policy without knowing the absolute
    * value of the priority.
    */
   enum PRIORITY {
diff --git a/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h b/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h
index a97f6a9..0ef7261 100644
--- a/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h
+++ b/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h
@@ -96,7 +96,7 @@
     *
     * \param [in] serviceName Name of a service, has to be identical to the name
     *                         declared in the Thrift IDL, e.g. "WeatherReport".
-    * \param [in] processor   Implementation of a service, ususally referred to
+    * \param [in] processor   Implementation of a service, usually referred to
     *                         as "handlers", e.g. WeatherReportHandler,
     *                         implementing WeatherReportIf interface.
     */
diff --git a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
index 85dde6c..7f2583c 100644
--- a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
+++ b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
@@ -261,7 +261,7 @@
 }
 
 /**
- * Write a string to the wire with a varint size preceeding.
+ * Write a string to the wire with a varint size preceding.
  */
 template <class Transport_>
 uint32_t TCompactProtocolT<Transport_>::writeString(const std::string& str) {
diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index ca450f4..72cd28b 100644
--- a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -656,7 +656,7 @@
 }
 
 uint32_t TJSONProtocol::writeByte(const int8_t byte) {
-  // writeByte() must be handled specially becuase boost::lexical cast sees
+  // writeByte() must be handled specially because boost::lexical cast sees
   // int8_t as a text type instead of an integer type
   return writeJSONInteger((int16_t)byte);
 }
@@ -984,7 +984,7 @@
   return readJSONInteger(value);
 }
 
-// readByte() must be handled properly becuase boost::lexical cast sees int8_t
+// readByte() must be handled properly because boost::lexical cast sees int8_t
 // as a text type instead of an integer type
 uint32_t TJSONProtocol::readByte(int8_t& byte) {
   int16_t tmp = (int16_t)byte;
diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.h b/lib/cpp/src/thrift/protocol/TJSONProtocol.h
index b19c35d..3c7b9d7 100644
--- a/lib/cpp/src/thrift/protocol/TJSONProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.h
@@ -43,7 +43,7 @@
  * 2. Thrift doubles are represented as JSON numbers. Some special values are
  *    represented as strings:
  *    a. "NaN" for not-a-number values
- *    b. "Infinity" for postive infinity
+ *    b. "Infinity" for positive infinity
  *    c. "-Infinity" for negative infinity
  *
  * 3. Thrift string values are emitted as JSON strings, with appropriate
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.h b/lib/cpp/src/thrift/server/TNonblockingServer.h
index 7853d54..3edc795 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.h
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.h
@@ -669,7 +669,7 @@
 
   /**
    * Check buffer sizes every "count" calls.  This allows buffer limits
-   * to be enforced for persistant connections with a controllable degree
+   * to be enforced for persistent connections with a controllable degree
    * of overhead. 0 disables checks except at connection close.
    *
    * @param count the number of calls between checks, or 0 to disable
@@ -812,7 +812,7 @@
    * C-callable event handler for listener events.  Provides a callback
    * that libevent can understand which invokes server->handleEvent().
    *
-   * @param fd the descriptor the event occured on.
+   * @param fd the descriptor the event occurred on.
    * @param which the flags associated with the event.
    * @param v void* callback arg where we placed TNonblockingServer's "this".
    */
diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.cpp b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
index 25adb23..bedb5a5 100644
--- a/lib/cpp/src/thrift/transport/TBufferTransports.cpp
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
@@ -63,7 +63,7 @@
 void TBufferedTransport::writeSlow(const uint8_t* buf, uint32_t len) {
   uint32_t have_bytes = static_cast<uint32_t>(wBase_ - wBuf_.get());
   uint32_t space = static_cast<uint32_t>(wBound_ - wBase_);
-  // We should only take the slow path if we can't accomodate the write
+  // We should only take the slow path if we can't accommodate the write
   // with the free space already in the buffer.
   assert(wBound_ - wBase_ < static_cast<ptrdiff_t>(len));
 
diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h
index da75052..c94ae1e 100644
--- a/lib/cpp/src/thrift/transport/TBufferTransports.h
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.h
@@ -86,7 +86,7 @@
   /**
    * Fast-path write.
    *
-   * When we have enough empty space in our buffer to accomodate the write, we
+   * When we have enough empty space in our buffer to accommodate the write, we
    * can satisfy it with a single memcpy, then adjust our internal pointers.
    * If the buffer is full, we call out to our slow path, implemented by a
    * subclass.  This method is meant to eventually be nonvirtual and
@@ -629,7 +629,7 @@
   uint32_t available_write() const { return static_cast<uint32_t>(wBound_ - wBase_); }
 
   // Returns a pointer to where the client can write data to append to
-  // the TMemoryBuffer, and ensures the buffer is big enough to accomodate a
+  // the TMemoryBuffer, and ensures the buffer is big enough to accommodate a
   // write of the provided length.  The returned pointer is very convenient for
   // passing to read(), recv(), or similar. You must call wroteBytes() as soon
   // as data is written or the buffer will not be aware that data has changed.
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index de5876c..682f63c 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -204,7 +204,7 @@
     return false;
   }
   int shutdown = SSL_get_shutdown(ssl_);
-  // "!!" is squelching C4800 "forcing bool -> true or false" perfomance warning
+  // "!!" is squelching C4800 "forcing bool -> true or false" performance warning
   bool shutdownReceived = !!(shutdown & SSL_RECEIVED_SHUTDOWN);
   bool shutdownSent = !!(shutdown & SSL_SENT_SHUTDOWN);
   if (shutdownReceived && shutdownSent) {
diff --git a/lib/cpp/src/thrift/transport/TSocket.h b/lib/cpp/src/thrift/transport/TSocket.h
index 38bd789..427b91f 100644
--- a/lib/cpp/src/thrift/transport/TSocket.h
+++ b/lib/cpp/src/thrift/transport/TSocket.h
@@ -186,7 +186,7 @@
   void setKeepAlive(bool keepAlive);
 
   /**
-   * Get socket information formated as a string <Host: x Port: x>
+   * Get socket information formatted as a string <Host: x Port: x>
    */
   std::string getSocketInfo();
 
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index 0305732..451fcef 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -755,7 +755,7 @@
  * - Combining many tests into a single function makes it more difficult to
  *   tell precisely which tests failed.  It also means you can't get a progress
  *   update after each test, and the tests are already fairly slow.
- * - Similar registration could be acheived with BOOST_TEST_CASE_TEMPLATE,
+ * - Similar registration could be achieved with BOOST_TEST_CASE_TEMPLATE,
  *   but it requires a lot of awkward MPL code, and results in useless test
  *   case names.  (The names are generated from std::type_info::name(), which
  *   is compiler-dependent.  gcc returns mangled names.)