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

Unified Diff: source/common/cmemory.h

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/charstr.cpp ('k') | source/common/cmemory.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/cmemory.h
diff --git a/source/common/cmemory.h b/source/common/cmemory.h
index 3041b56d1a14010dded80daa7bcf8827121491d0..a1211bdc3c4abc389b47336717c969b2fcb504a6 100644
--- a/source/common/cmemory.h
+++ b/source/common/cmemory.h
@@ -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) 1997-2015, International Business Machines
+* Copyright (C) 1997-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -153,6 +155,8 @@ U_NAMESPACE_BEGIN
template<typename T>
class LocalMemory : public LocalPointerBase<T> {
public:
+ using LocalPointerBase<T>::operator*;
+ using LocalPointerBase<T>::operator->;
/**
* Constructor takes ownership.
* @param p simple pointer to an array of T items that is adopted
@@ -279,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;
@@ -426,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;
@@ -457,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;
@@ -605,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;
@@ -636,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;
« no previous file with comments | « source/common/charstr.cpp ('k') | source/common/cmemory.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698