From ef74f8eb5552b625a39ad8b190b1c4fe8617d51c Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 14 Jun 2020 01:10:37 +0200 Subject: [PATCH] Fix other warnings about conversion but in C++ --- m-string.h | 6 +++--- m-tuple.h | 2 +- m-variant.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/m-string.h b/m-string.h index b0ad33ae..73baa8ca 100644 --- a/m-string.h +++ b/m-string.h @@ -1323,7 +1323,7 @@ stringi_utf8_decode(char c, stringi_utf8_state_e *state, const string_unicode_t mask1 = -(string_unicode_t)(*state != STRINGI_UTF8_STARTING); const string_unicode_t mask2 = (0xFFU >> type); *unicode = ((*unicode << 6) & mask1) | ((unsigned int) c & mask2); - *state = (stringi_utf8_state_e) STRINGI_UTF8_STATE_TAB[*state + type]; + *state = (stringi_utf8_state_e) STRINGI_UTF8_STATE_TAB[(unsigned int) *state + type]; } /* Check if the given array of characters is a valid UTF8 stream */ @@ -1579,7 +1579,7 @@ string_utf8_p(string_t str) .ptr = ((struct { long long _n; char _d[sizeof (s)]; }){ 0, s })._d }}) #else namespace m_string { - template + template struct m_aligned_string { string_t string; union { @@ -2102,7 +2102,7 @@ namespace m_string { ((const struct M_C(name, _s) *)((M_C(name, _array_t)){string})) #else namespace m_string { - template + template struct m_bounded_string { char s[N]; inline m_bounded_string(const char lstr[]) diff --git a/m-tuple.h b/m-tuple.h index f7e010c6..0ae78c6a 100644 --- a/m-tuple.h +++ b/m-tuple.h @@ -55,7 +55,7 @@ #else #include namespace m_tuple { - template + template struct m_int_array { int data[N]; /*constexpr*/ inline m_int_array(std::initializer_list init){ diff --git a/m-variant.h b/m-variant.h index 76ba0138..053ab866 100644 --- a/m-variant.h +++ b/m-variant.h @@ -370,7 +370,7 @@ static inline size_t M_C(name, _hash)(M_C(name,_t) const e1) { \ VARIANTI_CONTRACT(name, e1); \ M_HASH_DECL(hash); \ - M_HASH_UP (hash, e1 -> type); \ + M_HASH_UP (hash, (unsigned int) (e1 -> type)); \ switch (e1->type) { \ case M_C(name, _EMPTY): break; \ M_MAP2(VARIANTI_DEFINE_HASH_FUNC , name, __VA_ARGS__) \