From 0e0a748037bc8766f0616b4d52a938ed447633c7 Mon Sep 17 00:00:00 2001 From: flagarde Date: Tue, 20 Apr 2021 00:25:06 +0800 Subject: [PATCH] Remove warnings (#284) --- ixwebsocket/IXHttp.cpp | 2 +- ixwebsocket/IXNetSystem.cpp | 4 +++- ixwebsocket/IXWebSocketServer.cpp | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ixwebsocket/IXHttp.cpp b/ixwebsocket/IXHttp.cpp index c6b43521..46212cf2 100644 --- a/ixwebsocket/IXHttp.cpp +++ b/ixwebsocket/IXHttp.cpp @@ -137,7 +137,7 @@ namespace ix { contentLength = std::stoi(headers["Content-Length"]); } - catch (std::exception) + catch(const std::exception&) { return std::make_tuple( false, "Error parsing HTTP Header 'Content-Length'", httpRequest); diff --git a/ixwebsocket/IXNetSystem.cpp b/ixwebsocket/IXNetSystem.cpp index 6aec0b2f..c6510510 100644 --- a/ixwebsocket/IXNetSystem.cpp +++ b/ixwebsocket/IXNetSystem.cpp @@ -192,7 +192,8 @@ namespace ix return ::inet_ntop(af, a0, s, l); #endif } - + +#if defined(_WIN32) && defined(__GNUC__) static int hexval(unsigned c) { if (c - '0' < 10) return c - '0'; @@ -200,6 +201,7 @@ namespace ix if (c - 'a' < 6) return c - 'a' + 10; return -1; } +#endif // // mingw does not have inet_pton, which were taken as is from the musl C library. diff --git a/ixwebsocket/IXWebSocketServer.cpp b/ixwebsocket/IXWebSocketServer.cpp index 7a9d4ea4..8a18f9d0 100644 --- a/ixwebsocket/IXWebSocketServer.cpp +++ b/ixwebsocket/IXWebSocketServer.cpp @@ -191,7 +191,6 @@ namespace ix // Make sure the OS send buffer is flushed before moving on do { - size_t bufferedAmount = client->bufferedAmount(); std::chrono::duration duration(500); std::this_thread::sleep_for(duration); } while (client->bufferedAmount() != 0);