diff options
Diffstat (limited to 'deps/icu-small/source/tools')
73 files changed, 191 insertions, 35 deletions
diff --git a/deps/icu-small/source/tools/genccode/genccode.c b/deps/icu-small/source/tools/genccode/genccode.c index 58f5c2e8e0..2534820bac 100644 --- a/deps/icu-small/source/tools/genccode/genccode.c +++ b/deps/icu-small/source/tools/genccode/genccode.c @@ -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) 1999-2016, International Business Machines diff --git a/deps/icu-small/source/tools/gencmn/gencmn.c b/deps/icu-small/source/tools/gencmn/gencmn.c index a6498ce6a9..d328a30521 100644 --- a/deps/icu-small/source/tools/gencmn/gencmn.c +++ b/deps/icu-small/source/tools/gencmn/gencmn.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/derb.cpp b/deps/icu-small/source/tools/genrb/derb.cpp index 3d2507bc14..22e275ef35 100644 --- a/deps/icu-small/source/tools/genrb/derb.cpp +++ b/deps/icu-small/source/tools/genrb/derb.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/errmsg.c b/deps/icu-small/source/tools/genrb/errmsg.c index 420c12399e..7340f01af2 100644 --- a/deps/icu-small/source/tools/genrb/errmsg.c +++ b/deps/icu-small/source/tools/genrb/errmsg.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/errmsg.h b/deps/icu-small/source/tools/genrb/errmsg.h index 19dfee8d85..5026ecf7be 100644 --- a/deps/icu-small/source/tools/genrb/errmsg.h +++ b/deps/icu-small/source/tools/genrb/errmsg.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/genrb.cpp b/deps/icu-small/source/tools/genrb/genrb.cpp index 50e9bfd02e..685fb5884e 100644 --- a/deps/icu-small/source/tools/genrb/genrb.cpp +++ b/deps/icu-small/source/tools/genrb/genrb.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/genrb.h b/deps/icu-small/source/tools/genrb/genrb.h index 9a190f28d3..99c604f780 100644 --- a/deps/icu-small/source/tools/genrb/genrb.h +++ b/deps/icu-small/source/tools/genrb/genrb.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/parse.cpp b/deps/icu-small/source/tools/genrb/parse.cpp index 879db96b02..f448daab6c 100644 --- a/deps/icu-small/source/tools/genrb/parse.cpp +++ b/deps/icu-small/source/tools/genrb/parse.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/parse.h b/deps/icu-small/source/tools/genrb/parse.h index c9ac5521e1..d7341be6dd 100644 --- a/deps/icu-small/source/tools/genrb/parse.h +++ b/deps/icu-small/source/tools/genrb/parse.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/prscmnts.cpp b/deps/icu-small/source/tools/genrb/prscmnts.cpp index d9c690ff52..edae16c5c5 100644 --- a/deps/icu-small/source/tools/genrb/prscmnts.cpp +++ b/deps/icu-small/source/tools/genrb/prscmnts.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) 2003-2014, International Business Machines diff --git a/deps/icu-small/source/tools/genrb/prscmnts.h b/deps/icu-small/source/tools/genrb/prscmnts.h index da085965aa..c9958cd071 100644 --- a/deps/icu-small/source/tools/genrb/prscmnts.h +++ b/deps/icu-small/source/tools/genrb/prscmnts.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/rbutil.c b/deps/icu-small/source/tools/genrb/rbutil.c index bbe8624909..174b4d7b44 100644 --- a/deps/icu-small/source/tools/genrb/rbutil.c +++ b/deps/icu-small/source/tools/genrb/rbutil.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/rbutil.h b/deps/icu-small/source/tools/genrb/rbutil.h index 3f055a848c..d2a303516a 100644 --- a/deps/icu-small/source/tools/genrb/rbutil.h +++ b/deps/icu-small/source/tools/genrb/rbutil.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/read.c b/deps/icu-small/source/tools/genrb/read.c index b652fee9bf..313fb61677 100644 --- a/deps/icu-small/source/tools/genrb/read.c +++ b/deps/icu-small/source/tools/genrb/read.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/read.h b/deps/icu-small/source/tools/genrb/read.h index f79b145f25..74b8c823a2 100644 --- a/deps/icu-small/source/tools/genrb/read.h +++ b/deps/icu-small/source/tools/genrb/read.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/reslist.cpp b/deps/icu-small/source/tools/genrb/reslist.cpp index 9f8365d7f6..9420184a9d 100644 --- a/deps/icu-small/source/tools/genrb/reslist.cpp +++ b/deps/icu-small/source/tools/genrb/reslist.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/reslist.h b/deps/icu-small/source/tools/genrb/reslist.h index 5d09ecd8db..614be2d10f 100644 --- a/deps/icu-small/source/tools/genrb/reslist.h +++ b/deps/icu-small/source/tools/genrb/reslist.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/rle.c b/deps/icu-small/source/tools/genrb/rle.c index fb14d1afc2..4a69cd5298 100644 --- a/deps/icu-small/source/tools/genrb/rle.c +++ b/deps/icu-small/source/tools/genrb/rle.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/rle.h b/deps/icu-small/source/tools/genrb/rle.h index 0810914c52..93d51a3750 100644 --- a/deps/icu-small/source/tools/genrb/rle.h +++ b/deps/icu-small/source/tools/genrb/rle.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/ustr.c b/deps/icu-small/source/tools/genrb/ustr.c index b73ce9bd2a..1631a205ff 100644 --- a/deps/icu-small/source/tools/genrb/ustr.c +++ b/deps/icu-small/source/tools/genrb/ustr.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -92,7 +94,7 @@ ustr_cpy(struct UString *dst, if(src->fChars == NULL || dst->fChars == NULL){ return; } - uprv_memcpy(dst->fChars, src->fChars, sizeof(UChar) * src->fLength); + u_memcpy(dst->fChars, src->fChars, src->fLength); dst->fLength = src->fLength; dst->fChars[dst->fLength] = 0x0000; } diff --git a/deps/icu-small/source/tools/genrb/ustr.h b/deps/icu-small/source/tools/genrb/ustr.h index 05a446ea0e..c27a78104f 100644 --- a/deps/icu-small/source/tools/genrb/ustr.h +++ b/deps/icu-small/source/tools/genrb/ustr.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/wrtjava.cpp b/deps/icu-small/source/tools/genrb/wrtjava.cpp index 6bfa7bb150..329753717b 100644 --- a/deps/icu-small/source/tools/genrb/wrtjava.cpp +++ b/deps/icu-small/source/tools/genrb/wrtjava.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/genrb/wrtxml.cpp b/deps/icu-small/source/tools/genrb/wrtxml.cpp index c250fc29b4..62fdd2427c 100644 --- a/deps/icu-small/source/tools/genrb/wrtxml.cpp +++ b/deps/icu-small/source/tools/genrb/wrtxml.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/icupkg/icupkg.cpp b/deps/icu-small/source/tools/icupkg/icupkg.cpp index 056fc46fac..2023930441 100644 --- a/deps/icu-small/source/tools/icupkg/icupkg.cpp +++ b/deps/icu-small/source/tools/icupkg/icupkg.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp index 5dc075101b..bf93318602 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp +++ b/deps/icu-small/source/tools/pkgdata/pkgdata.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) 2000-2016, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/pkgdata/pkgtypes.c b/deps/icu-small/source/tools/pkgdata/pkgtypes.c index c8e08c2e82..eadf634db3 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgtypes.c +++ b/deps/icu-small/source/tools/pkgdata/pkgtypes.c @@ -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) 2000-2016, International Business Machines diff --git a/deps/icu-small/source/tools/pkgdata/pkgtypes.h b/deps/icu-small/source/tools/pkgdata/pkgtypes.h index 0bba60c517..c7eeba42cb 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgtypes.h +++ b/deps/icu-small/source/tools/pkgdata/pkgtypes.h @@ -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) 2000-2012, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/collationinfo.cpp b/deps/icu-small/source/tools/toolutil/collationinfo.cpp index fef1cdf105..bbb1839ef1 100644 --- a/deps/icu-small/source/tools/toolutil/collationinfo.cpp +++ b/deps/icu-small/source/tools/toolutil/collationinfo.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) 2013-2015, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/collationinfo.h b/deps/icu-small/source/tools/toolutil/collationinfo.h index dac12d2d48..48cd556184 100644 --- a/deps/icu-small/source/tools/toolutil/collationinfo.h +++ b/deps/icu-small/source/tools/toolutil/collationinfo.h @@ -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) 2013-2015, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/dbgutil.cpp b/deps/icu-small/source/tools/toolutil/dbgutil.cpp index 668a2269e2..345715163b 100644 --- a/deps/icu-small/source/tools/toolutil/dbgutil.cpp +++ b/deps/icu-small/source/tools/toolutil/dbgutil.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: * Copyright (c) 2007-2012, International Business Machines Corporation and diff --git a/deps/icu-small/source/tools/toolutil/dbgutil.h b/deps/icu-small/source/tools/toolutil/dbgutil.h index 49d52eae51..704090cc21 100644 --- a/deps/icu-small/source/tools/toolutil/dbgutil.h +++ b/deps/icu-small/source/tools/toolutil/dbgutil.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ************************************************************************ diff --git a/deps/icu-small/source/tools/toolutil/denseranges.cpp b/deps/icu-small/source/tools/toolutil/denseranges.cpp index 7d81f2e944..3b83715f28 100644 --- a/deps/icu-small/source/tools/toolutil/denseranges.cpp +++ b/deps/icu-small/source/tools/toolutil/denseranges.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, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/denseranges.h b/deps/icu-small/source/tools/toolutil/denseranges.h index f9af561738..7b072f4654 100644 --- a/deps/icu-small/source/tools/toolutil/denseranges.h +++ b/deps/icu-small/source/tools/toolutil/denseranges.h @@ -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, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/filestrm.c b/deps/icu-small/source/tools/toolutil/filestrm.c index c7b4eee54a..446125de6b 100644 --- a/deps/icu-small/source/tools/toolutil/filestrm.c +++ b/deps/icu-small/source/tools/toolutil/filestrm.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * diff --git a/deps/icu-small/source/tools/toolutil/filestrm.h b/deps/icu-small/source/tools/toolutil/filestrm.h index 0eeba98b66..b423451406 100644 --- a/deps/icu-small/source/tools/toolutil/filestrm.h +++ b/deps/icu-small/source/tools/toolutil/filestrm.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * diff --git a/deps/icu-small/source/tools/toolutil/filetools.cpp b/deps/icu-small/source/tools/toolutil/filetools.cpp index 238ef7ba15..b0d4ed81a5 100644 --- a/deps/icu-small/source/tools/toolutil/filetools.cpp +++ b/deps/icu-small/source/tools/toolutil/filetools.cpp @@ -1,9 +1,12 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2009-2013, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* */ +#include "unicode/platform.h" #if U_PLATFORM == U_PF_MINGW // *cough* - for struct stat #ifdef __STRICT_ANSI__ @@ -13,6 +16,7 @@ #include "filetools.h" #include "filestrm.h" +#include "charstr.h" #include "cstring.h" #include "unicode/putil.h" #include "putilimp.h" @@ -27,8 +31,6 @@ #include <dirent.h> typedef struct dirent DIRENT; -#define MAX_PATH_SIZE 4096 /* Set the limit for the size of the path. */ - #define SKIP1 "." #define SKIP2 ".." #endif @@ -56,20 +58,24 @@ isFileModTimeLater(const char *filePath, const char *checkAgainst, UBool isDir) while ((dirEntry = readdir(pDir)) != NULL) { if (uprv_strcmp(dirEntry->d_name, SKIP1) != 0 && uprv_strcmp(dirEntry->d_name, SKIP2) != 0) { - char newpath[MAX_PATH_SIZE] = ""; - uprv_strcpy(newpath, checkAgainst); - uprv_strcat(newpath, U_FILE_SEP_STRING); - uprv_strcat(newpath, dirEntry->d_name); - - if ((subDirp = opendir(newpath)) != NULL) { + UErrorCode status = U_ZERO_ERROR; + icu::CharString newpath(checkAgainst, -1, status); + newpath.append(U_FILE_SEP_STRING, -1, status); + newpath.append(dirEntry->d_name, -1, status); + if (U_FAILURE(status)) { + fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, u_errorName(status)); + return FALSE; + }; + + if ((subDirp = opendir(newpath.data())) != NULL) { /* If this new path is a directory, make a recursive call with the newpath. */ closedir(subDirp); - isLatest = isFileModTimeLater(filePath, newpath, isDir); + isLatest = isFileModTimeLater(filePath, newpath.data(), isDir); if (!isLatest) { break; } } else { - int32_t latest = whichFileModTimeIsLater(filePath, newpath); + int32_t latest = whichFileModTimeIsLater(filePath, newpath.data()); if (latest < 0 || latest == 2) { isLatest = FALSE; break; diff --git a/deps/icu-small/source/tools/toolutil/filetools.h b/deps/icu-small/source/tools/toolutil/filetools.h index 7d4e139055..5ede02761a 100644 --- a/deps/icu-small/source/tools/toolutil/filetools.h +++ b/deps/icu-small/source/tools/toolutil/filetools.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/flagparser.c b/deps/icu-small/source/tools/toolutil/flagparser.c index 252267b7ae..c87beb147c 100644 --- a/deps/icu-small/source/tools/toolutil/flagparser.c +++ b/deps/icu-small/source/tools/toolutil/flagparser.c @@ -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) 2009-2015, International Business Machines * Corporation and others. All Rights Reserved. @@ -61,7 +63,7 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, continue; } - if (uprv_strlen(buffer) == (currentBufferSize - 1) && buffer[currentBufferSize-2] != '\n') { + if ((int32_t)uprv_strlen(buffer) == (currentBufferSize - 1) && buffer[currentBufferSize-2] != '\n') { /* Allocate more space for buffer if it didnot read the entrire line */ allocateMoreSpace = TRUE; T_FileStream_rewind(f); diff --git a/deps/icu-small/source/tools/toolutil/flagparser.h b/deps/icu-small/source/tools/toolutil/flagparser.h index 32a51e3d2a..4aa03c8a5f 100644 --- a/deps/icu-small/source/tools/toolutil/flagparser.h +++ b/deps/icu-small/source/tools/toolutil/flagparser.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/package.cpp b/deps/icu-small/source/tools/toolutil/package.cpp index 8992f30eee..d069147708 100644 --- a/deps/icu-small/source/tools/toolutil/package.cpp +++ b/deps/icu-small/source/tools/toolutil/package.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -1292,7 +1294,7 @@ void Package::setItemCapacity(int32_t max) exit(U_MEMORY_ALLOCATION_ERROR); } if(items && itemCount>0) { - uprv_memcpy(newItems, items, itemCount*sizeof(items[0])); + uprv_memcpy(newItems, items, (size_t)itemCount*sizeof(items[0])); } itemMax = max; items = newItems; diff --git a/deps/icu-small/source/tools/toolutil/package.h b/deps/icu-small/source/tools/toolutil/package.h index 194722f4f4..4d60202999 100644 --- a/deps/icu-small/source/tools/toolutil/package.h +++ b/deps/icu-small/source/tools/toolutil/package.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/pkg_genc.c b/deps/icu-small/source/tools/toolutil/pkg_genc.c index f486ec4a10..c85a12322b 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_genc.c +++ b/deps/icu-small/source/tools/toolutil/pkg_genc.c @@ -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) 2009-2016, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/toolutil/pkg_genc.h b/deps/icu-small/source/tools/toolutil/pkg_genc.h index 9bd312b96f..12ffc92728 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_genc.h +++ b/deps/icu-small/source/tools/toolutil/pkg_genc.h @@ -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) 2008-2011, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/toolutil/pkg_gencmn.c b/deps/icu-small/source/tools/toolutil/pkg_gencmn.c index 25f36088a0..38cc820a17 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_gencmn.c +++ b/deps/icu-small/source/tools/toolutil/pkg_gencmn.c @@ -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) 2008-2012, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/toolutil/pkg_gencmn.h b/deps/icu-small/source/tools/toolutil/pkg_gencmn.h index 0ba953be74..62f8327cdf 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_gencmn.h +++ b/deps/icu-small/source/tools/toolutil/pkg_gencmn.h @@ -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) 2008, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/toolutil/pkg_icu.cpp b/deps/icu-small/source/tools/toolutil/pkg_icu.cpp index 471b1d45ec..e679c23be8 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_icu.cpp +++ b/deps/icu-small/source/tools/toolutil/pkg_icu.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) 2008-2015, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/toolutil/pkg_icu.h b/deps/icu-small/source/tools/toolutil/pkg_icu.h index 50f3f51c96..3d620f78df 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_icu.h +++ b/deps/icu-small/source/tools/toolutil/pkg_icu.h @@ -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) 2008-2016, International Business Machines * Corporation and others. All Rights Reserved. diff --git a/deps/icu-small/source/tools/toolutil/pkg_imp.h b/deps/icu-small/source/tools/toolutil/pkg_imp.h index 45ddc4c091..c9fe81bd73 100644 --- a/deps/icu-small/source/tools/toolutil/pkg_imp.h +++ b/deps/icu-small/source/tools/toolutil/pkg_imp.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/pkgitems.cpp b/deps/icu-small/source/tools/toolutil/pkgitems.cpp index 7c8c744a44..91c8520110 100644 --- a/deps/icu-small/source/tools/toolutil/pkgitems.cpp +++ b/deps/icu-small/source/tools/toolutil/pkgitems.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/ppucd.cpp b/deps/icu-small/source/tools/toolutil/ppucd.cpp index ed5229be78..18d317e3e3 100644 --- a/deps/icu-small/source/tools/toolutil/ppucd.cpp +++ b/deps/icu-small/source/tools/toolutil/ppucd.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) 2011-2014, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/ppucd.h b/deps/icu-small/source/tools/toolutil/ppucd.h index d4726fec10..593bd24799 100644 --- a/deps/icu-small/source/tools/toolutil/ppucd.h +++ b/deps/icu-small/source/tools/toolutil/ppucd.h @@ -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) 2011-2013, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/swapimpl.cpp b/deps/icu-small/source/tools/toolutil/swapimpl.cpp index dbeff2d7b8..6cc2162301 100644 --- a/deps/icu-small/source/tools/toolutil/swapimpl.cpp +++ b/deps/icu-small/source/tools/toolutil/swapimpl.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -230,7 +232,7 @@ uprops_swap(const UDataSwapper *ds, /* copy everything for inaccessible data (padding) */ if(inData32!=outData32) { - uprv_memcpy(outData32, inData32, 4*dataTop); + uprv_memcpy(outData32, inData32, 4*(size_t)dataTop); } /* swap the indexes[16] */ diff --git a/deps/icu-small/source/tools/toolutil/swapimpl.h b/deps/icu-small/source/tools/toolutil/swapimpl.h index b36ec2609d..0e4d417344 100644 --- a/deps/icu-small/source/tools/toolutil/swapimpl.h +++ b/deps/icu-small/source/tools/toolutil/swapimpl.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/toolutil.cpp b/deps/icu-small/source/tools/toolutil/toolutil.cpp index 259df9873d..bb393a2e7d 100644 --- a/deps/icu-small/source/tools/toolutil/toolutil.cpp +++ b/deps/icu-small/source/tools/toolutil/toolutil.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -312,7 +314,7 @@ utm_hasCapacity(UToolMemory *mem, int32_t capacity) { if(mem->array==mem->staticArray) { mem->array=uprv_malloc(newCapacity*mem->size); if(mem->array!=NULL) { - uprv_memcpy(mem->array, mem->staticArray, mem->idx*mem->size); + uprv_memcpy(mem->array, mem->staticArray, (size_t)mem->idx*mem->size); } } else { mem->array=uprv_realloc(mem->array, newCapacity*mem->size); diff --git a/deps/icu-small/source/tools/toolutil/toolutil.h b/deps/icu-small/source/tools/toolutil/toolutil.h index 68c9e834a6..026e75aeb2 100644 --- a/deps/icu-small/source/tools/toolutil/toolutil.h +++ b/deps/icu-small/source/tools/toolutil/toolutil.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/ucbuf.cpp b/deps/icu-small/source/tools/toolutil/ucbuf.cpp index d83acff276..b6b0150afc 100644 --- a/deps/icu-small/source/tools/toolutil/ucbuf.cpp +++ b/deps/icu-small/source/tools/toolutil/ucbuf.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/ucbuf.h b/deps/icu-small/source/tools/toolutil/ucbuf.h index 739eb9fbe2..cb9509b427 100644 --- a/deps/icu-small/source/tools/toolutil/ucbuf.h +++ b/deps/icu-small/source/tools/toolutil/ucbuf.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/ucln_tu.cpp b/deps/icu-small/source/tools/toolutil/ucln_tu.cpp index 0a88ba584b..2f67641768 100644 --- a/deps/icu-small/source/tools/toolutil/ucln_tu.cpp +++ b/deps/icu-small/source/tools/toolutil/ucln_tu.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: * Copyright (c) 2007-2014, International Business Machines Corporation and diff --git a/deps/icu-small/source/tools/toolutil/ucm.c b/deps/icu-small/source/tools/toolutil/ucm.c index adb3ebd2d0..8d4cdfc40f 100644 --- a/deps/icu-small/source/tools/toolutil/ucm.c +++ b/deps/icu-small/source/tools/toolutil/ucm.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -967,7 +969,7 @@ ucm_addMapping(UCMTable *table, exit(U_MEMORY_ALLOCATION_ERROR); } - uprv_memcpy(table->codePoints+idx, codePoints, m->uLen*4); + uprv_memcpy(table->codePoints+idx, codePoints, (size_t)m->uLen*4); m->u=idx; } @@ -1124,7 +1126,7 @@ ucm_addMappingAuto(UCMFile *ucm, UBool forBase, UCMStates *baseStates, U_CAPI UBool U_EXPORT2 ucm_addMappingFromLine(UCMFile *ucm, const char *line, UBool forBase, UCMStates *baseStates) { - UCMapping m={ 0 }; + UCMapping m={ 0, {0}, 0, 0, 0, 0 }; UChar32 codePoints[UCNV_EXT_MAX_UCHARS]; uint8_t bytes[UCNV_EXT_MAX_BYTES]; diff --git a/deps/icu-small/source/tools/toolutil/ucm.h b/deps/icu-small/source/tools/toolutil/ucm.h index 5de1bdc5e3..0058adab5d 100644 --- a/deps/icu-small/source/tools/toolutil/ucm.h +++ b/deps/icu-small/source/tools/toolutil/ucm.h @@ -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) 2003-2013, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/ucmstate.c b/deps/icu-small/source/tools/toolutil/ucmstate.c index 6152ca9463..7c8559090b 100644 --- a/deps/icu-small/source/tools/toolutil/ucmstate.c +++ b/deps/icu-small/source/tools/toolutil/ucmstate.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/udbgutil.cpp b/deps/icu-small/source/tools/toolutil/udbgutil.cpp index 819cbd9115..bbb814ba90 100644 --- a/deps/icu-small/source/tools/toolutil/udbgutil.cpp +++ b/deps/icu-small/source/tools/toolutil/udbgutil.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: * Copyright (c) 2007-2016, International Business Machines Corporation and @@ -13,6 +15,7 @@ #include "unicode/ulocdata.h" #include "unicode/ucnv.h" #include "unicode/unistr.h" +#include "cstr.h" /* To add a new enum type @@ -689,8 +692,9 @@ void KnownIssues::add(const char *ticket, const char *where, const UChar *msg, U } if(msg==NULL || !*msg) return; - std::string str; - fTable[ticket][where].insert(icu::UnicodeString(msg).toUTF8String(str)); + const icu::UnicodeString ustr(msg); + + fTable[ticket][where].insert(std::string(icu::CStr(ustr)())); } void KnownIssues::add(const char *ticket, const char *where, const char *msg, UBool *firstForTicket, UBool *firstForWhere) diff --git a/deps/icu-small/source/tools/toolutil/udbgutil.h b/deps/icu-small/source/tools/toolutil/udbgutil.h index 3f6ecb0c85..4bfb4cf867 100644 --- a/deps/icu-small/source/tools/toolutil/udbgutil.h +++ b/deps/icu-small/source/tools/toolutil/udbgutil.h @@ -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) 2008-2015, International Business Machines diff --git a/deps/icu-small/source/tools/toolutil/unewdata.c b/deps/icu-small/source/tools/toolutil/unewdata.c index 94af785951..f3b152c079 100644 --- a/deps/icu-small/source/tools/toolutil/unewdata.c +++ b/deps/icu-small/source/tools/toolutil/unewdata.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -39,7 +41,7 @@ udata_create(const char *dir, const char *type, const char *name, uint16_t headerSize, commentLength; char filename[512]; uint8_t bytes[16]; - int length; + int32_t length; if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) { return NULL; @@ -74,7 +76,7 @@ udata_create(const char *dir, const char *type, const char *name, /* LDH buffer Length error check */ - if(length > (sizeof(filename) - 1)) + if(length > ((int32_t)sizeof(filename) - 1)) { *pErrorCode = U_BUFFER_OVERFLOW_ERROR; uprv_free(pData); diff --git a/deps/icu-small/source/tools/toolutil/unewdata.h b/deps/icu-small/source/tools/toolutil/unewdata.h index d25b8e9f74..9cc3994225 100644 --- a/deps/icu-small/source/tools/toolutil/unewdata.h +++ b/deps/icu-small/source/tools/toolutil/unewdata.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/uoptions.c b/deps/icu-small/source/tools/toolutil/uoptions.c index 291e2fce4e..e5ce64a372 100644 --- a/deps/icu-small/source/tools/toolutil/uoptions.c +++ b/deps/icu-small/source/tools/toolutil/uoptions.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/uoptions.h b/deps/icu-small/source/tools/toolutil/uoptions.h index 5980479364..72652feadb 100644 --- a/deps/icu-small/source/tools/toolutil/uoptions.h +++ b/deps/icu-small/source/tools/toolutil/uoptions.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/uparse.c b/deps/icu-small/source/tools/toolutil/uparse.c index 71c7602cc0..a7142c3cba 100644 --- a/deps/icu-small/source/tools/toolutil/uparse.c +++ b/deps/icu-small/source/tools/toolutil/uparse.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/uparse.h b/deps/icu-small/source/tools/toolutil/uparse.h index b379cf8354..5ad766cf10 100644 --- a/deps/icu-small/source/tools/toolutil/uparse.h +++ b/deps/icu-small/source/tools/toolutil/uparse.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/writesrc.c b/deps/icu-small/source/tools/toolutil/writesrc.c index 6fd9f75dba..e3f14f2c46 100644 --- a/deps/icu-small/source/tools/toolutil/writesrc.c +++ b/deps/icu-small/source/tools/toolutil/writesrc.c @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -48,18 +50,16 @@ usrc_createWithHeader(const char *path, const char *filename, f=fopen(p, "w"); if(f!=NULL) { - char year[8]; const struct tm *lt; time_t t; time(&t); lt=localtime(&t); - strftime(year, sizeof(year), "%Y", lt); if(generator==NULL) { strftime(buffer, sizeof(buffer), "%Y-%m-%d", lt); - fprintf(f, header, year, filename, buffer); + fprintf(f, header, filename, buffer); } else { - fprintf(f, header, year, filename, generator); + fprintf(f, header, filename, generator); } } else { fprintf( @@ -72,28 +72,34 @@ usrc_createWithHeader(const char *path, const char *filename, U_CAPI FILE * U_EXPORT2 usrc_create(const char *path, const char *filename, const char *generator) { + // TODO: Add parameter for the first year this file was generated, not before 2016. static const char *header= - "/*\n" - " * Copyright (C) 1999-%s, International Business Machines\n" - " * Corporation and others. All Rights Reserved.\n" - " *\n" - " * file name: %s\n" - " *\n" - " * machine-generated by: %s\n" - " */\n\n"; + "// Copyright (C) 2016 and later: Unicode, Inc. and others.\n" + "// License & terms of use: http://www.unicode.org/copyright.html\n" + "//\n" + "// Copyright (C) 1999-2016, International Business Machines\n" + "// Corporation and others. All Rights Reserved.\n" + "//\n" + "// file name: %s\n" + "//\n" + "// machine-generated by: %s\n" + "\n\n"; return usrc_createWithHeader(path, filename, generator, header); } U_CAPI FILE * U_EXPORT2 usrc_createTextData(const char *path, const char *filename, const char *generator) { + // TODO: Add parameter for the first year this file was generated, not before 2016. static const char *header= - "# Copyright (C) 1999-%s, International Business Machines\n" + "# Copyright (C) 2016 and later: Unicode, Inc. and others.\n" + "# License & terms of use: http://www.unicode.org/copyright.html\n" + "# Copyright (C) 1999-2016, International Business Machines\n" "# Corporation and others. All Rights Reserved.\n" "#\n" "# file name: %s\n" "#\n" "# machine-generated by: %s\n" - "#\n\n"; + "\n\n"; return usrc_createWithHeader(path, filename, generator, header); } diff --git a/deps/icu-small/source/tools/toolutil/writesrc.h b/deps/icu-small/source/tools/toolutil/writesrc.h index f4ca08103b..c82bf3c334 100644 --- a/deps/icu-small/source/tools/toolutil/writesrc.h +++ b/deps/icu-small/source/tools/toolutil/writesrc.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/xmlparser.cpp b/deps/icu-small/source/tools/toolutil/xmlparser.cpp index 8d467bac6a..2fc6e1f78c 100644 --- a/deps/icu-small/source/tools/toolutil/xmlparser.cpp +++ b/deps/icu-small/source/tools/toolutil/xmlparser.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * diff --git a/deps/icu-small/source/tools/toolutil/xmlparser.h b/deps/icu-small/source/tools/toolutil/xmlparser.h index 30bd746bef..5c08903f86 100644 --- a/deps/icu-small/source/tools/toolutil/xmlparser.h +++ b/deps/icu-small/source/tools/toolutil/xmlparser.h @@ -1,3 +1,5 @@ +// Copyright (C) 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * |