diff options
Diffstat (limited to 'deps/icu-small/source/common/cmemory.h')
-rw-r--r-- | deps/icu-small/source/common/cmemory.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/deps/icu-small/source/common/cmemory.h b/deps/icu-small/source/common/cmemory.h index 8c62868855..d2e48e5f30 100644 --- a/deps/icu-small/source/common/cmemory.h +++ b/deps/icu-small/source/common/cmemory.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * @@ -281,7 +283,7 @@ inline T *LocalMemory<T>::allocateInsteadAndCopy(int32_t newCapacity, int32_t le if(length>newCapacity) { length=newCapacity; } - uprv_memcpy(p, LocalPointerBase<T>::ptr, length*sizeof(T)); + uprv_memcpy(p, LocalPointerBase<T>::ptr, (size_t)length*sizeof(T)); } uprv_free(LocalPointerBase<T>::ptr); LocalPointerBase<T>::ptr=p; @@ -428,7 +430,7 @@ inline T *MaybeStackArray<T, stackCapacity>::resize(int32_t newCapacity, int32_t if(length>newCapacity) { length=newCapacity; } - uprv_memcpy(p, ptr, length*sizeof(T)); + uprv_memcpy(p, ptr, (size_t)length*sizeof(T)); } releaseArray(); ptr=p; @@ -459,7 +461,7 @@ inline T *MaybeStackArray<T, stackCapacity>::orphanOrClone(int32_t length, int32 if(p==NULL) { return NULL; } - uprv_memcpy(p, ptr, length*sizeof(T)); + uprv_memcpy(p, ptr, (size_t)length*sizeof(T)); } resultCapacity=length; ptr=stackArray; @@ -607,7 +609,7 @@ inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::resize(int32_t newCapac length=newCapacity; } } - uprv_memcpy(p, ptr, sizeof(H)+length*sizeof(T)); + uprv_memcpy(p, ptr, sizeof(H)+(size_t)length*sizeof(T)); releaseMemory(); ptr=p; capacity=newCapacity; @@ -638,7 +640,7 @@ inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::orphanOrClone(int32_t l if(p==NULL) { return NULL; } - uprv_memcpy(p, ptr, sizeof(H)+length*sizeof(T)); + uprv_memcpy(p, ptr, sizeof(H)+(size_t)length*sizeof(T)); } resultCapacity=length; ptr=&stackHeader; |