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

Unified Diff: source/common/ustr_wcs.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/ustr_titlecase_brkiter.cpp ('k') | source/common/ustrcase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/ustr_wcs.cpp
diff --git a/source/common/ustr_wcs.cpp b/source/common/ustr_wcs.cpp
index 2ca5119992e8ee2e55e2a82f7e5d9fc011b13a23..59a58692ec37e99d1543d9dd6373a4ccb22b6a25 100644
--- a/source/common/ustr_wcs.cpp
+++ b/source/common/ustr_wcs.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
@@ -42,7 +44,7 @@ u_growAnyBufferFromStatic(void *context,
char *newBuffer=(char *)uprv_malloc(reqCapacity*size);
if(newBuffer!=NULL) {
if(length>0) {
- uprv_memcpy(newBuffer, *pBuffer, length*size);
+ uprv_memcpy(newBuffer, *pBuffer, (size_t)length*size);
}
*pCapacity=reqCapacity;
} else {
@@ -200,7 +202,7 @@ _strToWCS(wchar_t *dest,
count = (int32_t)(pIntTarget-intTarget);
if(0 < count && count <= destCapacity){
- uprv_memcpy(dest,intTarget,count*sizeof(wchar_t));
+ uprv_memcpy(dest, intTarget, (size_t)count*sizeof(wchar_t));
}
if(pDestLength){
@@ -252,13 +254,13 @@ u_strToWCS(wchar_t *dest,
srcLength = u_strlen(src);
}
if(0 < srcLength && srcLength <= destCapacity){
- uprv_memcpy(dest,src,srcLength*U_SIZEOF_UCHAR);
+ u_memcpy(dest, src, srcLength);
}
if(pDestLength){
*pDestLength = srcLength;
}
- u_terminateUChars(dest,destCapacity,srcLength,pErrorCode);
+ u_terminateUChars((UChar *)dest,destCapacity,srcLength,pErrorCode);
return dest;
@@ -395,7 +397,7 @@ _strFromWCS( UChar *dest,
}
if(nulLen>0){
/* copy the contents to tempStack */
- uprv_memcpy(pWStack,pSrc,nulLen*sizeof(wchar_t));
+ uprv_memcpy(pWStack, pSrc, (size_t)nulLen*sizeof(wchar_t));
}
/* null terminate the tempBuffer */
@@ -504,10 +506,10 @@ u_strFromWCS(UChar *dest,
#ifdef U_WCHAR_IS_UTF16
/* wchar_t is UTF-16 just do a memcpy */
if(srcLength == -1){
- srcLength = u_strlen(src);
+ srcLength = u_strlen((const UChar *)src);
}
if(0 < srcLength && srcLength <= destCapacity){
- uprv_memcpy(dest,src,srcLength*U_SIZEOF_UCHAR);
+ u_memcpy(dest, src, srcLength);
}
if(pDestLength){
*pDestLength = srcLength;
« no previous file with comments | « source/common/ustr_titlecase_brkiter.cpp ('k') | source/common/ustrcase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698