Upgrading vendor folder dependencies.

This commit is contained in:
Renan DelValle 2018-12-27 09:58:53 -08:00
parent 4a0cbcd770
commit acbe9ad9e5
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
229 changed files with 10735 additions and 4528 deletions

View file

@ -53,12 +53,9 @@
<ClCompile Include="src\thrift\server\TSimpleServer.cpp"/>
<ClCompile Include="src\thrift\server\TThreadPoolServer.cpp"/>
<ClCompile Include="src\thrift\server\TThreadedServer.cpp"/>
<ClCompile Include="src\thrift\server\TConnectedClient.cpp"/>
<ClCompile Include="src\thrift\server\TNonblockingServer.cpp"/>
<ClCompile Include="src\thrift\server\TServerFramework.cpp"/>
<ClCompile Include="src\thrift\server\TSimpleServer.cpp"/>
<ClCompile Include="src\thrift\server\TThreadedServer.cpp"/>
<ClCompile Include="src\thrift\server\TThreadPoolServer.cpp"/>
<ClCompile Include="src\thrift\server\TConnectedClient.cpp"/>
<ClCompile Include="src\thrift\server\TNonblockingServer.cpp"/>
<ClCompile Include="src\thrift\server\TServerFramework.cpp"/>
<ClCompile Include="src\thrift\TApplicationException.cpp"/>
<ClCompile Include="src\thrift\TOutput.cpp"/>
<ClCompile Include="src\thrift\transport\TBufferTransports.cpp"/>

View file

@ -899,7 +899,7 @@ uint32_t TJSONProtocol::readJSONDouble(double& num) {
}
try {
num = fromString<double>(str);
} catch (std::runtime_error e) {
} catch (std::runtime_error& e) {
throw TProtocolException(TProtocolException::INVALID_DATA,
"Expected numeric value; got \"" + str + "\"");
}
@ -912,7 +912,7 @@ uint32_t TJSONProtocol::readJSONDouble(double& num) {
result += readJSONNumericChars(str);
try {
num = fromString<double>(str);
} catch (std::runtime_error e) {
} catch (std::runtime_error& e) {
throw TProtocolException(TProtocolException::INVALID_DATA,
"Expected numeric value; got \"" + str + "\"");
}

View file

@ -91,7 +91,7 @@ uint32_t TQIODeviceTransport::read(uint8_t* buf, uint32_t len) {
"read(): underlying QIODevice is not open");
}
actualSize = (uint32_t)std::min((qint64)len, dev_->bytesAvailable());
actualSize = (uint32_t)(std::min)((qint64)len, dev_->bytesAvailable());
readSize = dev_->read(reinterpret_cast<char*>(buf), actualSize);
if (readSize < 0) {

View file

@ -449,7 +449,7 @@ private:
// Common initialization done by all constructors.
void initCommon(uint8_t* buf, uint32_t size, bool owner, uint32_t wPos) {
maxBufferSize_ = std::numeric_limits<uint32_t>::max();
maxBufferSize_ = (std::numeric_limits<uint32_t>::max)();
if (buf == NULL && size != 0) {
assert(owner);

View file

@ -65,7 +65,6 @@ using stdcxx::shared_ptr;
using std::cerr;
using std::cout;
using std::endl;
using std::min;
using std::string;
using namespace apache::thrift::protocol;
using namespace apache::thrift::concurrency;
@ -705,8 +704,8 @@ eventInfo* TFileTransport::readEvent() {
readState_.event_->eventBuffPos_ = 0;
}
// take either the entire event or the remaining bytes in the buffer
int reclaimBuffer = min((uint32_t)(readState_.bufferLen_ - readState_.bufferPtr_),
readState_.event_->eventSize_ - readState_.event_->eventBuffPos_);
int reclaimBuffer = (std::min)((uint32_t)(readState_.bufferLen_ - readState_.bufferPtr_),
readState_.event_->eventSize_ - readState_.event_->eventBuffPos_);
// copy data from read buffer into event buffer
memcpy(readState_.event_->eventBuff_ + readState_.event_->eventBuffPos_,

View file

@ -511,7 +511,7 @@ void THeaderTransport::flush() {
// Pkt size
ptrdiff_t szHbp = (headerStart - pktStart - 4);
if (static_cast<uint64_t>(szHbp) > static_cast<uint64_t>(std::numeric_limits<uint32_t>().max()) - (headerSize + haveBytes)) {
if (static_cast<uint64_t>(szHbp) > static_cast<uint64_t>((std::numeric_limits<uint32_t>().max)()) - (headerSize + haveBytes)) {
throw TTransportException(TTransportException::CORRUPTED_DATA,
"Header section size is unreasonable");
}

View file

@ -21,6 +21,9 @@
#include <algorithm>
#include <iostream>
#if __cplusplus >= 201703L
#include <random>
#endif
#include <thrift/transport/TSocketPool.h>
@ -188,7 +191,13 @@ void TSocketPool::open() {
}
if (randomize_ && numServers > 1) {
random_shuffle(servers_.begin(), servers_.end());
#if __cplusplus >= 201703L
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(servers_.begin(), servers_.end(), urng);
#else
std::random_shuffle(servers_.begin(), servers_.end());
#endif
}
for (size_t i = 0; i < numServers; ++i) {

View file

@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(test_exceptions) {
BOOST_AUTO_TEST_CASE(test_default_maximum_buffer_size)
{
BOOST_CHECK_EQUAL(std::numeric_limits<uint32_t>::max(), TMemoryBuffer().getMaxBufferSize());
BOOST_CHECK_EQUAL((std::numeric_limits<uint32_t>::max)(), TMemoryBuffer().getMaxBufferSize());
}
BOOST_AUTO_TEST_CASE(test_default_buffer_size)