Skip to content

Commit 47bc56f

Browse files
authored
Merge pull request #197 from Sebanisu/main
-Werror=sign-conversion on GCC 10.2 and C4702: unreachable code on MSVC 16.9.6
2 parents 2e7c7d0 + 40ff255 commit 47bc56f

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ mtent12.txt
1717
tests/benchmark-range/*
1818
!tests/benchmark-range/*.cpp
1919
!tests/benchmark-range/*.hpp
20-
build
20+
build
21+
cmake-build-*/*
22+
.idea/*

include/ctre/first.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,10 @@ template <size_t Capacity> class point_set {
398398
auto first = begin();
399399
auto last = end();
400400
auto it = first;
401-
size_t count = std::distance(first, last);
402-
while (count > 0) {
401+
auto count = std::distance(first, last);
402+
while (count != 0) {
403403
it = first;
404-
size_t step = count / 2;
404+
auto step = count / 2;
405405
std::advance(it, step);
406406
if (*it < obj) {
407407
first = ++it;

include/ctre/return_type.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ template <size_t Id, typename Name = void> struct captured_content {
9797
} else {
9898
return static_cast<size_t>(std::distance(begin(), end()));
9999
}
100-
#endif
100+
#else
101101
return static_cast<size_t>(std::distance(begin(), end()));
102+
#endif
102103
}
103104

104105
#if __has_include(<charconv>)
@@ -126,8 +127,9 @@ template <size_t Id, typename Name = void> struct captured_content {
126127
} else {
127128
return std::basic_string<char_type>(begin(), end());
128129
}
129-
#endif
130+
#else
130131
return std::basic_string<char_type>(begin(), end());
132+
#endif
131133
}
132134

133135
constexpr CTRE_FORCE_INLINE auto view() const noexcept {

single-header/ctre-unicode.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,8 +3004,9 @@ template <size_t Id, typename Name = void> struct captured_content {
30043004
} else {
30053005
return static_cast<size_t>(std::distance(begin(), end()));
30063006
}
3007-
#endif
3007+
#else
30083008
return static_cast<size_t>(std::distance(begin(), end()));
3009+
#endif
30093010
}
30103011

30113012
#if __has_include(<charconv>)
@@ -3033,8 +3034,9 @@ template <size_t Id, typename Name = void> struct captured_content {
30333034
} else {
30343035
return std::basic_string<char_type>(begin(), end());
30353036
}
3036-
#endif
3037+
#else
30373038
return std::basic_string<char_type>(begin(), end());
3039+
#endif
30383040
}
30393041

30403042
constexpr CTRE_FORCE_INLINE auto view() const noexcept {
@@ -3834,10 +3836,10 @@ template <size_t Capacity> class point_set {
38343836
auto first = begin();
38353837
auto last = end();
38363838
auto it = first;
3837-
size_t count = std::distance(first, last);
3838-
while (count > 0) {
3839+
auto count = std::distance(first, last);
3840+
while (count != 0) {
38393841
it = first;
3840-
size_t step = count / 2;
3842+
auto step = count / 2;
38413843
std::advance(it, step);
38423844
if (*it < obj) {
38433845
first = ++it;

single-header/ctre.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,8 +3001,9 @@ template <size_t Id, typename Name = void> struct captured_content {
30013001
} else {
30023002
return static_cast<size_t>(std::distance(begin(), end()));
30033003
}
3004-
#endif
3004+
#else
30053005
return static_cast<size_t>(std::distance(begin(), end()));
3006+
#endif
30063007
}
30073008

30083009
#if __has_include(<charconv>)
@@ -3030,8 +3031,9 @@ template <size_t Id, typename Name = void> struct captured_content {
30303031
} else {
30313032
return std::basic_string<char_type>(begin(), end());
30323033
}
3033-
#endif
3034+
#else
30343035
return std::basic_string<char_type>(begin(), end());
3036+
#endif
30353037
}
30363038

30373039
constexpr CTRE_FORCE_INLINE auto view() const noexcept {
@@ -3831,10 +3833,10 @@ template <size_t Capacity> class point_set {
38313833
auto first = begin();
38323834
auto last = end();
38333835
auto it = first;
3834-
size_t count = std::distance(first, last);
3835-
while (count > 0) {
3836+
auto count = std::distance(first, last);
3837+
while (count != 0) {
38363838
it = first;
3837-
size_t step = count / 2;
3839+
auto step = count / 2;
38383840
std::advance(it, step);
38393841
if (*it < obj) {
38403842
first = ++it;

0 commit comments

Comments
 (0)