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

Unified Diff: source/common/uidna.cpp

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/uhash_us.cpp ('k') | source/common/uinit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/uidna.cpp
diff --git a/source/common/uidna.cpp b/source/common/uidna.cpp
index c9ab8026258c5b1e81a397600f97f58aed81744d..e01c9aea603c6607414802c8165099985569d793 100644
--- a/source/common/uidna.cpp
+++ b/source/common/uidna.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
@@ -316,7 +318,7 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
// Step 4: if the source is ASCII then proceed to step 8
if(srcIsASCII){
if(b1Len <= destCapacity){
- uprv_memmove(dest, b1, b1Len * U_SIZEOF_UCHAR);
+ u_memmove(dest, b1, b1Len);
reqLength = b1Len;
}else{
reqLength = b1Len;
@@ -362,9 +364,9 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
goto CLEANUP;
}
//Step 7: prepend the ACE prefix
- uprv_memcpy(dest,ACE_PREFIX,ACE_PREFIX_LENGTH * U_SIZEOF_UCHAR);
+ u_memcpy(dest, ACE_PREFIX, ACE_PREFIX_LENGTH);
//Step 6: copy the contents in b2 into dest
- uprv_memcpy(dest+ACE_PREFIX_LENGTH, b2, b2Len * U_SIZEOF_UCHAR);
+ u_memcpy(dest+ACE_PREFIX_LENGTH, b2, b2Len);
}else{
*status = U_IDNA_ACE_PREFIX_ERROR;
@@ -541,7 +543,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
//step 8: return output of step 5
reqLength = b2Len;
if(b2Len <= destCapacity) {
- uprv_memmove(dest, b2, b2Len * U_SIZEOF_UCHAR);
+ u_memmove(dest, b2, b2Len);
}
}
else{
@@ -570,7 +572,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
// just return the source
//copy the source to destination
if(srcLength <= destCapacity){
- uprv_memmove(dest,src,srcLength * U_SIZEOF_UCHAR);
+ u_memmove(dest, src, srcLength);
}
reqLength = srcLength;
}
@@ -597,7 +599,7 @@ CLEANUP:
if(dest && srcLength <= destCapacity){
// srcLength should have already been set earlier.
U_ASSERT(srcLength >= 0);
- uprv_memmove(dest,src,srcLength * U_SIZEOF_UCHAR);
+ u_memmove(dest, src, srcLength);
}
reqLength = srcLength;
*status = U_ZERO_ERROR;
« no previous file with comments | « source/common/uhash_us.cpp ('k') | source/common/uinit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698