Issue #1971 - Part 2: Update ICU source to 63.2.

This commit is contained in:
Job Bautista 2022-07-24 21:03:27 +08:00 committed by roytam1
commit 1e69214382
3160 changed files with 275815 additions and 234203 deletions

View file

@ -45,7 +45,7 @@ DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
# from icuinfo
CPPFLAGS+= "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
@ -117,7 +117,7 @@ U_CAPI int32_t
udbg_stoi(const UnicodeString &s)
{
char ch[256];
const UChar *u = s.getBuffer();
const UChar *u = toUCharPtr(s.getBuffer());
int32_t len = s.length();
u_UCharsToChars(u, ch, len);
ch[len] = 0; /* include terminating \0 */
@ -129,7 +129,7 @@ U_CAPI double
udbg_stod(const UnicodeString &s)
{
char ch[256];
const UChar *u = s.getBuffer();
const UChar *u = toUCharPtr(s.getBuffer());
int32_t len = s.length();
u_UCharsToChars(u, ch, len);
ch[len] = 0; /* include terminating \0 */

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: denseranges.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: denseranges.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@ -104,14 +104,14 @@ T_FileStream_tmpfile()
U_CAPI int32_t U_EXPORT2
T_FileStream_read(FileStream* fileStream, void* addr, int32_t len)
{
return fread(addr, 1, len, (FILE*)fileStream);
return static_cast<int32_t>(fread(addr, 1, len, (FILE*)fileStream));
}
U_CAPI int32_t U_EXPORT2
T_FileStream_write(FileStream* fileStream, const void* addr, int32_t len)
{
return fwrite(addr, 1, len, (FILE*)fileStream);
return static_cast<int32_t>(fwrite(addr, 1, len, (FILE*)fileStream));
}
U_CAPI void U_EXPORT2

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2009-2013, International Business Machines
@ -134,7 +134,7 @@ static int32_t whichFileModTimeIsLater(const char *file1, const char *file2) {
/* Swap the file separater character given with the new one in the file path. */
U_CAPI void U_EXPORT2
swapFileSepChar(char *filePath, const char oldFileSepChar, const char newFileSepChar) {
for (int32_t i = 0, length = uprv_strlen(filePath); i < length; i++) {
for (int32_t i = 0, length = static_cast<int32_t>(uprv_strlen(filePath)); i < length; i++) {
filePath[i] = (filePath[i] == oldFileSepChar ) ? newFileSepChar : filePath[i];
}
}

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: filetools.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2009-2015, International Business Machines
@ -34,9 +34,9 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize,
*status = U_FILE_ACCESS_ERROR;
goto parseFlagsFile_cleanup;
}
buffer = uprv_malloc(sizeof(char) * currentBufferSize);
tmpFlagBuffer = uprv_malloc(sizeof(char) * flagBufferSize);
buffer = (char *)uprv_malloc(sizeof(char) * currentBufferSize);
tmpFlagBuffer = (char *)uprv_malloc(sizeof(char) * flagBufferSize);
if (buffer == NULL || tmpFlagBuffer == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
@ -48,7 +48,7 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize,
allocateMoreSpace = FALSE;
currentBufferSize *= 2;
uprv_free(buffer);
buffer = uprv_malloc(sizeof(char) * currentBufferSize);
buffer = (char *)uprv_malloc(sizeof(char) * currentBufferSize);
if (buffer == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
goto parseFlagsFile_cleanup;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: flagparser.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: package.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -381,7 +381,7 @@ U_CDECL_END
U_NAMESPACE_BEGIN
Package::Package()
Package::Package()
: doAutoPrefix(FALSE), prefixEndsWithType(FALSE) {
inPkgName[0]=0;
pkgPrefix[0]=0;
@ -610,7 +610,7 @@ Package::readPackage(const char *filename) {
memcpy(prefix, s, ++prefixLength); // include the /
} else {
// Use the package basename as prefix.
int32_t inPkgNameLength=strlen(inPkgName);
int32_t inPkgNameLength= static_cast<int32_t>(strlen(inPkgName));
memcpy(prefix, inPkgName, inPkgNameLength);
prefixLength=inPkgNameLength;
@ -663,7 +663,7 @@ Package::readPackage(const char *filename) {
// set the last item's platform type
typeEnum=getTypeEnumForInputData(items[itemCount-1].data, items[itemCount-1].length, &errorCode);
if(typeEnum<0 || U_FAILURE(errorCode)) {
fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[itemCount-1].name, filename);
exit(U_INVALID_FORMAT_ERROR);
}
items[itemCount-1].type=makeTypeLetter(typeEnum);
@ -1043,7 +1043,7 @@ Package::addItem(const char *name, uint8_t *data, int32_t length, UBool isDataOw
memset(items+idx, 0, sizeof(Item));
// copy the item's name
items[idx].name=allocString(TRUE, strlen(name));
items[idx].name=allocString(TRUE, static_cast<int32_t>(strlen(name)));
strcpy(items[idx].name, name);
pathToTree(items[idx].name);
} else {
@ -1281,7 +1281,7 @@ Package::sortItems() {
}
}
void Package::setItemCapacity(int32_t max)
void Package::setItemCapacity(int32_t max)
{
if(max<=itemMax) {
return;
@ -1289,8 +1289,8 @@ void Package::setItemCapacity(int32_t max)
Item *newItems = (Item*)uprv_malloc(max * sizeof(items[0]));
Item *oldItems = items;
if(newItems == NULL) {
fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
(unsigned long)max*sizeof(items[0]), max);
fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
(unsigned long)(max*sizeof(items[0])), max);
exit(U_MEMORY_ALLOCATION_ERROR);
}
if(items && itemCount>0) {

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: package.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2009-2016, International Business Machines
@ -47,6 +47,7 @@
#include "unicode/uclean.h"
#include "uoptions.h"
#include "pkg_genc.h"
#include "filetools.h"
#define MAX_COLUMN ((uint32_t)(0xFFFFFFFFU))
@ -283,8 +284,8 @@ writeAssemblyCode(const char *filename, const char *destdir, const char *optEntr
uprv_strcpy(outFilePath, bufferStr);
}
#ifdef WINDOWS_WITH_GNUC
/* Need to fix the file seperator character when using MinGW. */
#if defined (WINDOWS_WITH_GNUC) && U_PLATFORM != U_PF_CYGWIN
/* Need to fix the file separator character when using MinGW. */
swapFileSepChar(outFilePath, U_FILE_SEP_CHAR, '/');
#endif
@ -687,12 +688,19 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
/* _M_IA64 should be defined in windows.h */
# if defined(_M_IA64)
*pCPU=IMAGE_FILE_MACHINE_IA64;
*pBits = 64;
# elif defined(_M_AMD64)
*pCPU=IMAGE_FILE_MACHINE_AMD64;
// link.exe does not really care about the .obj machine type and this will
// allow us to build a dll for both ARM & x64 with an amd64 built tool
// ARM is same as x64 except for first 2 bytes of object file
*pCPU = IMAGE_FILE_MACHINE_UNKNOWN;
// *pCPU = IMAGE_FILE_MACHINE_ARMNT; // If we wanted to be explicit
// *pCPU = IMAGE_FILE_MACHINE_AMD64; // We would use one of these names
*pBits = 64; // Doesn't seem to be used for anything interesting?
# else
*pCPU=IMAGE_FILE_MACHINE_I386;
*pCPU=IMAGE_FILE_MACHINE_I386; // We would use one of these names
*pBits = 32;
# endif
*pBits= *pCPU==IMAGE_FILE_MACHINE_I386 ? 32 : 64;
*pIsBigEndian=FALSE;
#else
# error "Unknown platform for CAN_GENERATE_OBJECTS."
@ -708,7 +716,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
length=T_FileStream_read(in, buffer.bytes, sizeof(buffer.bytes));
#ifdef U_ELF
if(length<sizeof(Elf32_Ehdr)) {
if(length<(int32_t)sizeof(Elf32_Ehdr)) {
fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
exit(U_UNSUPPORTED_ERROR);
}
@ -806,7 +814,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
/* 32-bit Elf section header table */
static Elf32_Shdr sectionHeaders32[5]={
{ /* SHN_UNDEF */
0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
{ /* .symtab */
1, /* sh_name */
@ -862,7 +870,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
/* symbol table */
static Elf32_Sym symbols32[2]={
{ /* STN_UNDEF */
0
0, 0, 0, 0, 0, 0
},
{ /* data entry point */
1, /* st_name */
@ -923,7 +931,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
/* 64-bit Elf section header table */
static Elf64_Shdr sectionHeaders64[5]={
{ /* SHN_UNDEF */
0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
{ /* .symtab */
1, /* sh_name */
@ -982,7 +990,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
*/
static Elf64_Sym symbols64[2]={
{ /* STN_UNDEF */
0
0, 0, 0, 0, 0, 0
},
{ /* data entry point */
1, /* st_name */
@ -1030,7 +1038,14 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
/* deal with options, files and the entry point name */
getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch);
printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian);
if (optMatchArch)
{
printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian);
}
else
{
printf("genccode: using architecture cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian);
}
#if U_PLATFORM_HAS_WIN32_API
if(cpu==IMAGE_FILE_MACHINE_I386) {
entryOffset=1;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008-2011, International Business Machines

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008-2012, International Business Machines
@ -103,8 +103,10 @@ addFile(const char *filename, const char *name, const char *source, UBool source
static char *
allocString(uint32_t length);
U_CDECL_BEGIN
static int
compareFiles(const void *file1, const void *file2);
U_CDECL_END
static char *
pathToFullPath(const char *path, const char *source);
@ -410,7 +412,7 @@ addFile(const char *filename, const char *name, const char *source, UBool source
if(fileCount==fileMax) {
fileMax += CHUNK_FILE_COUNT;
files = uprv_realloc(files, fileMax*sizeof(files[0])); /* note: never freed. */
files = (File *)uprv_realloc(files, fileMax*sizeof(files[0])); /* note: never freed. */
if(files==NULL) {
fprintf(stderr, "pkgdata/gencmn: Could not allocate %u bytes for %d files\n", (unsigned int)(fileMax*sizeof(files[0])), fileCount);
exit(U_MEMORY_ALLOCATION_ERROR);
@ -515,7 +517,7 @@ pathToFullPath(const char *path, const char *source) {
length = (uint32_t)(uprv_strlen(path) + 1);
newLength = (length + 1 + (int32_t)uprv_strlen(source));
fullPath = uprv_malloc(newLength);
fullPath = (char *)uprv_malloc(newLength);
if(source != NULL) {
uprv_strcpy(fullPath, source);
uprv_strcat(fullPath, U_FILE_SEP_STRING);
@ -548,15 +550,18 @@ pathToFullPath(const char *path, const char *source) {
return fullPath;
}
U_CDECL_BEGIN
static int
compareFiles(const void *file1, const void *file2) {
/* sort by basename */
return uprv_strcmp(((File *)file1)->basename, ((File *)file2)->basename);
}
U_CDECL_END
static void
fixDirToTreePath(char *s)
{
(void)s;
#if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR) || ((U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR))
char *t;
#endif

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008, International Business Machines

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008-2015, International Business Machines

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/******************************************************************************
* Copyright (C) 2008-2016, International Business Machines

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: pkg_imp.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: pkgitems.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ppucd.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -98,6 +98,7 @@ static const char *lineTypeStrings[]={
"defaults",
"block",
"cp",
"unassigned",
"algnamesrange"
};
@ -203,8 +204,17 @@ PreparsedUCD::getProps(UnicodeSet &newValues, UErrorCode &errorCode) {
UChar32 start, end;
if(!parseCodePointRange(field, start, end, errorCode)) { return NULL; }
UniProps *props;
UBool insideBlock=FALSE; // TRUE if cp or unassigned range inside the block range.
switch(lineType) {
case DEFAULTS_LINE:
// Should occur before any block/cp/unassigned line.
if(blockLineIndex>=0) {
fprintf(stderr,
"error in preparsed UCD: default line %ld after one or more block lines\n",
(long)lineNumber);
errorCode=U_PARSE_ERROR;
return NULL;
}
if(defaultLineIndex>=0) {
fprintf(stderr,
"error in preparsed UCD: second line with default properties on line %ld\n",
@ -228,9 +238,22 @@ PreparsedUCD::getProps(UnicodeSet &newValues, UErrorCode &errorCode) {
blockLineIndex=lineIndex;
break;
case CP_LINE:
case UNASSIGNED_LINE:
if(blockProps.start<=start && end<=blockProps.end) {
// Code point range fully inside the last block inherits the block properties.
cpProps=blockProps;
insideBlock=TRUE;
if(lineType==CP_LINE) {
// Code point range fully inside the last block inherits the block properties.
cpProps=blockProps;
} else {
// Unassigned line inside the block is based on default properties
// which override block properties.
cpProps=defaultProps;
newValues=blockValues;
// Except, it inherits the one blk=Block property.
int32_t blkIndex=UCHAR_BLOCK-UCHAR_INT_START;
cpProps.intProps[blkIndex]=blockProps.intProps[blkIndex];
newValues.remove((UChar32)UCHAR_BLOCK);
}
} else if(start>blockProps.end || end<blockProps.start) {
// Code point range fully outside the last block inherits the default properties.
cpProps=defaultProps;
@ -255,6 +278,22 @@ PreparsedUCD::getProps(UnicodeSet &newValues, UErrorCode &errorCode) {
while((field=nextField())!=NULL) {
if(!parseProperty(*props, field, newValues, errorCode)) { return NULL; }
}
if(lineType==BLOCK_LINE) {
blockValues=newValues;
} else if(lineType==UNASSIGNED_LINE && insideBlock) {
// Unset newValues for values that are the same as the block values.
for(int32_t prop=0; prop<UCHAR_BINARY_LIMIT; ++prop) {
if(newValues.contains(prop) && cpProps.binProps[prop]==blockProps.binProps[prop]) {
newValues.remove(prop);
}
}
for(int32_t prop=UCHAR_INT_START; prop<UCHAR_INT_LIMIT; ++prop) {
int32_t index=prop-UCHAR_INT_START;
if(newValues.contains(prop) && cpProps.intProps[index]==blockProps.intProps[index]) {
newValues.remove(prop);
}
}
}
return props;
}
@ -515,12 +554,12 @@ PreparsedUCD::parseCodePointRange(const char *s, UChar32 &start, UChar32 &end, U
void
PreparsedUCD::parseString(const char *s, UnicodeString &uni, UErrorCode &errorCode) {
UChar *buffer=uni.getBuffer(-1);
UChar *buffer=toUCharPtr(uni.getBuffer(-1));
int32_t length=u_parseString(s, buffer, uni.getCapacity(), NULL, &errorCode);
if(errorCode==U_BUFFER_OVERFLOW_ERROR) {
errorCode=U_ZERO_ERROR;
uni.releaseBuffer(0);
buffer=uni.getBuffer(length);
buffer=toUCharPtr(uni.getBuffer(length));
length=u_parseString(s, buffer, uni.getCapacity(), NULL, &errorCode);
}
uni.releaseBuffer(length);

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ppucd.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -84,6 +84,8 @@ public:
BLOCK_LINE,
/** cp;0030;AHex;bc=EN;gc=Nd;na=DIGIT ZERO;... */
CP_LINE,
/** unassigned;E01F0..E0FFF;bc=BN;CWKCF;DI;GCB=CN;NFKC_CF= */
UNASSIGNED_LINE,
/** algnamesrange;4E00..9FCC;han;CJK UNIFIED IDEOGRAPH- */
ALG_NAMES_RANGE_LINE,
@ -119,7 +121,9 @@ public:
const UVersionInfo &getUnicodeVersion() const { return ucdVersion; }
/** Returns TRUE if the current line has property values. */
UBool lineHasPropertyValues() const { return DEFAULTS_LINE<=lineType && lineType<=CP_LINE; }
UBool lineHasPropertyValues() const {
return DEFAULTS_LINE<=lineType && lineType<=UNASSIGNED_LINE;
}
/**
* Parses properties from the current line.
@ -166,6 +170,7 @@ private:
UVersionInfo ucdVersion;
UniProps defaultProps, blockProps, cpProps;
UnicodeSet blockValues;
// Multiple lines so that default and block properties can maintain pointers
// into their line buffers.
char lines[kNumLineBuffers][4096];

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: swapimpl.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -56,6 +56,7 @@
#include "sprpimpl.h"
#include "propname.h"
#include "rbbidata.h"
#include "utrie.h"
#include "utrie2.h"
#include "dictionarydata.h"
@ -242,7 +243,7 @@ uprops_swap(const UDataSwapper *ds,
* swap the main properties UTrie
* PT serialized properties trie, see utrie.h (byte size: 4*(i0-16))
*/
utrie2_swapAnyVersion(ds,
utrie_swapAnyVersion(ds,
inData32+UPROPS_INDEX_COUNT,
4*(dataIndexes[UPROPS_PROPS32_INDEX]-UPROPS_INDEX_COUNT),
outData32+UPROPS_INDEX_COUNT,
@ -273,7 +274,7 @@ uprops_swap(const UDataSwapper *ds,
* swap the additional UTrie
* i3 additionalTrieIndex; -- 32-bit unit index to the additional trie for more properties
*/
utrie2_swapAnyVersion(ds,
utrie_swapAnyVersion(ds,
inData32+dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX],
4*(dataIndexes[UPROPS_ADDITIONAL_VECTORS_INDEX]-dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX]),
outData32+dataIndexes[UPROPS_ADDITIONAL_TRIE_INDEX],
@ -335,7 +336,7 @@ ucase_swap(const UDataSwapper *ds,
((pInfo->formatVersion[0]==1 &&
pInfo->formatVersion[2]==UTRIE_SHIFT &&
pInfo->formatVersion[3]==UTRIE_INDEX_SHIFT) ||
pInfo->formatVersion[0]==2 || pInfo->formatVersion[0]==3)
(2<=pInfo->formatVersion[0] && pInfo->formatVersion[0]<=4))
)) {
udata_printError(ds, "ucase_swap(): data format %02x.%02x.%02x.%02x (format version %02x) is not recognized as case mapping data\n",
pInfo->dataFormat[0], pInfo->dataFormat[1],
@ -390,7 +391,7 @@ ucase_swap(const UDataSwapper *ds,
/* swap the UTrie */
count=indexes[UCASE_IX_TRIE_SIZE];
utrie2_swapAnyVersion(ds, inBytes+offset, count, outBytes+offset, pErrorCode);
utrie_swapAnyVersion(ds, inBytes+offset, count, outBytes+offset, pErrorCode);
offset+=count;
/* swap the uint16_t exceptions[] and unfold[] */
@ -492,7 +493,7 @@ ubidi_swap(const UDataSwapper *ds,
/* swap the UTrie */
count=indexes[UBIDI_IX_TRIE_SIZE];
utrie2_swapAnyVersion(ds, inBytes+offset, count, outBytes+offset, pErrorCode);
utrie_swapAnyVersion(ds, inBytes+offset, count, outBytes+offset, pErrorCode);
offset+=count;
/* swap the uint32_t mirrors[] */

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: swapimpl.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: toolutil.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: toolutil.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,50 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<!-- The following import will include the 'default' configuration options for VS projects. -->
<Import Project="..\..\allinone\Build.Windows.ProjectConfiguration.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{6B231032-3CB5-4EED-9210-810D666A23A0}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -81,41 +47,34 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\x64\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
</PropertyGroup>
<!-- Options that are common to *all* project configurations -->
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\include;..\..\common;..\..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>U_TOOLUTIL_IMPLEMENTATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\..\..\..\lib\icutu.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\..\..\include;..\..\common;..\..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<PrecompiledHeaderOutputFile>.\x86\Release/toolutil.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\x86\Release/</AssemblerListingLocation>
<ObjectFileName>.\x86\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\x86\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\..\bin\icutu58.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>..\..\..\bin\icutu63.dll</OutputFile>
<AdditionalDependencies>icuuc.lib;icuin.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>.\..\..\..\lib\icutu.pdb</ProgramDatabaseFile>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<BaseAddress>0x4ac00000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -126,39 +85,21 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\..\..\..\lib\icutud.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\include;..\..\common;..\..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<PrecompiledHeaderOutputFile>.\x86\Debug/toolutil.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\x86\Debug/</AssemblerListingLocation>
<ObjectFileName>.\x86\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\x86\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\..\bin\icutu58d.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>..\..\..\bin\icutu63d.dll</OutputFile>
<AdditionalDependencies>icuucd.lib;icuind.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\..\..\..\lib\icutud.pdb</ProgramDatabaseFile>
<BaseAddress>0x4ac00000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -169,84 +110,48 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\..\..\..\lib64\icutu.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\..\..\include;..\..\common;..\..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<PrecompiledHeaderOutputFile>.\x64\Release/toolutil.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\x64\Release/</AssemblerListingLocation>
<ObjectFileName>.\x64\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\x64\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\..\bin64\icutu58.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>..\..\..\bin64\icutu63.dll</OutputFile>
<AdditionalDependencies>icuuc.lib;icuin.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>.\..\..\..\lib64\icutu.pdb</ProgramDatabaseFile>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<BaseAddress>0x4ac00000</BaseAddress>
<ImportLibrary>..\..\..\lib64\icutu.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>X64</TargetEnvironment>
<TypeLibraryName>.\..\..\..\lib64\icutud.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\include;..\..\common;..\..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;U_TOOLUTIL_IMPLEMENTATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<PrecompiledHeaderOutputFile>.\x64\Debug/toolutil.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\x64\Debug/</AssemblerListingLocation>
<ObjectFileName>.\x64\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\x64\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\..\bin64\icutu58d.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>..\..\..\bin64\icutu63d.dll</OutputFile>
<AdditionalDependencies>icuucd.lib;icuind.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\..\..\..\lib64\icutud.pdb</ProgramDatabaseFile>
<BaseAddress>0x4ac00000</BaseAddress>
<ImportLibrary>..\..\..\lib64\icutud.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@ -254,14 +159,14 @@
<DisableLanguageExtensions>false</DisableLanguageExtensions>
</ClCompile>
<ClCompile Include="denseranges.cpp" />
<ClCompile Include="filestrm.c" />
<ClCompile Include="filestrm.cpp" />
<ClCompile Include="filetools.cpp" />
<ClCompile Include="flagparser.c" />
<ClCompile Include="flagparser.cpp" />
<ClCompile Include="package.cpp" />
<ClCompile Include="pkg_genc.c">
<ClCompile Include="pkg_genc.cpp">
<DisableLanguageExtensions>false</DisableLanguageExtensions>
</ClCompile>
<ClCompile Include="pkg_gencmn.c">
<ClCompile Include="pkg_gencmn.cpp">
<DisableLanguageExtensions>false</DisableLanguageExtensions>
</ClCompile>
<ClCompile Include="pkg_icu.cpp" />
@ -276,12 +181,12 @@
<DisableLanguageExtensions>false</DisableLanguageExtensions>
</ClCompile>
<ClCompile Include="ucbuf.cpp" />
<ClCompile Include="ucm.c" />
<ClCompile Include="ucmstate.c" />
<ClCompile Include="unewdata.c" />
<ClCompile Include="uoptions.c" />
<ClCompile Include="uparse.c" />
<ClCompile Include="writesrc.c" />
<ClCompile Include="ucm.cpp" />
<ClCompile Include="ucmstate.cpp" />
<ClCompile Include="unewdata.cpp" />
<ClCompile Include="uoptions.cpp" />
<ClCompile Include="uparse.cpp" />
<ClCompile Include="writesrc.cpp" />
<ClCompile Include="xmlparser.cpp">
<DisableLanguageExtensions>false</DisableLanguageExtensions>
</ClCompile>
@ -319,17 +224,7 @@
<ClInclude Include="dbgutil.h" />
<ClInclude Include="udbgutil.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\common.vcxproj">
<Project>{73c0a65b-d1f2-4de1-b3a6-15dad2c23f3d}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\i18n\i18n.vcxproj">
<Project>{0178b127-6269-407d-b112-93877bb62776}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: ucm.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -199,9 +199,9 @@ compareMappings(UCMTable *lTable, const UCMapping *l,
/* compare the flags */
return l->f-r->f;
}
U_CDECL_BEGIN
/* sorting by Unicode first sorts mappings directly */
static int32_t
static int32_t U_CALLCONV
compareMappingsUnicodeFirst(const void *context, const void *left, const void *right) {
return compareMappings(
(UCMTable *)context, (const UCMapping *)left,
@ -209,7 +209,7 @@ compareMappingsUnicodeFirst(const void *context, const void *left, const void *r
}
/* sorting by bytes first sorts the reverseMap; use indirection to mappings */
static int32_t
static int32_t U_CALLCONV
compareMappingsBytesFirst(const void *context, const void *left, const void *right) {
UCMTable *table=(UCMTable *)context;
int32_t l=*(const int32_t *)left, r=*(const int32_t *)right;
@ -217,6 +217,7 @@ compareMappingsBytesFirst(const void *context, const void *left, const void *rig
table, table->mappings+l,
table, table->mappings+r, FALSE);
}
U_CDECL_END
U_CAPI void U_EXPORT2
ucm_sortTable(UCMTable *t) {
@ -310,6 +311,8 @@ enum {
static uint8_t
checkBaseExtUnicode(UCMStates *baseStates, UCMTable *base, UCMTable *ext,
UBool moveToExt, UBool intersectBase) {
(void)baseStates;
UCMapping *mb, *me, *mbLimit, *meLimit;
int32_t cmp;
uint8_t result;
@ -1043,6 +1046,7 @@ ucm_mappingType(UCMStates *baseStates,
UCMapping *m,
UChar32 codePoints[UCNV_EXT_MAX_UCHARS],
uint8_t bytes[UCNV_EXT_MAX_BYTES]) {
(void)codePoints;
/* check validity of the bytes and count the characters in them */
int32_t count=ucm_countChars(baseStates, bytes, m->bLen);
if(count<1) {

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ucm.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: ucmstate.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -916,10 +916,13 @@ compactToUnicodeHelper(UCMStates *states,
}
}
static int32_t
U_CDECL_BEGIN
static int32_t U_CALLCONV
compareFallbacks(const void *context, const void *fb1, const void *fb2) {
(void)context;
return ((const _MBCSToUFallback *)fb1)->offset-((const _MBCSToUFallback *)fb2)->offset;
}
U_CDECL_END
U_CAPI void U_EXPORT2
ucm_optimizeStates(UCMStates *states,

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
@ -351,8 +351,10 @@ int32_t udbg_enumByName(UDebugEnumType type, const char *value) {
*/
U_CAPI const char *udbg_getPlatform(void)
{
#if U_PLATFORM_HAS_WIN32_API
#if U_PLATFORM_USES_ONLY_WIN32_API
return "Windows";
#elif U_PLATFORM == U_PF_CYGWIN
return "Cygwin";
#elif U_PLATFORM == U_PF_UNKNOWN
return "unknown";
#elif U_PLATFORM == U_PF_DARWIN
@ -398,7 +400,7 @@ U_CAPI int32_t
paramStatic(const USystemParams *param, char *target, int32_t targetCapacity, UErrorCode *status) {
if(param->paramStr==NULL) return paramEmpty(param,target,targetCapacity,status);
if(U_FAILURE(*status))return 0;
int32_t len = uprv_strlen(param->paramStr);
int32_t len = static_cast<int32_t>(uprv_strlen(param->paramStr));
if(target!=NULL) {
uprv_strncpy(target,param->paramStr,uprv_min(len,targetCapacity));
}
@ -410,14 +412,14 @@ static const char *nullString = "(null)";
static int32_t stringToStringBuffer(char *target, int32_t targetCapacity, const char *str, UErrorCode *status) {
if(str==NULL) str=nullString;
int32_t len = uprv_strlen(str);
int32_t len = static_cast<int32_t>(uprv_strlen(str));
if (U_SUCCESS(*status)) {
if(target!=NULL) {
uprv_strncpy(target,str,uprv_min(len,targetCapacity));
}
} else {
const char *s = u_errorName(*status);
len = uprv_strlen(s);
len = static_cast<int32_t>(uprv_strlen(s));
if(target!=NULL) {
uprv_strncpy(target,s,uprv_min(len,targetCapacity));
}
@ -552,7 +554,6 @@ static const USystemParams systemParams[] = {
#endif
{ "uconfig.internal_digitlist", paramInteger, "b", 1}, /* always 1 */
{ "uconfig.have_parseallinput", paramInteger, "b", UCONFIG_HAVE_PARSEALLINPUT},
{ "uconfig.format_fastpaths_49",paramInteger, "b", UCONFIG_FORMAT_FASTPATHS_49},
};
@ -613,40 +614,6 @@ U_CAPI char *udbg_knownIssueURLFrom(const char *ticket, char *buf) {
}
#if !U_HAVE_STD_STRING
const char *warning = "WARNING: Don't have std::string (STL) - known issue logs will be deficient.";
U_CAPI void *udbg_knownIssue_openU(void *ptr, const char *ticket, char *where, const UChar *msg, UBool *firstForTicket,
UBool *firstForWhere) {
if(ptr==NULL) {
puts(warning);
}
printf("%s\tKnown Issue #%s\n", where, ticket);
return (void*)warning;
}
U_CAPI void *udbg_knownIssue_open(void *ptr, const char *ticket, char *where, const char *msg, UBool *firstForTicket,
UBool *firstForWhere) {
if(ptr==NULL) {
puts(warning);
}
if(msg==NULL) msg = "";
printf("%s\tKnown Issue #%s \"%s\n", where, ticket, msg);
return (void*)warning;
}
U_CAPI UBool udbg_knownIssue_print(void *ptr) {
puts(warning);
return FALSE;
}
U_CAPI void udbg_knownIssue_close(void *ptr) {
// nothing to do
}
#else
#include <set>
#include <map>
#include <string>
@ -785,5 +752,3 @@ U_CAPI void udbg_knownIssue_close(void *ptr) {
KnownIssues *t = static_cast<KnownIssues*>(ptr);
delete t;
}
#endif

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
************************************************************************

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: unewdata.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -61,17 +61,17 @@ udata_create(const char *dir, const char *type, const char *name,
length = 0; /* Start with nothing */
if(dir != NULL && *dir !=0) /* Add directory length if one was given */
{
length += strlen(dir);
length += static_cast<int32_t>(strlen(dir));
/* Add 1 if dir doesn't end with path sep */
if (dir[strlen(dir) - 1]!= U_FILE_SEP_CHAR) {
length++;
}
}
length += strlen(name); /* Add the filename length */
length += static_cast<int32_t>(strlen(name)); /* Add the filename length */
if(type != NULL && *type !=0) { /* Add directory length if given */
length += strlen(type);
length += static_cast<int32_t>(strlen(type));
}

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: unewdata.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: uoptions.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: uoptions.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: uparse.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -77,7 +77,7 @@ u_parseDelimitedFile(const char *filename, char delimiter,
UParseLineFn *lineFn, void *context,
UErrorCode *pErrorCode) {
FileStream *file;
char line[300];
char line[10000];
char *start, *limit;
int32_t i, length;
@ -163,7 +163,7 @@ u_parseDelimitedFile(const char *filename, char delimiter,
}
}
/* error in a field function? */
/* too few fields? */
if(U_FAILURE(*pErrorCode)) {
break;
}

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: uparse.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: writesrc.c
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -22,13 +22,14 @@
#include <time.h>
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/ucptrie.h"
#include "utrie2.h"
#include "cstring.h"
#include "writesrc.h"
static FILE *
usrc_createWithHeader(const char *path, const char *filename,
const char *generator, const char *header) {
const char *header, const char *generator) {
char buffer[1024];
const char *p;
char *q;
@ -71,20 +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=
"// 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);
usrc_create(const char *path, const char *filename, int32_t copyrightYear, const char *generator) {
const char *header;
char buffer[200];
if(copyrightYear<=2016) {
header=
"// © 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";
} else {
sprintf(buffer,
"// © %d and later: Unicode, Inc. and others.\n"
"// License & terms of use: http://www.unicode.org/copyright.html\n"
"//\n"
"// file name: %%s\n"
"//\n"
"// machine-generated by: %%s\n"
"\n\n",
(int)copyrightYear);
header=buffer;
}
return usrc_createWithHeader(path, filename, header, generator);
}
U_CAPI FILE * U_EXPORT2
@ -100,7 +115,7 @@ usrc_createTextData(const char *path, const char *filename, const char *generato
"#\n"
"# machine-generated by: %s\n"
"\n\n";
return usrc_createWithHeader(path, filename, generator, header);
return usrc_createWithHeader(path, filename, header, generator);
}
U_CAPI void U_EXPORT2
@ -228,6 +243,68 @@ usrc_writeUTrie2Struct(FILE *f,
}
}
U_CAPI void U_EXPORT2
usrc_writeUCPTrieArrays(FILE *f,
const char *indexPrefix, const char *dataPrefix,
const UCPTrie *pTrie,
const char *postfix) {
usrc_writeArray(f, indexPrefix, pTrie->index, 16, pTrie->indexLength, postfix);
int32_t width=
pTrie->valueWidth==UCPTRIE_VALUE_BITS_16 ? 16 :
pTrie->valueWidth==UCPTRIE_VALUE_BITS_32 ? 32 :
pTrie->valueWidth==UCPTRIE_VALUE_BITS_8 ? 8 : 0;
usrc_writeArray(f, dataPrefix, pTrie->data.ptr0, width, pTrie->dataLength, postfix);
}
U_CAPI void U_EXPORT2
usrc_writeUCPTrieStruct(FILE *f,
const char *prefix,
const UCPTrie *pTrie,
const char *indexName, const char *dataName,
const char *postfix) {
if(prefix!=NULL) {
fputs(prefix, f);
}
fprintf(
f,
" %s,\n" // index
" { %s },\n", // data (union)
indexName,
dataName);
fprintf(
f,
" %ld, %ld,\n" // indexLength, dataLength
" 0x%lx, 0x%x,\n" // highStart, shifted12HighStart
" %d, %d,\n" // type, valueWidth
" 0, 0,\n" // reserved32, reserved16
" 0x%x, 0x%lx,\n" // index3NullOffset, dataNullOffset
" 0x%lx,\n", // nullValue
(long)pTrie->indexLength, (long)pTrie->dataLength,
(long)pTrie->highStart, pTrie->shifted12HighStart,
pTrie->type, pTrie->valueWidth,
pTrie->index3NullOffset, (long)pTrie->dataNullOffset,
(long)pTrie->nullValue);
if(postfix!=NULL) {
fputs(postfix, f);
}
}
U_CAPI void U_EXPORT2
usrc_writeUCPTrie(FILE *f, const char *name, const UCPTrie *pTrie) {
int32_t width=
pTrie->valueWidth==UCPTRIE_VALUE_BITS_16 ? 16 :
pTrie->valueWidth==UCPTRIE_VALUE_BITS_32 ? 32 :
pTrie->valueWidth==UCPTRIE_VALUE_BITS_8 ? 8 : 0;
char line[100], line2[100], line3[100];
sprintf(line, "static const uint16_t %s_trieIndex[%%ld]={\n", name);
sprintf(line2, "static const uint%d_t %s_trieData[%%ld]={\n", (int)width, name);
usrc_writeUCPTrieArrays(f, line, line2, pTrie, "\n};\n\n");
sprintf(line, "static const UCPTrie %s_trie={\n", name);
sprintf(line2, "%s_trieIndex", name);
sprintf(line3, "%s_trieData", name);
usrc_writeUCPTrieStruct(f, line, pTrie, line2, line3, "};\n\n");
}
U_CAPI void U_EXPORT2
usrc_writeArrayOfMostlyInvChars(FILE *f,
const char *prefix,

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: writesrc.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -23,6 +23,7 @@
#include <stdio.h>
#include "unicode/utypes.h"
#include "unicode/ucptrie.h"
#include "utrie2.h"
/**
@ -30,7 +31,7 @@
* Writes a C/Java-style comment with the generator name.
*/
U_CAPI FILE * U_EXPORT2
usrc_create(const char *path, const char *filename, const char *generator);
usrc_create(const char *path, const char *filename, int32_t copyrightYear, const char *generator);
/**
* Creates a source text file and writes a header comment with the ICU copyright.
@ -75,6 +76,33 @@ usrc_writeUTrie2Struct(FILE *f,
const char *indexName, const char *dataName,
const char *postfix);
/**
* Calls usrc_writeArray() for the index and data arrays of a UCPTrie.
*/
U_CAPI void U_EXPORT2
usrc_writeUCPTrieArrays(FILE *f,
const char *indexPrefix, const char *dataPrefix,
const UCPTrie *pTrie,
const char *postfix);
/**
* Writes the UCPTrie struct values.
* The {} and declaration etc. need to be included in prefix/postfix or
* printed before and after the array contents.
*/
U_CAPI void U_EXPORT2
usrc_writeUCPTrieStruct(FILE *f,
const char *prefix,
const UCPTrie *pTrie,
const char *indexName, const char *dataName,
const char *postfix);
/**
* Writes the UCPTrie arrays and struct values.
*/
U_CAPI void U_EXPORT2
usrc_writeUCPTrie(FILE *f, const char *name, const UCPTrie *pTrie);
/**
* Writes the contents of an array of mostly invariant characters.
* Characters 0..0x1f are printed as numbers,

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: xmlparser.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -209,7 +209,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
goto exit;
}
buffer=src.getBuffer(bytesLength);
buffer=toUCharPtr(src.getBuffer(bytesLength));
if(buffer==NULL) {
// unexpected failure to reserve some string capacity
errorCode=U_MEMORY_ALLOCATION_ERROR;
@ -278,7 +278,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
pb=bytes;
for(;;) {
length=src.length();
buffer=src.getBuffer(capacity);
buffer=toUCharPtr(src.getBuffer(capacity));
if(buffer==NULL) {
// unexpected failure to reserve some string capacity
errorCode=U_MEMORY_ALLOCATION_ERROR;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: xmlparser.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*