@@ -240,7 +240,6 @@ Software.
240
240
#include <cstddef>
241
241
#include <string_view>
242
242
#include <cstdint>
243
- #include <memory>
244
243
245
244
namespace ctll {
246
245
@@ -368,7 +367,7 @@ template <size_t N> struct fixed_string {
368
367
real_size = out;
369
368
} else if constexpr (std::is_same_v<T, wchar_t> || std::is_same_v<T, char32_t>) {
370
369
for (size_t i{0}; i < N; ++i) {
371
- content[i] = input[i];
370
+ content[i] = static_cast<char32_t>( input[i]) ;
372
371
if ((i == (N-1)) && (input[i] == 0)) break;
373
372
real_size++;
374
373
}
@@ -1670,7 +1669,7 @@ template <auto Name, auto Value> struct property;
1670
1669
// unicode TS#18 level 1.2 general_category
1671
1670
template <uni::detail::binary_prop Property> struct binary_property<Property> {
1672
1671
template <typename CharT> inline static constexpr bool match_char(CharT c) noexcept {
1673
- return uni::detail::get_binary_prop<Property>(c );
1672
+ return uni::detail::get_binary_prop<Property>(static_cast<char32_t>(c) );
1674
1673
}
1675
1674
};
1676
1675
@@ -2870,7 +2869,7 @@ struct utf8_iterator {
2870
2869
// remove utf8 front bits, get only significant part
2871
2870
// and add first trailing unit
2872
2871
2873
- char32_t result = ((ptr[0] & mask) << 6 ) | (ptr[1] & 0b0011'1111u);
2872
+ char32_t result = static_cast<char32_t> ((ptr[0] & mask) << 6u ) | (ptr[1] & 0b0011'1111u);
2874
2873
2875
2874
// add rest of trailing units
2876
2875
if (length == 1) CTRE_LIKELY {
@@ -2979,19 +2978,11 @@ template <size_t Id, typename Name = void> struct captured_content {
2979
2978
if constexpr (std::is_same_v<Iterator, utf8_iterator>) {
2980
2979
return _begin.ptr;
2981
2980
} else {
2982
- #if __cpp_lib_to_address >= 201711L
2983
- return std::to_address(_begin);
2984
- #else
2985
2981
return &*_begin;
2986
- #endif
2987
2982
}
2988
2983
#else
2989
- #if __cpp_lib_to_address >= 201711L
2990
- return std::to_address(_begin);
2991
- #else
2992
2984
return &*_begin;
2993
2985
#endif
2994
- #endif
2995
2986
}
2996
2987
2997
2988
constexpr CTRE_FORCE_INLINE const auto * data() const noexcept {
@@ -5588,7 +5579,7 @@ struct bool_trie {
5588
5579
}
5589
5580
}
5590
5581
5591
- std::size_t i5 = (child << 6) + ((c >> 6) & 0x3f);
5582
+ std::size_t i5 = static_cast<std::size_t> (child << 6) + ((c >> 6) & 0x3f);
5592
5583
auto leaf = 0;
5593
5584
if constexpr(r5_s > 0) {
5594
5585
if(i5 >= r5_t_f && i5 < r5_t_f + r5_s) {
@@ -5696,7 +5687,7 @@ struct string_with_idx { const char* name; uint32_t value; };
5696
5687
namespace uni {
5697
5688
5698
5689
constexpr double numeric_value::value() const {
5699
- return numerator() / double(_d);
5690
+ return static_cast<double>( numerator()) / static_cast< double> (_d);
5700
5691
}
5701
5692
5702
5693
constexpr long long numeric_value::numerator() const {
@@ -12648,7 +12639,7 @@ constexpr numeric_value cp_numeric_value(char32_t cp) {
12648
12639
}())) {
12649
12640
return {};
12650
12641
}
12651
- uint16_t d = 1;
12642
+ int16_t d = 1;
12652
12643
detail::get_numeric_value(cp, detail::tables::numeric_data_d, d);
12653
12644
return numeric_value(res, d);
12654
12645
}
0 commit comments