You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by be...@apache.org on 2013/10/09 22:23:03 UTC

git commit: THRIFT-2027: Minor 64-bit and NOMINMAX issues in C++ library Client: cpp Patch: Ben Craig

Updated Branches:
  refs/heads/master 19244ed87 -> 6493523e9


THRIFT-2027: Minor 64-bit and NOMINMAX issues in C++ library
Client: cpp
Patch: Ben Craig


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6493523e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6493523e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6493523e

Branch: refs/heads/master
Commit: 6493523e96df96069c94647c5e9b841b0be491a6
Parents: 19244ed
Author: Ben Craig <be...@apache.org>
Authored: Wed Oct 9 15:21:38 2013 -0500
Committer: Ben Craig <be...@apache.org>
Committed: Wed Oct 9 15:21:38 2013 -0500

----------------------------------------------------------------------
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 4 ++--
 lib/cpp/src/thrift/transport/THttpServer.cpp     | 2 +-
 lib/cpp/src/thrift/transport/TZlibTransport.cpp  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/6493523e/lib/cpp/src/thrift/server/TNonblockingServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index b9553c4..1552e89 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -893,7 +893,7 @@ TNonblockingServer::TConnection* TNonblockingServer::createConnection(
   // pick an IO thread to handle this connection -- currently round robin
   assert(nextIOThread_ < ioThreads_.size());
   int selectedThreadIdx = nextIOThread_;
-  nextIOThread_ = (nextIOThread_ + 1) % ioThreads_.size();
+  nextIOThread_ = static_cast<uint32_t>((nextIOThread_ + 1) % ioThreads_.size());
 
   TNonblockingIOThread* ioThread = ioThreads_[selectedThreadIdx].get();
 
@@ -1421,7 +1421,7 @@ void TNonblockingIOThread::notifyHandler(evutil_socket_t fd, short which, void*
   while (true) {
     TNonblockingServer::TConnection* connection = 0;
     const int kSize = sizeof(connection);
-    int nBytes = recv(fd, cast_sockopt(&connection), kSize, 0);
+    long nBytes = recv(fd, cast_sockopt(&connection), kSize, 0);
     if (nBytes == kSize) {
       if (connection == NULL) {
         // this is the command to stop our thread, exit the handler!

http://git-wip-us.apache.org/repos/asf/thrift/blob/6493523e/lib/cpp/src/thrift/transport/THttpServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/THttpServer.cpp b/lib/cpp/src/thrift/transport/THttpServer.cpp
index 1135270..e5b3327 100644
--- a/lib/cpp/src/thrift/transport/THttpServer.cpp
+++ b/lib/cpp/src/thrift/transport/THttpServer.cpp
@@ -92,7 +92,7 @@ bool THttpServer::parseStatusLine(char* status) {
     string header = h.str();
 
     // Write the header, then the data, then flush
-    transport_->write((const uint8_t*)header.c_str(), header.size());
+    transport_->write((const uint8_t*)header.c_str(), static_cast<uint32_t>(header.size()));
     transport_->write(buf, len);
     transport_->flush();
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/6493523e/lib/cpp/src/thrift/transport/TZlibTransport.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TZlibTransport.cpp b/lib/cpp/src/thrift/transport/TZlibTransport.cpp
index d77eedd..cdde7c3 100644
--- a/lib/cpp/src/thrift/transport/TZlibTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TZlibTransport.cpp
@@ -143,7 +143,7 @@ uint32_t TZlibTransport::read(uint8_t* buf, uint32_t len) {
   while (true) {
     // Copy out whatever we have available, then give them the min of
     // what we have and what they want, then advance indices.
-    int give = std::min((uint32_t) readAvail(), need);
+    int give = (std::min)((uint32_t) readAvail(), need);
     memcpy(buf, urbuf_ + urpos_, give);
     need -= give;
     buf += give;