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

Unified Diff: source/common/brkeng.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/brkeng.h ('k') | source/common/brkiter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/brkeng.cpp
diff --git a/source/common/brkeng.cpp b/source/common/brkeng.cpp
index 0a5f47c6f1c1b717f0a8ec1d9ac43ea6e999a96f..cf144833fae73ebf5fa9921a442d5242f88e5235 100644
--- a/source/common/brkeng.cpp
+++ b/source/common/brkeng.cpp
@@ -1,6 +1,8 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
************************************************************************************
- * Copyright (C) 2006-2015, International Business Machines Corporation
+ * Copyright (C) 2006-2016, International Business Machines Corporation
* and others. All Rights Reserved.
************************************************************************************
*/
@@ -10,6 +12,7 @@
#if !UCONFIG_NO_BREAK_ITERATION
#include "brkeng.h"
+#include "cmemory.h"
#include "dictbe.h"
#include "unicode/uchar.h"
#include "unicode/uniset.h"
@@ -56,13 +59,13 @@ LanguageBreakFactory::~LanguageBreakFactory() {
*/
UnhandledEngine::UnhandledEngine(UErrorCode &/*status*/) {
- for (int32_t i = 0; i < (int32_t)(sizeof(fHandled)/sizeof(fHandled[0])); ++i) {
+ for (int32_t i = 0; i < UPRV_LENGTHOF(fHandled); ++i) {
fHandled[i] = 0;
}
}
UnhandledEngine::~UnhandledEngine() {
- for (int32_t i = 0; i < (int32_t)(sizeof(fHandled)/sizeof(fHandled[0])); ++i) {
+ for (int32_t i = 0; i < UPRV_LENGTHOF(fHandled); ++i) {
if (fHandled[i] != 0) {
delete fHandled[i];
}
@@ -71,7 +74,7 @@ UnhandledEngine::~UnhandledEngine() {
UBool
UnhandledEngine::handles(UChar32 c, int32_t breakType) const {
- return (breakType >= 0 && breakType < (int32_t)(sizeof(fHandled)/sizeof(fHandled[0]))
+ return (breakType >= 0 && breakType < UPRV_LENGTHOF(fHandled)
&& fHandled[breakType] != 0 && fHandled[breakType]->contains(c));
}
@@ -82,7 +85,7 @@ UnhandledEngine::findBreaks( UText *text,
UBool reverse,
int32_t breakType,
UStack &/*foundBreaks*/ ) const {
- if (breakType >= 0 && breakType < (int32_t)(sizeof(fHandled)/sizeof(fHandled[0]))) {
+ if (breakType >= 0 && breakType < UPRV_LENGTHOF(fHandled)) {
UChar32 c = utext_current32(text);
if (reverse) {
while((int32_t)utext_getNativeIndex(text) > startPos && fHandled[breakType]->contains(c)) {
@@ -101,7 +104,7 @@ UnhandledEngine::findBreaks( UText *text,
void
UnhandledEngine::handleCharacter(UChar32 c, int32_t breakType) {
- if (breakType >= 0 && breakType < (int32_t)(sizeof(fHandled)/sizeof(fHandled[0]))) {
+ if (breakType >= 0 && breakType < UPRV_LENGTHOF(fHandled)) {
if (fHandled[breakType] == 0) {
fHandled[breakType] = new UnicodeSet();
if (fHandled[breakType] == 0) {
« no previous file with comments | « source/common/brkeng.h ('k') | source/common/brkiter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698