summaryrefslogtreecommitdiffhomepage
path: root/include/unicode.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/unicode.h')
-rw-r--r--include/unicode.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/unicode.h b/include/unicode.h
index 34812df..feb012a 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -235,8 +235,7 @@ namespace unicode {
});
accu = 0;
bytes_in_accu = 0;
- } else
- if ((accu & 0x80) == 0) { // 1 byte sequence
+ } else if ((accu & 0x80) == 0) { // 1 byte sequence
append_utf<7>(result, static_cast<char32_t>(accu & 0x7F));
accu >>= 8;
bytes_in_accu -= 1;
@@ -307,7 +306,7 @@ namespace unicode {
while (s_index < s_size || bytes_in_accu > 0) {
while (s_index < s_size && bytes_in_accu < 8) {
- accu |= static_cast<uint64_t>(*reinterpret_cast<const typename From::value_type*>(&(s.data()[s_index]))) << (bytes_in_accu * 8);
+ accu |= static_cast<uint64_t>(*reinterpret_cast<const uint8_t*>(&(s.data()[s_index]))) << (bytes_in_accu * 8);
++s_index;
bytes_in_accu += sizeof(typename From::value_type);
}