Chromium Code Reviews

Unified Diff: source/common/bytestriebuilder.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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « source/common/bytestrie.cpp ('k') | source/common/bytestrieiterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/bytestriebuilder.cpp
diff --git a/source/common/bytestriebuilder.cpp b/source/common/bytestriebuilder.cpp
index f252e2d41fe5d794502111606cf63523cde32fd5..913d85a21217bee61650665a28a1d0437dff7a0d 100644
--- a/source/common/bytestriebuilder.cpp
+++ b/source/common/bytestriebuilder.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010-2012, International Business Machines
@@ -35,7 +37,7 @@ class BytesTrieElement : public UMemory {
public:
// Use compiler's default constructor, initializes nothing.
- void setTo(const StringPiece &s, int32_t val, CharString &strings, UErrorCode &errorCode);
+ void setTo(StringPiece s, int32_t val, CharString &strings, UErrorCode &errorCode);
StringPiece getString(const CharString &strings) const {
int32_t offset=stringOffset;
@@ -86,7 +88,7 @@ private:
};
void
-BytesTrieElement::setTo(const StringPiece &s, int32_t val,
+BytesTrieElement::setTo(StringPiece s, int32_t val,
CharString &strings, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return;
@@ -143,7 +145,7 @@ BytesTrieBuilder::~BytesTrieBuilder() {
}
BytesTrieBuilder &
-BytesTrieBuilder::add(const StringPiece &s, int32_t value, UErrorCode &errorCode) {
+BytesTrieBuilder::add(StringPiece s, int32_t value, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return *this;
}
@@ -165,7 +167,7 @@ BytesTrieBuilder::add(const StringPiece &s, int32_t value, UErrorCode &errorCode
return *this; // error instead of dereferencing null
}
if(elementsLength>0) {
- uprv_memcpy(newElements, elements, elementsLength*sizeof(BytesTrieElement));
+ uprv_memcpy(newElements, elements, (size_t)elementsLength*sizeof(BytesTrieElement));
}
delete[] elements;
elements=newElements;
« no previous file with comments | « source/common/bytestrie.cpp ('k') | source/common/bytestrieiterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine