From adbb9f81b2b60f06c04d2fa08813e55150cbe06f Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Fri, 5 Apr 2024 12:04:11 +0530 Subject: [PATCH] Fix Windows compilation warnings (#9) Signed-off-by: Darshan Sen --- src/win32/http.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/win32/http.cc b/src/win32/http.cc index ae70bef..13211f8 100644 --- a/src/win32/http.cc +++ b/src/win32/http.cc @@ -59,7 +59,8 @@ class URL { urlComp_.dwUrlPathLength = (DWORD)-1; urlComp_.dwExtraInfoLength = (DWORD)-1; - if (WinHttpCrackUrl(url_.c_str(), url_.length(), 0, &urlComp_) == FALSE) { + if (WinHttpCrackUrl(url_.c_str(), static_cast(url_.length()), 0, + &urlComp_) == FALSE) { DWORD err = GetLastError(); callback("WinHttpCrackUrl Error: " + error_message(err)); return; @@ -304,7 +305,7 @@ class HTTPClient { callback_("WinHttpQueryHeaders Error: " + error_message(err)); return; } - status_ = dwStatusCode; + status_ = static_cast(dwStatusCode); } auto capture_headers() -> void { @@ -391,8 +392,8 @@ class HTTPClient { body_ << data; } - static auto WinHttpStatusCallback(HINTERNET hInternet, DWORD_PTR dwContext, - DWORD dwInternetStatus, + static auto WinHttpStatusCallback(HINTERNET /* hInternet */, + DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) -> void { assert(dwContext);