Remove warnings (#284)

This commit is contained in:
flagarde 2021-04-20 00:25:06 +08:00 committed by GitHub
parent 3b19b0eeca
commit 0e0a748037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -137,7 +137,7 @@ namespace ix
{ {
contentLength = std::stoi(headers["Content-Length"]); contentLength = std::stoi(headers["Content-Length"]);
} }
catch (std::exception) catch(const std::exception&)
{ {
return std::make_tuple( return std::make_tuple(
false, "Error parsing HTTP Header 'Content-Length'", httpRequest); false, "Error parsing HTTP Header 'Content-Length'", httpRequest);

View File

@ -192,7 +192,8 @@ namespace ix
return ::inet_ntop(af, a0, s, l); return ::inet_ntop(af, a0, s, l);
#endif #endif
} }
#if defined(_WIN32) && defined(__GNUC__)
static int hexval(unsigned c) static int hexval(unsigned c)
{ {
if (c - '0' < 10) return c - '0'; if (c - '0' < 10) return c - '0';
@ -200,6 +201,7 @@ namespace ix
if (c - 'a' < 6) return c - 'a' + 10; if (c - 'a' < 6) return c - 'a' + 10;
return -1; return -1;
} }
#endif
// //
// mingw does not have inet_pton, which were taken as is from the musl C library. // mingw does not have inet_pton, which were taken as is from the musl C library.

View File

@ -191,7 +191,6 @@ namespace ix
// Make sure the OS send buffer is flushed before moving on // Make sure the OS send buffer is flushed before moving on
do do
{ {
size_t bufferedAmount = client->bufferedAmount();
std::chrono::duration<double, std::milli> duration(500); std::chrono::duration<double, std::milli> duration(500);
std::this_thread::sleep_for(duration); std::this_thread::sleep_for(duration);
} while (client->bufferedAmount() != 0); } while (client->bufferedAmount() != 0);