diff --git a/source/utf8/checked.h b/source/utf8/checked.h index 88fe73e..16bab4d 100644 --- a/source/utf8/checked.h +++ b/source/utf8/checked.h @@ -117,13 +117,13 @@ namespace utf8 } else if (cp < 0x10000) { // three octets *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } else if (cp <= internal::CODE_POINT_MAX) { // four octets *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast((cp >> 12)& 0x3f | 0x80); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); + *(result++) = static_cast(((cp >> 12) & 0x3f) | 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } else diff --git a/source/utf8/unchecked.h b/source/utf8/unchecked.h index 4009ceb..84207a5 100644 --- a/source/utf8/unchecked.h +++ b/source/utf8/unchecked.h @@ -45,13 +45,13 @@ namespace utf8 } else if (cp < 0x10000) { // three octets *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } else { // four octets *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast((cp >> 12)& 0x3f | 0x80); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); + *(result++) = static_cast(((cp >> 12) & 0x3f)| 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } return result;