@@ -212,7 +212,7 @@ HTTPResponse RequestModule::sendHTTP(std::string path, std::string data) {
212212 size_t scheme_offset = impl->use_https ? (sizeof (" https://" ) - 1 ) : (sizeof (" http://" ) - 1 );
213213 size_t buffer_size = MultiByteToWideChar (CP_ACP, 0 , impl->_configuration ->serverUrl .c_str () + scheme_offset, -1 , nullptr , 0 );
214214 wchar_t *wide_hostname = new wchar_t [buffer_size];
215- MultiByteToWideChar (CP_ACP, 0 , impl->_configuration ->serverUrl .c_str () + scheme_offset, -1 , wide_hostname, buffer_size);
215+ MultiByteToWideChar (CP_ACP, 0 , impl->_configuration ->serverUrl .c_str () + scheme_offset, -1 , wide_hostname, static_cast < int >( buffer_size) );
216216
217217 hConnect = WinHttpConnect (hSession, wide_hostname, impl->_configuration ->port , 0 );
218218
@@ -227,7 +227,7 @@ HTTPResponse RequestModule::sendHTTP(std::string path, std::string data) {
227227
228228 size_t buffer_size = MultiByteToWideChar (CP_ACP, 0 , path.c_str (), -1 , nullptr , 0 );
229229 wchar_t *wide_path = new wchar_t [buffer_size];
230- MultiByteToWideChar (CP_ACP, 0 , path.c_str (), -1 , wide_path, buffer_size);
230+ MultiByteToWideChar (CP_ACP, 0 , path.c_str (), -1 , wide_path, static_cast < int >( buffer_size) );
231231
232232 hRequest = WinHttpOpenRequest (hConnect, use_post ? L" POST" : L" GET" , wide_path, NULL , WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, impl->use_https ? WINHTTP_FLAG_SECURE : 0 );
233233 delete[] wide_path;
@@ -240,7 +240,7 @@ HTTPResponse RequestModule::sendHTTP(std::string path, std::string data) {
240240 ok = WinHttpReceiveResponse (hRequest, NULL );
241241 if (ok) {
242242 DWORD dwStatusCode = 0 ;
243- DWORD dwSize = sizeof (dwStatusCode);
243+ DWORD dwSize = static_cast <DWORD>( sizeof (dwStatusCode) );
244244 WinHttpQueryHeaders (hRequest, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, WINHTTP_HEADER_NAME_BY_INDEX, &dwStatusCode, &dwSize, WINHTTP_NO_HEADER_INDEX);
245245 response.success = (dwStatusCode >= 200 && dwStatusCode < 300 );
246246 if (response.success ) {
0 commit comments