@@ -240,7 +240,6 @@ Software.
240240#include <cstddef>
241241#include <string_view>
242242#include <cstdint>
243- #include <memory>
244243
245244namespace ctll {
246245
@@ -368,7 +367,7 @@ template <size_t N> struct fixed_string {
368367 real_size = out;
369368 } else if constexpr (std::is_same_v<T, wchar_t> || std::is_same_v<T, char32_t>) {
370369 for (size_t i{0}; i < N; ++i) {
371- content[i] = input[i];
370+ content[i] = static_cast<char32_t>( input[i]) ;
372371 if ((i == (N-1)) && (input[i] == 0)) break;
373372 real_size++;
374373 }
@@ -1670,7 +1669,7 @@ template <auto Name, auto Value> struct property;
16701669// unicode TS#18 level 1.2 general_category
16711670template <uni::detail::binary_prop Property> struct binary_property<Property> {
16721671 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) );
16741673 }
16751674};
16761675
@@ -2870,7 +2869,7 @@ struct utf8_iterator {
28702869 // remove utf8 front bits, get only significant part
28712870 // and add first trailing unit
28722871
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);
28742873
28752874 // add rest of trailing units
28762875 if (length == 1) CTRE_LIKELY {
@@ -2979,19 +2978,11 @@ template <size_t Id, typename Name = void> struct captured_content {
29792978 if constexpr (std::is_same_v<Iterator, utf8_iterator>) {
29802979 return _begin.ptr;
29812980 } else {
2982- #if __cpp_lib_to_address >= 201711L
2983- return std::to_address(_begin);
2984- #else
29852981 return &*_begin;
2986- #endif
29872982 }
29882983 #else
2989- #if __cpp_lib_to_address >= 201711L
2990- return std::to_address(_begin);
2991- #else
29922984 return &*_begin;
29932985 #endif
2994- #endif
29952986 }
29962987
29972988 constexpr CTRE_FORCE_INLINE const auto * data() const noexcept {
@@ -5588,7 +5579,7 @@ struct bool_trie {
55885579 }
55895580 }
55905581
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);
55925583 auto leaf = 0;
55935584 if constexpr(r5_s > 0) {
55945585 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; };
56965687namespace uni {
56975688
56985689constexpr double numeric_value::value() const {
5699- return numerator() / double(_d);
5690+ return static_cast<double>( numerator()) / static_cast< double> (_d);
57005691}
57015692
57025693constexpr long long numeric_value::numerator() const {
@@ -12648,7 +12639,7 @@ constexpr numeric_value cp_numeric_value(char32_t cp) {
1264812639 }())) {
1264912640 return {};
1265012641 }
12651- uint16_t d = 1;
12642+ int16_t d = 1;
1265212643 detail::get_numeric_value(cp, detail::tables::numeric_data_d, d);
1265312644 return numeric_value(res, d);
1265412645}
0 commit comments