Chromium Code Reviews

Unified Diff: source/i18n/csr2022.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/i18n/csr2022.h ('k') | source/i18n/csrecog.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/csr2022.cpp
diff --git a/source/i18n/csr2022.cpp b/source/i18n/csr2022.cpp
index 236a5267145f5acd352ce1a5521632a39ba52f24..66289ee6fba1be0b5d62fa31060449804346a054 100644
--- a/source/i18n/csr2022.cpp
+++ b/source/i18n/csr2022.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) 2005-2015, International Business Machines
+ * Copyright (C) 2005-2016, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
@@ -9,6 +11,7 @@
#if !UCONFIG_NO_CONVERSION
+#include "cmemory.h"
#include "cstring.h"
#include "csr2022.h"
@@ -16,8 +19,6 @@
U_NAMESPACE_BEGIN
-#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
-
/**
* Matching function shared among the 2022 detectors JP, CN and KR
* Counts up the number of legal and unrecognized escape sequences in
@@ -149,7 +150,7 @@ UBool CharsetRecog_2022JP::match(InputText *textIn, CharsetMatch *results) const
int32_t confidence = match_2022(textIn->fInputBytes,
textIn->fInputLen,
escapeSequences_2022JP,
- ARRAY_SIZE(escapeSequences_2022JP));
+ UPRV_LENGTHOF(escapeSequences_2022JP));
results->set(textIn, this, confidence);
return (confidence > 0);
}
@@ -165,7 +166,7 @@ UBool CharsetRecog_2022KR::match(InputText *textIn, CharsetMatch *results) const
int32_t confidence = match_2022(textIn->fInputBytes,
textIn->fInputLen,
escapeSequences_2022KR,
- ARRAY_SIZE(escapeSequences_2022KR));
+ UPRV_LENGTHOF(escapeSequences_2022KR));
results->set(textIn, this, confidence);
return (confidence > 0);
}
@@ -180,7 +181,7 @@ UBool CharsetRecog_2022CN::match(InputText *textIn, CharsetMatch *results) const
int32_t confidence = match_2022(textIn->fInputBytes,
textIn->fInputLen,
escapeSequences_2022CN,
- ARRAY_SIZE(escapeSequences_2022CN));
+ UPRV_LENGTHOF(escapeSequences_2022CN));
results->set(textIn, this, confidence);
return (confidence > 0);
}
« no previous file with comments | « source/i18n/csr2022.h ('k') | source/i18n/csrecog.h » ('j') | no next file with comments »

Powered by Google App Engine