Skip to content

Commit 96e7d20

Browse files
ghallidayBillyONeal
authored andcommitted
Fix various warnings reported by gcc 9.3, and possibly earlier versions (microsoft#1289)
Signed-off-by: Gavin Halliday <[email protected]>
1 parent 53dcf8b commit 96e7d20

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

Release/include/cpprest/details/SafeInt3.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -6022,6 +6022,8 @@ class SafeInt
60226022
m_int = (T)(b ? 1 : 0);
60236023
}
60246024

6025+
constexpr SafeInt(const SafeInt<T, E>& u) SAFEINT_CPP_THROW = default;
6026+
60256027
template<typename U>
60266028
SafeInt(const SafeInt<U, E>& u) SAFEINT_CPP_THROW
60276029
{

Release/include/cpprest/json.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ class array
918918
msl::safeint3::SafeInt<size_type> nMinSize(index);
919919
nMinSize += 1;
920920
msl::safeint3::SafeInt<size_type> nlastSize(m_elements.size());
921-
if (nlastSize < nMinSize) m_elements.resize(nMinSize);
921+
if (nlastSize < nMinSize) m_elements.resize((size_type)nMinSize);
922922

923923
return m_elements[index];
924924
}

Release/src/json/json.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ bool web::json::number::is_int32() const
288288
case signed_type:
289289
return m_intval >= (std::numeric_limits<int32_t>::min)() &&
290290
m_intval <= (std::numeric_limits<int32_t>::max)();
291-
case unsigned_type: return m_uintval <= (std::numeric_limits<int32_t>::max)();
291+
case unsigned_type: return m_uintval <= (uint32_t)(std::numeric_limits<int32_t>::max)();
292292
case double_type:
293293
default: return false;
294294
}

Release/tests/common/TestRunner/test_runner.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -557,16 +557,15 @@ int main(int argc, char* argv[])
557557
breakOnError = true;
558558
}
559559

560-
// Determine if list or listProperties.
561-
bool listOption = false, listPropertiesOption = false;
560+
// The list_test_options() function determines if list or listProperties.
561+
bool listOption = false;
562562
if (UnitTest::GlobalSettings::Has("list"))
563563
{
564564
listOption = true;
565565
}
566566
if (UnitTest::GlobalSettings::Has("listproperties"))
567567
{
568568
listOption = true;
569-
listPropertiesOption = true;
570569
}
571570
#ifdef _WIN32
572571
if (UnitTest::GlobalSettings::Has("detectleaks"))

Release/tests/functional/http/client/compression_tests.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ SUITE(compression_tests)
206206
std::vector<uint8_t> cmp_buffer(buffer_size);
207207
size_t cmpsize = buffer_size;
208208
size_t csize = 0;
209-
operation_result r = {0};
209+
operation_result r = {};
210210
operation_hint hint = operation_hint::has_more;
211211
for (i = 0; i < buffer_size || csize == cmpsize || !r.done; i += r.input_bytes_processed)
212212
{
@@ -361,9 +361,9 @@ SUITE(compression_tests)
361361
if (!cfactory)
362362
{
363363
auto size = tuples[i][0];
364-
compress_and_decompress(utility::details::make_unique<fake_provider>(tuples[i][0]),
365-
utility::details::make_unique<fake_provider>(tuples[i][0]),
366-
tuples[i][0],
364+
compress_and_decompress(utility::details::make_unique<fake_provider>(size),
365+
utility::details::make_unique<fake_provider>(size),
366+
size,
367367
tuples[i][1],
368368
!!j);
369369
}

0 commit comments

Comments
 (0)