THRIFT-3757 Fix various compile warnings with VS2015

This closes #962
This commit is contained in:
tpcwang 2016-03-23 16:18:52 -07:00 committed by Nobuaki Sukegawa
parent d42d8be78f
commit f98d59fc82
6 changed files with 7 additions and 9 deletions

View File

@ -162,8 +162,7 @@ TimerManager::~TimerManager() {
try {
stop();
} catch (...) {
throw;
// uhoh
// We're really hosed.
}
}
}

View File

@ -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 = '\\';

View File

@ -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) {

View File

@ -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) {

View File

@ -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));

View File

@ -17,7 +17,7 @@
* under the License.
*/
#include "config.h"
#include <thrift/thrift-config.h>
#include <stdlib.h>
#include <time.h>