From 11099a22ec864fe135c803058cfecc030946462c Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Mon, 11 Sep 2023 16:17:41 +1000 Subject: [PATCH 1/2] pdqsort: Resolve MS compiler warnings about assigning size_t to unsigned char --- include/boost/sort/pdqsort/pdqsort.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/sort/pdqsort/pdqsort.hpp b/include/boost/sort/pdqsort/pdqsort.hpp index 8352e39..4a936d3 100644 --- a/include/boost/sort/pdqsort/pdqsort.hpp +++ b/include/boost/sort/pdqsort/pdqsort.hpp @@ -232,7 +232,7 @@ namespace pdqsort_detail { // Fill the offset blocks. if (left_split >= block_size) { - for (size_t i = 0; i < block_size;) { + for (unsigned char i = 0; i < static_cast(block_size);) { offsets_l[num_l] = i++; num_l += !comp(*first, pivot); ++first; offsets_l[num_l] = i++; num_l += !comp(*first, pivot); ++first; offsets_l[num_l] = i++; num_l += !comp(*first, pivot); ++first; @@ -249,7 +249,7 @@ namespace pdqsort_detail { } if (right_split >= block_size) { - for (size_t i = 0; i < block_size;) { + for (unsigned char i = 0; i < static_cast(block_size);) { offsets_r[num_r] = ++i; num_r += comp(*--last, pivot); offsets_r[num_r] = ++i; num_r += comp(*--last, pivot); offsets_r[num_r] = ++i; num_r += comp(*--last, pivot); @@ -260,7 +260,7 @@ namespace pdqsort_detail { offsets_r[num_r] = ++i; num_r += comp(*--last, pivot); } } else { - for (size_t i = 0; i < right_split;) { + for (unsigned char i = 0; i < static_cast(right_split);) { offsets_r[num_r] = ++i; num_r += comp(*--last, pivot); } } From 5daa1d4f2471c6cb0f8a48ac5f2fe94b6216a377 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Mon, 11 Sep 2023 16:43:34 +1000 Subject: [PATCH 2/2] pdqsort: Resolve MS compiler warnings about assigning size_t to unsigned char --- include/boost/sort/pdqsort/pdqsort.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/sort/pdqsort/pdqsort.hpp b/include/boost/sort/pdqsort/pdqsort.hpp index 4a936d3..fd447ce 100644 --- a/include/boost/sort/pdqsort/pdqsort.hpp +++ b/include/boost/sort/pdqsort/pdqsort.hpp @@ -243,7 +243,7 @@ namespace pdqsort_detail { offsets_l[num_l] = i++; num_l += !comp(*first, pivot); ++first; } } else { - for (size_t i = 0; i < left_split;) { + for (unsigned char i = 0; i < static_cast(left_split);) { offsets_l[num_l] = i++; num_l += !comp(*first, pivot); ++first; } }