summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcyy <cyyever@outlook.com>2019-01-16 14:43:51 +0800
committercyy <cyyever@outlook.com>2019-01-22 10:38:15 +0800
commit9fed90104ce08b85f7b7d2b9d707cb07562968ff (patch)
tree6553e739ec1f08a1f2a2c5e75a4074e12ac7d43b /lib
parentf7a4ead00d7988e76d2a22758f9e674644582620 (diff)
downloadthrift-9fed90104ce08b85f7b7d2b9d707cb07562968ff.tar.gz
fix static analyzer warings
Diffstat (limited to 'lib')
-rw-r--r--lib/cpp/src/thrift/server/TNonblockingServer.cpp2
-rw-r--r--lib/cpp/test/AllProtocolTests.tcc2
-rw-r--r--lib/cpp/test/OneWayHTTPTest.cpp2
-rw-r--r--lib/cpp/test/TransportTest.cpp2
4 files changed, 3 insertions, 5 deletions
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index 31ff2a96a..bee3e3b49 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -1285,7 +1285,7 @@ void TNonblockingIOThread::registerEvents() {
}
bool TNonblockingIOThread::notify(TNonblockingServer::TConnection* conn) {
- THRIFT_SOCKET fd = getNotificationSendFD();
+ auto fd = getNotificationSendFD();
if (fd < 0) {
return false;
}
diff --git a/lib/cpp/test/AllProtocolTests.tcc b/lib/cpp/test/AllProtocolTests.tcc
index a7eab07ca..80a4ea097 100644
--- a/lib/cpp/test/AllProtocolTests.tcc
+++ b/lib/cpp/test/AllProtocolTests.tcc
@@ -216,7 +216,7 @@ void testProtocol(const char* protoname) {
testMessage<TProto>();
printf("%s => OK\n", protoname);
- } catch (TException e) {
+ } catch (const TException &e) {
THRIFT_SNPRINTF(errorMessage, ERR_LEN, "%s => Test FAILED: %s", protoname, e.what());
throw TException(errorMessage);
}
diff --git a/lib/cpp/test/OneWayHTTPTest.cpp b/lib/cpp/test/OneWayHTTPTest.cpp
index 89fa16431..f369d8ce1 100644
--- a/lib/cpp/test/OneWayHTTPTest.cpp
+++ b/lib/cpp/test/OneWayHTTPTest.cpp
@@ -227,7 +227,7 @@ BOOST_AUTO_TEST_CASE( JSON_BufferedHTTP )
blockable_transport->flush() ;
try {
client.recv_roundTripRPC() ;
- } catch (TTransportException e) {
+ } catch (const TTransportException &e) {
BOOST_ERROR( "we should not get a transport exception -- this means we failed: " + std::string(e.what()) ) ;
}
transport->close();
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index 387207142..0d900d9da 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -726,9 +726,7 @@ void test_read_none_available() {
BOOST_REQUIRE(transports.in != NULL);
BOOST_REQUIRE(transports.out != NULL);
- uint8_t write_buf[16];
uint8_t read_buf[16];
- memset(write_buf, 'a', sizeof(write_buf));
// Attempting to read when no data is available should either block until
// some data is available, or fail immediately. (e.g., TSocket blocks,