Index: source/extra/uconv/uconv.cpp |
diff --git a/source/extra/uconv/uconv.cpp b/source/extra/uconv/uconv.cpp |
index 1fd2565831d77796038290805b99d1d474442318..2a043f874f55194f53cda08ee72fe4624ec523db 100644 |
--- a/source/extra/uconv/uconv.cpp |
+++ b/source/extra/uconv/uconv.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) 1999-2014, International Business Machines |
+* Copyright (C) 1999-2016, International Business Machines |
* Corporation and others. All Rights Reserved. |
* |
******************************************************************************/ |
@@ -173,7 +175,7 @@ static struct callback_ent { |
static const struct callback_ent *findCallback(const char *name) { |
int i, count = |
- sizeof(transcode_callbacks) / sizeof(*transcode_callbacks); |
+ UPRV_LENGTHOF(transcode_callbacks); |
/* We'll do a linear search, there aren't many of them and bsearch() |
may not be that portable. */ |
@@ -944,7 +946,7 @@ ConvertFile::convertFile(const char *pname, |
int8_t i, length, errorLength; |
UErrorCode localError = U_ZERO_ERROR; |
- errorLength = (int8_t)UPRV_LENGTHOF(errorUChars); |
+ errorLength = UPRV_LENGTHOF(errorUChars); |
ucnv_getInvalidUChars(convto, errorUChars, &errorLength, &localError); |
if (U_FAILURE(localError) || errorLength == 0) { |
// need at least 1 so that we don't access beyond the length of fromoffsets[] |
@@ -1082,7 +1084,7 @@ static void usage(const char *pname, int ecode) { |
/* Now dump callbacks and finish. */ |
int i, count = |
- sizeof(transcode_callbacks) / sizeof(*transcode_callbacks); |
+ UPRV_LENGTHOF(transcode_callbacks); |
for (i = 0; i < count; ++i) { |
fprintf(fp, " %s", transcode_callbacks[i].name); |
} |