From 58ab95c963ddd9005ddfacf870c97ff27211c911 Mon Sep 17 00:00:00 2001 From: ntrifunovic Date: Tue, 28 Jul 2009 00:31:03 +0000 Subject: [PATCH] Fix for the bug ID: 2823847: warnings from GCC 4.3 git-svn-id: http://svn.code.sf.net/p/utfcpp/code@95 a809a056-fc17-0410-9590-b4f493f8b08e --- source/utf8/checked.h | 6 +++--- source/utf8/unchecked.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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;