summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/extra
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-03-27 17:16:39 +0000
committerKarl Berry <karl@freefriends.org>2016-03-27 17:16:39 +0000
commit46133be58cca10fe420003f25e1a301d8bda6192 (patch)
tree0b0299934291f13c12eba2c11cd1ac33911b1224 /Build/source/libs/icu/icu-src/source/extra
parentd96bcc9a2e41bd962e65f3026384837a9bd44734 (diff)
import icu-57.1 (unmodified, TL patches coming next)
git-svn-id: svn://tug.org/texlive/trunk@40154 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/extra')
-rw-r--r--Build/source/libs/icu/icu-src/source/extra/scrptrun/scrptrun.cpp7
-rw-r--r--Build/source/libs/icu/icu-src/source/extra/scrptrun/srtest.cpp7
-rw-r--r--Build/source/libs/icu/icu-src/source/extra/uconv/uconv.cpp8
-rw-r--r--Build/source/libs/icu/icu-src/source/extra/uconv/uwmsg.c5
4 files changed, 14 insertions, 13 deletions
diff --git a/Build/source/libs/icu/icu-src/source/extra/scrptrun/scrptrun.cpp b/Build/source/libs/icu/icu-src/source/extra/scrptrun/scrptrun.cpp
index 8d9865155af..5b4e5bba928 100644
--- a/Build/source/libs/icu/icu-src/source/extra/scrptrun/scrptrun.cpp
+++ b/Build/source/libs/icu/icu-src/source/extra/scrptrun/scrptrun.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
- * Copyright (C) 1999-2001, International Business Machines
+ * Copyright (C) 1999-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -14,10 +14,9 @@
#include "unicode/utypes.h"
#include "unicode/uscript.h"
+#include "cmemory.h"
#include "scrptrun.h"
-#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
-
const char ScriptRun::fgClassID=0;
UChar32 ScriptRun::pairedChars[] = {
@@ -40,7 +39,7 @@ UChar32 ScriptRun::pairedChars[] = {
0x301a, 0x301b
};
-const int32_t ScriptRun::pairedCharCount = ARRAY_SIZE(pairedChars);
+const int32_t ScriptRun::pairedCharCount = UPRV_LENGTHOF(pairedChars);
const int32_t ScriptRun::pairedCharPower = 1 << highBit(pairedCharCount);
const int32_t ScriptRun::pairedCharExtra = pairedCharCount - pairedCharPower;
diff --git a/Build/source/libs/icu/icu-src/source/extra/scrptrun/srtest.cpp b/Build/source/libs/icu/icu-src/source/extra/scrptrun/srtest.cpp
index 8b6b550da31..9e3c8fb087d 100644
--- a/Build/source/libs/icu/icu-src/source/extra/scrptrun/srtest.cpp
+++ b/Build/source/libs/icu/icu-src/source/extra/scrptrun/srtest.cpp
@@ -1,13 +1,14 @@
/*
* %W% %E%
*
- * (C) Copyright IBM Corp. 2001 - All Rights Reserved
+ * (C) Copyright IBM Corp. 2001-2016 - All Rights Reserved
*
*/
#include "unicode/utypes.h"
#include "unicode/uscript.h"
+#include "cmemory.h"
#include "scrptrun.h"
#include <stdio.h>
@@ -22,7 +23,7 @@ UChar testChars[] = {
0xD801, 0xDC00, 0xD801, 0xDC01, 0xD801, 0xDC02, 0xD801, 0xDC03
};
-int32_t testLength = sizeof testChars / sizeof testChars[0];
+int32_t testLength = UPRV_LENGTHOF(testChars);
void main()
{
@@ -35,4 +36,4 @@ void main()
printf("Script '%s' from %d to %d.\n", uscript_getName(code), start, end);
}
-} \ No newline at end of file
+}
diff --git a/Build/source/libs/icu/icu-src/source/extra/uconv/uconv.cpp b/Build/source/libs/icu/icu-src/source/extra/uconv/uconv.cpp
index 1fd2565831d..6729b3b21e3 100644
--- a/Build/source/libs/icu/icu-src/source/extra/uconv/uconv.cpp
+++ b/Build/source/libs/icu/icu-src/source/extra/uconv/uconv.cpp
@@ -1,6 +1,6 @@
/*****************************************************************************
*
-* Copyright (C) 1999-2014, International Business Machines
+* Copyright (C) 1999-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
@@ -173,7 +173,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 +944,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 +1082,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);
}
diff --git a/Build/source/libs/icu/icu-src/source/extra/uconv/uwmsg.c b/Build/source/libs/icu/icu-src/source/extra/uconv/uwmsg.c
index a182a719a67..772a7399fc7 100644
--- a/Build/source/libs/icu/icu-src/source/extra/uconv/uwmsg.c
+++ b/Build/source/libs/icu/icu-src/source/extra/uconv/uwmsg.c
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1998-2014, International Business Machines Corporation
+* Copyright (C) 1998-2016, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
*
@@ -19,6 +19,7 @@
#include "unicode/uwmsg.h"
#include "unicode/ures.h"
#include "unicode/putil.h"
+#include "cmemory.h"
#include "cstring.h"
#include <stdlib.h>
@@ -143,7 +144,7 @@ U_CFUNC int u_wmsg(FILE *fp, const char *tag, ... )
}
#if UCONFIG_NO_FORMATTING
- resultLength = sizeof(gNoFormatting) / U_SIZEOF_UCHAR;
+ resultLength = UPRV_LENGTHOF(gNoFormatting);
if((msgLen + resultLength) <= UPRV_LENGTHOF(result)) {
memcpy(result, msg, msgLen * U_SIZEOF_UCHAR);
memcpy(result + msgLen, gNoFormatting, resultLength);