Skip to content

Commit 3404a39

Browse files
committed
Fixing up a couple of warnings.
1 parent b16484c commit 3404a39

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Release/include/cpprest/web_utilities.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ class credentials
9494
/// <param name="username">User name as a string.</param>
9595
/// <param name="password">Password as a string.</param>
9696
credentials(utility::string_t username, const utility::string_t &password) :
97-
m_username(std::move(username)),
98-
m_password(password)
97+
m_username(std::move(username))
98+
#if defined(_MS_WINDOWS)
99+
, m_password(password)
100+
#endif
99101
{}
100102

101103
/// <summary>

Release/src/http/client/http_win7.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,10 @@ class winhttp_client : public _http_client_communicator
858858
_In_ winhttp_request_context * p_request_context,
859859
_In_ DWORD error = 0)
860860
{
861-
http_response & response = p_request_context->m_response;
862861
http_request & request = p_request_context->m_request;
863862

864-
_ASSERTE(response.status_code() == status_codes::Unauthorized || response.status_code() == status_codes::ProxyAuthRequired
863+
_ASSERTE(p_request_context->m_response.status_code() == status_codes::Unauthorized
864+
|| p_request_context->m_response.status_code() == status_codes::ProxyAuthRequired
865865
|| error == ERROR_WINHTTP_RESEND_REQUEST);
866866

867867
// Check if the saved read position is valid

Release/src/utilities/web_utilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ win32_encryption::win32_encryption(const std::wstring &data) :
105105
{
106106
m_buffer.resize(m_buffer.size() + CRYPTPROTECTMEMORY_BLOCK_SIZE - mod);
107107
}
108-
if (!CryptProtectMemory(m_buffer.data(), m_buffer.size(), CRYPTPROTECTMEMORY_SAME_PROCESS))
108+
if (!CryptProtectMemory(m_buffer.data(), static_cast<DWORD>(m_buffer.size()), CRYPTPROTECTMEMORY_SAME_PROCESS))
109109
{
110110
throw ::utility::details::create_system_error(GetLastError());
111111
}
@@ -122,7 +122,7 @@ plaintext_string win32_encryption::decrypt() const
122122
auto data = plaintext_string(new std::wstring(reinterpret_cast<const std::wstring::value_type *>(m_buffer.data()), m_buffer.size() / 2));
123123
if (!CryptUnprotectMemory(
124124
const_cast<std::wstring::value_type *>(data->c_str()),
125-
m_buffer.size(),
125+
static_cast<DWORD>(m_buffer.size()),
126126
CRYPTPROTECTMEMORY_SAME_PROCESS))
127127
{
128128
throw ::utility::details::create_system_error(GetLastError());

0 commit comments

Comments
 (0)