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

Unified Diff: source/common/ucnv.c

Issue 2440913002: Update ICU to 58.1
Patch Set: Created 4 years, 2 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 | « source/common/ucmndata.c ('k') | source/common/ucnv2022.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/ucnv.c
diff --git a/source/common/ucnv.c b/source/common/ucnv.c
index 8d570108ad7b6257c1c166ab619e5df4e1e45a0c..527f86f140b95fde6f915e382d0d54dfe6d097ea 100644
--- a/source/common/ucnv.c
+++ b/source/common/ucnv.c
@@ -1,7 +1,9 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
*
-* Copyright (C) 1998-2015, International Business Machines
+* Copyright (C) 1998-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -1061,7 +1063,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
length=(int32_t)(pArgs->sourceLimit-pArgs->source);
if(length>0) {
- uprv_memcpy(cnv->preFromU, pArgs->source, length*U_SIZEOF_UCHAR);
+ u_memcpy(cnv->preFromU, pArgs->source, length);
cnv->preFromULength=(int8_t)-length;
}
@@ -1817,7 +1819,7 @@ ucnv_toUChars(UConverter *cnv,
{
UChar buffer[1024];
- destLimit=buffer+sizeof(buffer)/U_SIZEOF_UCHAR;
+ destLimit=buffer+UPRV_LENGTHOF(buffer);
do {
dest=buffer;
*pErrorCode=U_ZERO_ERROR;
@@ -2646,7 +2648,7 @@ static const UAmbiguousConverter *ucnv_getAmbiguous(const UConverter *cnv)
return NULL;
}
- for(i=0; i<(int32_t)(sizeof(ambiguousConverters)/sizeof(UAmbiguousConverter)); ++i)
+ for(i=0; i<UPRV_LENGTHOF(ambiguousConverters); ++i)
{
if(0==uprv_strcmp(name, ambiguousConverters[i].name))
{
@@ -2743,7 +2745,7 @@ ucnv_getInvalidUChars (const UConverter * converter,
}
if ((*len = converter->invalidUCharLength) > 0)
{
- uprv_memcpy (errChars, converter->invalidUCharBuffer, sizeof(UChar) * (*len));
+ u_memcpy (errChars, converter->invalidUCharBuffer, *len);
}
}
« no previous file with comments | « source/common/ucmndata.c ('k') | source/common/ucnv2022.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698