You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/03/29 19:48:43 UTC
[9/9] thrift git commit: THRIFT-3757 Fix various compile warnings
with VS2015
THRIFT-3757 Fix various compile warnings with VS2015
This closes #962
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/f98d59fc
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/f98d59fc
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/f98d59fc
Branch: refs/heads/master
Commit: f98d59fc822dd6d05c6cd48c5b86d716469a48fc
Parents: d42d8be
Author: tpcwang <tp...@gmail.com>
Authored: Wed Mar 23 16:18:52 2016 -0700
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900
----------------------------------------------------------------------
lib/cpp/src/thrift/concurrency/TimerManager.cpp | 3 +--
lib/cpp/src/thrift/protocol/TJSONProtocol.cpp | 1 -
lib/cpp/src/thrift/server/TNonblockingServer.cpp | 6 +++---
lib/cpp/src/thrift/server/TServerFramework.cpp | 2 +-
lib/cpp/src/thrift/transport/TSocket.cpp | 2 +-
lib/cpp/test/TransportTest.cpp | 2 +-
6 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/concurrency/TimerManager.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/concurrency/TimerManager.cpp b/lib/cpp/src/thrift/concurrency/TimerManager.cpp
index 122d26e..f95fcda 100644
--- a/lib/cpp/src/thrift/concurrency/TimerManager.cpp
+++ b/lib/cpp/src/thrift/concurrency/TimerManager.cpp
@@ -162,8 +162,7 @@ TimerManager::~TimerManager() {
try {
stop();
} catch (...) {
- throw;
- // uhoh
+ // We're really hosed.
}
}
}
http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index dbed8fb..412e927 100644
--- a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -43,7 +43,6 @@ static const uint8_t kJSONObjectStart = '{';
static const uint8_t kJSONObjectEnd = '}';
static const uint8_t kJSONArrayStart = '[';
static const uint8_t kJSONArrayEnd = ']';
-static const uint8_t kJSONNewline = '\n';
static const uint8_t kJSONPairSeparator = ':';
static const uint8_t kJSONElemSeparator = ',';
static const uint8_t kJSONBackslash = '\\';
http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/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 1e35275..7f44c1f 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -1436,8 +1436,8 @@ bool TNonblockingIOThread::notify(TNonblockingServer::TConnection* conn) {
}
fd_set wfds, efds;
- int ret = -1;
- int kSize = sizeof(conn);
+ long ret = -1;
+ long kSize = sizeof(conn);
const char* pos = (const char*)const_cast_sockopt(&conn);
while (kSize > 0) {
@@ -1445,7 +1445,7 @@ bool TNonblockingIOThread::notify(TNonblockingServer::TConnection* conn) {
FD_ZERO(&efds);
FD_SET(fd, &wfds);
FD_SET(fd, &efds);
- ret = select(fd + 1, NULL, &wfds, &efds, NULL);
+ ret = select(static_cast<int>(fd + 1), NULL, &wfds, &efds, NULL);
if (ret < 0) {
return false;
} else if (ret == 0) {
http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/server/TServerFramework.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/server/TServerFramework.cpp b/lib/cpp/src/thrift/server/TServerFramework.cpp
index 43d11c5..9fdd694 100644
--- a/lib/cpp/src/thrift/server/TServerFramework.cpp
+++ b/lib/cpp/src/thrift/server/TServerFramework.cpp
@@ -224,7 +224,7 @@ void TServerFramework::newlyConnectedClient(const boost::shared_ptr<TConnectedCl
// Count a concurrent client added.
Synchronized sync(mon_);
++clients_;
- hwm_ = std::max(hwm_, clients_);
+ hwm_ = (std::max)(hwm_, clients_);
}
void TServerFramework::disposeConnectedClient(TConnectedClient* pClient) {
http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/transport/TSocket.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
index 6de6d4e..bc1bbdd 100644
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -700,7 +700,7 @@ void TSocket::setLinger(bool on, int linger) {
#ifndef _WIN32
struct linger l = {(lingerOn_ ? 1 : 0), lingerVal_};
#else
- struct linger l = {(lingerOn_ ? 1 : 0), static_cast<u_short>(lingerVal_)};
+ struct linger l = {static_cast<u_short>(lingerOn_ ? 1 : 0), static_cast<u_short>(lingerVal_)};
#endif
int ret = setsockopt(socket_, SOL_SOCKET, SO_LINGER, cast_sockopt(&l), sizeof(l));
http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/test/TransportTest.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index 6cc2c87..ccef9d5 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -17,7 +17,7 @@
* under the License.
*/
-#include "config.h"
+#include <thrift/thrift-config.h>
#include <stdlib.h>
#include <time.h>