Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: icu52/source/common/ucnv_u8.c

Issue 224943002: icu local change part1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: function indentation changed Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu52/source/common/ucnv_u7.c ('k') | icu52/source/common/ucnvbocu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu52/source/common/ucnv_u8.c
===================================================================
--- icu52/source/common/ucnv_u8.c (revision 259715)
+++ icu52/source/common/ucnv_u8.c (working copy)
@@ -87,6 +87,15 @@
static const uint32_t
utf8_minChar32[7]={ 0, 0, 0x80, 0x800, 0x10000, 0xffffffff, 0xffffffff };
+static UBool hasCESU8Data(const UConverter *cnv)
+{
+#if UCONFIG_NO_NON_HTML5_CONVERSION
+ return FALSE;
+#else
+ return (UBool)(cnv->sharedData == &_CESU8Data);
+#endif
+}
+
static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args,
UErrorCode * err)
{
@@ -96,10 +105,10 @@
const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
const UChar *targetLimit = args->targetLimit;
unsigned char *toUBytes = cnv->toUBytes;
- UBool isCESU8 = (UBool)(cnv->sharedData == &_CESU8Data);
+ UBool isCESU8 = hasCESU8Data(cnv);
uint32_t ch, ch2 = 0;
int32_t i, inBytes;
-
+
/* Restore size of current sequence */
if (cnv->toUnicodeStatus && myTarget < targetLimit)
{
@@ -226,7 +235,7 @@
const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
const UChar *targetLimit = args->targetLimit;
unsigned char *toUBytes = cnv->toUBytes;
- UBool isCESU8 = (UBool)(cnv->sharedData == &_CESU8Data);
+ UBool isCESU8 = hasCESU8Data(cnv);
uint32_t ch, ch2 = 0;
int32_t i, inBytes;
@@ -357,7 +366,7 @@
UChar32 ch;
uint8_t tempBuf[4];
int32_t indexToWrite;
- UBool isNotCESU8 = (UBool)(cnv->sharedData != &_CESU8Data);
+ UBool isNotCESU8 = !hasCESU8Data(cnv);
if (cnv->fromUChar32 && myTarget < targetLimit)
{
@@ -473,7 +482,7 @@
int32_t offsetNum, nextSourceIndex;
int32_t indexToWrite;
uint8_t tempBuf[4];
- UBool isNotCESU8 = (UBool)(cnv->sharedData != &_CESU8Data);
+ UBool isNotCESU8 = !hasCESU8Data(cnv);
if (cnv->fromUChar32 && myTarget < targetLimit)
{
« no previous file with comments | « icu52/source/common/ucnv_u7.c ('k') | icu52/source/common/ucnvbocu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698