Skip to content

Commit

Permalink
Fix various warnings reported by gcc 9.3, and possibly earlier versio…
Browse files Browse the repository at this point in the history
…ns (microsoft#1289)

Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored and BillyONeal committed Dec 19, 2019
1 parent 53dcf8b commit 96e7d20
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Release/include/cpprest/details/SafeInt3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6022,6 +6022,8 @@ class SafeInt
m_int = (T)(b ? 1 : 0);
}

constexpr SafeInt(const SafeInt<T, E>& u) SAFEINT_CPP_THROW = default;

template<typename U>
SafeInt(const SafeInt<U, E>& u) SAFEINT_CPP_THROW
{
Expand Down
2 changes: 1 addition & 1 deletion Release/include/cpprest/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ class array
msl::safeint3::SafeInt<size_type> nMinSize(index);
nMinSize += 1;
msl::safeint3::SafeInt<size_type> nlastSize(m_elements.size());
if (nlastSize < nMinSize) m_elements.resize(nMinSize);
if (nlastSize < nMinSize) m_elements.resize((size_type)nMinSize);

return m_elements[index];
}
Expand Down
2 changes: 1 addition & 1 deletion Release/src/json/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ bool web::json::number::is_int32() const
case signed_type:
return m_intval >= (std::numeric_limits<int32_t>::min)() &&
m_intval <= (std::numeric_limits<int32_t>::max)();
case unsigned_type: return m_uintval <= (std::numeric_limits<int32_t>::max)();
case unsigned_type: return m_uintval <= (uint32_t)(std::numeric_limits<int32_t>::max)();
case double_type:
default: return false;
}
Expand Down
5 changes: 2 additions & 3 deletions Release/tests/common/TestRunner/test_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,16 +557,15 @@ int main(int argc, char* argv[])
breakOnError = true;
}

// Determine if list or listProperties.
bool listOption = false, listPropertiesOption = false;
// The list_test_options() function determines if list or listProperties.
bool listOption = false;
if (UnitTest::GlobalSettings::Has("list"))
{
listOption = true;
}
if (UnitTest::GlobalSettings::Has("listproperties"))
{
listOption = true;
listPropertiesOption = true;
}
#ifdef _WIN32
if (UnitTest::GlobalSettings::Has("detectleaks"))
Expand Down
8 changes: 4 additions & 4 deletions Release/tests/functional/http/client/compression_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ SUITE(compression_tests)
std::vector<uint8_t> cmp_buffer(buffer_size);
size_t cmpsize = buffer_size;
size_t csize = 0;
operation_result r = {0};
operation_result r = {};
operation_hint hint = operation_hint::has_more;
for (i = 0; i < buffer_size || csize == cmpsize || !r.done; i += r.input_bytes_processed)
{
Expand Down Expand Up @@ -361,9 +361,9 @@ SUITE(compression_tests)
if (!cfactory)
{
auto size = tuples[i][0];
compress_and_decompress(utility::details::make_unique<fake_provider>(tuples[i][0]),
utility::details::make_unique<fake_provider>(tuples[i][0]),
tuples[i][0],
compress_and_decompress(utility::details::make_unique<fake_provider>(size),
utility::details::make_unique<fake_provider>(size),
size,
tuples[i][1],
!!j);
}
Expand Down

0 comments on commit 96e7d20

Please sign in to comment.