| Index: source/common/ushape.cpp
|
| diff --git a/source/common/ushape.cpp b/source/common/ushape.cpp
|
| index eeae57f3d4370ec9489776caed09363d75ac8666..8420cc95c6096fcba93a90c453f13f4c0b221395 100644
|
| --- a/source/common/ushape.cpp
|
| +++ b/source/common/ushape.cpp
|
| @@ -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) 2000-2014, International Business Machines
|
| + * Copyright (C) 2000-2016, International Business Machines
|
| * Corporation and others. All Rights Reserved.
|
| *
|
| ******************************************************************************
|
| @@ -777,7 +779,7 @@ handleGeneratedSpaces(UChar *dest, int32_t sourceLength,
|
| count--;
|
| }
|
|
|
| - uprv_memcpy(dest, tempbuffer, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, sourceLength);
|
| destSize = u_strlen(dest);
|
| }
|
|
|
| @@ -835,7 +837,7 @@ handleGeneratedSpaces(UChar *dest, int32_t sourceLength,
|
| tempbuffer[i] = SPACE_CHAR;
|
| }
|
|
|
| - uprv_memcpy(dest, tempbuffer, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, sourceLength);
|
| destSize = sourceLength;
|
| }
|
|
|
| @@ -877,7 +879,7 @@ handleGeneratedSpaces(UChar *dest, int32_t sourceLength,
|
| count--;
|
| }
|
|
|
| - uprv_memcpy(dest,tempbuffer, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, sourceLength);
|
| destSize = sourceLength;
|
| }
|
|
|
| @@ -928,7 +930,7 @@ expandCompositCharAtBegin(UChar *dest, int32_t sourceLength, int32_t destSize,UE
|
| tempbuffer[j] = LAM_CHAR;
|
| /* to ensure the array index is within the range */
|
| U_ASSERT(dest[i] >= 0xFEF5u
|
| - && dest[i]-0xFEF5u < sizeof(convertLamAlef)/sizeof(convertLamAlef[0]));
|
| + && dest[i]-0xFEF5u < UPRV_LENGTHOF(convertLamAlef));
|
| tempbuffer[j-1] = convertLamAlef[ dest[i] - 0xFEF5 ];
|
| j--;
|
| countl--;
|
| @@ -941,7 +943,7 @@ expandCompositCharAtBegin(UChar *dest, int32_t sourceLength, int32_t destSize,UE
|
| i--;
|
| j--;
|
| }
|
| - uprv_memcpy(dest, tempbuffer, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, sourceLength);
|
|
|
| uprv_free(tempbuffer);
|
|
|
| @@ -1002,14 +1004,14 @@ expandCompositCharAtEnd(UChar *dest, int32_t sourceLength, int32_t destSize,UErr
|
| }
|
|
|
| if(countr > 0) {
|
| - uprv_memmove(tempbuffer, tempbuffer+countr, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memmove(tempbuffer, tempbuffer+countr, sourceLength);
|
| if(u_strlen(tempbuffer) < sourceLength) {
|
| for(i=sourceLength-1;i>=sourceLength-countr;i--) {
|
| tempbuffer[i] = SPACE_CHAR;
|
| }
|
| }
|
| }
|
| - uprv_memcpy(dest, tempbuffer, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, sourceLength);
|
|
|
| uprv_free(tempbuffer);
|
|
|
| @@ -1177,7 +1179,7 @@ expandCompositChar(UChar *dest, int32_t sourceLength,
|
| j++;
|
| }
|
|
|
| - uprv_memcpy(dest, tempbuffer, destSize*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, destSize);
|
| }
|
| }
|
|
|
| @@ -1322,7 +1324,7 @@ shapeUnicode(UChar *dest, int32_t sourceLength,
|
| } else {
|
| /* to ensure the array index is within the range */
|
| U_ASSERT(dest[i] >= 0x064Bu
|
| - && dest[i]-0x064Bu < sizeof(IrrelevantPos)/sizeof(IrrelevantPos[0]));
|
| + && dest[i]-0x064Bu < UPRV_LENGTHOF(IrrelevantPos));
|
| dest[i] = 0xFE70 + IrrelevantPos[(dest[i] - 0x064B)] + Shape;
|
| }
|
| }else if ((currLink & APRESENT) > 0) {
|
| @@ -1571,7 +1573,7 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
|
| return 0;
|
| }
|
| }
|
| - uprv_memcpy(tempbuffer, source, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(tempbuffer, source, sourceLength);
|
| if (tempsource != NULL){
|
| uprv_free(tempsource);
|
| }
|
| @@ -1637,7 +1639,7 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
|
| countSpaces(tempbuffer,destLength,options,&spacesCountl,&spacesCountr);
|
| invertBuffer(tempbuffer,destLength,options,spacesCountl,spacesCountr);
|
| }
|
| - uprv_memcpy(dest, tempbuffer, uprv_min(destLength, destCapacity)*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, tempbuffer, uprv_min(destLength, destCapacity));
|
|
|
| if(tempbuffer!=buffer) {
|
| uprv_free(tempbuffer);
|
| @@ -1659,7 +1661,7 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
|
| *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
|
| return sourceLength;
|
| }
|
| - uprv_memcpy(dest, source, sourceLength*U_SIZEOF_UCHAR);
|
| + u_memcpy(dest, source, sourceLength);
|
| destLength=sourceLength;
|
| }
|
|
|
|
|