diff --git a/Release/include/cpprest/producerconsumerstream.h b/Release/include/cpprest/producerconsumerstream.h index bbdb2c1c85..28463372e4 100644 --- a/Release/include/cpprest/producerconsumerstream.h +++ b/Release/include/cpprest/producerconsumerstream.h @@ -47,6 +47,7 @@ class basic_producer_consumer_buffer : public streams::details::streambuf_state_ /// basic_producer_consumer_buffer(size_t alloc_size) : streambuf_state_manager<_CharType>(std::ios_base::out | std::ios_base::in) + , m_mode(std::ios_base::in) , m_alloc_size(alloc_size) , m_allocBlock(nullptr) , m_total(0) diff --git a/Release/src/http/listener/http_server_api.cpp b/Release/src/http/listener/http_server_api.cpp index 8c50353783..ea985f4a0a 100644 --- a/Release/src/http/listener/http_server_api.cpp +++ b/Release/src/http/listener/http_server_api.cpp @@ -50,7 +50,7 @@ void http_server_api::unregister_server_api() throw http_exception(_XPLATSTR("Server API was cleared while listeners were still attached")); } - s_server_api.release(); + s_server_api.reset(); } void http_server_api::unsafe_register_server_api(std::unique_ptr server_api) diff --git a/Release/src/http/listener/http_server_httpsys.cpp b/Release/src/http/listener/http_server_httpsys.cpp index 318d1404c0..2eac0baf11 100644 --- a/Release/src/http/listener/http_server_httpsys.cpp +++ b/Release/src/http/listener/http_server_httpsys.cpp @@ -32,7 +32,7 @@ using namespace http::details; using namespace http::experimental::listener; using namespace http::experimental::details; -#define CHUNK_SIZE 64 * 1024 +#define CHUNK_SIZE (64 * 1024) namespace web { diff --git a/Release/src/pch/stdafx.h b/Release/src/pch/stdafx.h index 2061bea7f6..5c398e14c4 100644 --- a/Release/src/pch/stdafx.h +++ b/Release/src/pch/stdafx.h @@ -40,7 +40,7 @@ // Windows Header Files: #ifndef __cplusplus_winrt #include -#endif !__cplusplus_winrt +#endif // !__cplusplus_winrt #else // LINUX or APPLE #define __STDC_LIMIT_MACROS diff --git a/Release/src/streams/fileio_win32.cpp b/Release/src/streams/fileio_win32.cpp index 97cd6e5e6d..057dd9b670 100644 --- a/Release/src/streams/fileio_win32.cpp +++ b/Release/src/streams/fileio_win32.cpp @@ -111,7 +111,7 @@ void CALLBACK IoCompletionCallback(PTP_CALLBACK_INSTANCE instance, EXTENDED_OVERLAPPED* pExtOverlapped = static_cast(pOverlapped); pExtOverlapped->func(result, static_cast(numberOfBytesTransferred), static_cast(pOverlapped)); - delete pOverlapped; + delete pExtOverlapped; } #endif @@ -399,10 +399,10 @@ size_t _write_file_async(_In_ streams::details::_file_info_impl* fInfo, size_t result = static_cast(-1); - if (wrResult == TRUE) + if (wrResult) { // If WriteFile returned true, it must be because the operation completed immediately. - // However, we didn't pass in an address for the number of bytes written, so + // However, we didn't pass in an address for the number of bytes written, so // we have to retrieve it using 'GetOverlappedResult,' which may, in turn, fail. DWORD written = 0; result = GetOverlappedResult(fInfo->m_handle, pOverlapped.get(), &written, FALSE) ? static_cast(written) @@ -496,7 +496,7 @@ size_t _read_file_async(_In_ streams::details::_file_info_impl* fInfo, size_t result = static_cast(-1); - if (wrResult == TRUE) + if (wrResult) { // If ReadFile returned true, it must be because the operation completed immediately. // However, we didn't pass in an address for the number of bytes written, so @@ -941,7 +941,7 @@ utility::size64_t __cdecl _get_size(_In_ concurrency::streams::details::_file_in LARGE_INTEGER size; - if (GetFileSizeEx(fInfo->m_handle, &size) == TRUE) + if (GetFileSizeEx(fInfo->m_handle, &size)) return utility::size64_t(size.QuadPart / char_size); else return 0; diff --git a/Release/src/utilities/asyncrt_utils.cpp b/Release/src/utilities/asyncrt_utils.cpp index 62cce9e8fb..16d7e687b9 100644 --- a/Release/src/utilities/asyncrt_utils.cpp +++ b/Release/src/utilities/asyncrt_utils.cpp @@ -1148,7 +1148,7 @@ datetime __cdecl datetime::from_string(const utility::string_t& dateString, date { tzHours = 8; } - else if ((tzCh == _XPLATSTR('+') || tzCh == _XPLATSTR('-')) && ascii_isdigit2(str[1]) && + else if ((str[0] == _XPLATSTR('+') || str[0] == _XPLATSTR('-')) && ascii_isdigit2(str[1]) && ascii_isdigit(str[2]) && ascii_isdigit5(str[3]) && ascii_isdigit(str[4])) { tzCh = str[0]; diff --git a/Release/tests/functional/utils/datetime.cpp b/Release/tests/functional/utils/datetime.cpp index 33d532a098..aac5b16714 100644 --- a/Release/tests/functional/utils/datetime.cpp +++ b/Release/tests/functional/utils/datetime.cpp @@ -304,7 +304,8 @@ SUITE(datetime) _XPLATSTR("01 Jan 1971 00:00:61 GMT"), _XPLATSTR("01 Jan 1899 00:00:00 GMT"), // underflow _XPLATSTR("01 Jan 1969 00:00:00 CEST"), // bad tz - _XPLATSTR("01 Jan 1970 00:00:00 +2400"), // bad tzoffsets + _XPLATSTR("14 Jan 2019 23:16:21 G0100"), // bad tzoffsets + _XPLATSTR("01 Jan 1970 00:00:00 +2400"), _XPLATSTR("01 Jan 1970 00:00:00 -3000"), _XPLATSTR("01 Jan 1970 00:00:00 +2160"), _XPLATSTR("01 Jan 1970 00:00:00 -2400"),