Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8218640: Update ICU4C to version 64.2 #10

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
The table of contents is too big for display.

Always

Just for now

@@ -1,12 +1,12 @@
## IBM International Components for Unicode (ICU4C) v62.1
## IBM International Components for Unicode (ICU4C) v64.2

### ICU License
```
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
Copyright © 1991-2018 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Copyright © 1991-2019 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
@@ -81,6 +81,7 @@ set(ICU_COMMON_SOURCES
source/common/bytestrie.cpp
source/common/bytestrieiterator.cpp
source/common/caniter.cpp
source/common/characterproperties.cpp
source/common/chariter.cpp
source/common/charstr.cpp
source/common/cmemory.cpp
@@ -96,8 +97,8 @@ set(ICU_COMMON_SOURCES
source/common/filterednormalizer2.cpp
source/common/icudataver.cpp
source/common/icuplug.cpp
source/common/listformatter.cpp
source/common/loadednormalizer2impl.cpp
source/common/localebuilder.cpp
source/common/locavailable.cpp
source/common/locbased.cpp
source/common/locdispnames.cpp
@@ -186,6 +187,7 @@ set(ICU_COMMON_SOURCES
source/common/ucnv_u7.cpp
source/common/ucnv_u8.cpp
source/common/ucol_swp.cpp
source/common/ucptrie.cpp
source/common/ucurr.cpp
source/common/udata.cpp
source/common/udatamem.cpp
@@ -198,12 +200,12 @@ set(ICU_COMMON_SOURCES
source/common/uinvchar.cpp
source/common/uiter.cpp
source/common/ulist.cpp
source/common/ulistformatter.cpp
source/common/uloc.cpp
source/common/uloc_keytype.cpp
source/common/uloc_tag.cpp
source/common/umapfile.cpp
source/common/umath.cpp
source/common/umutablecptrie.cpp
source/common/umutex.cpp
source/common/unames.cpp
source/common/unifiedcache.cpp
@@ -250,6 +252,7 @@ set(ICU_COMMON_SOURCES
source/common/util_props.cpp
source/common/utrace.cpp
source/common/utrie2_builder.cpp
source/common/utrie_swap.cpp
source/common/utrie2.cpp
source/common/utrie.cpp
source/common/uts46.cpp
@@ -343,11 +346,15 @@ set(ICU_I18N_SOURCES
source/i18n/dtitvinf.cpp
source/i18n/dtptngen.cpp
source/i18n/dtrule.cpp
source/i18n/erarules.cpp
source/i18n/esctrn.cpp
source/i18n/ethpccal.cpp
source/i18n/fmtable.cpp
source/i18n/fmtable_cnv.cpp
source/i18n/format.cpp
source/i18n/formattedval_iterimpl.cpp
source/i18n/formattedval_sbimpl.cpp
source/i18n/formattedvalue.cpp
source/i18n/fphdlimp.cpp
source/i18n/fpositer.cpp
source/i18n/funcrepl.cpp
@@ -359,6 +366,7 @@ set(ICU_I18N_SOURCES
source/i18n/inputext.cpp
source/i18n/islamcal.cpp
source/i18n/japancal.cpp
source/i18n/listformatter.cpp
source/i18n/measfmt.cpp
source/i18n/measunit.cpp
source/i18n/measure.cpp
@@ -386,6 +394,7 @@ set(ICU_I18N_SOURCES
source/i18n/number_modifiers.cpp
source/i18n/number_multiplier.cpp
source/i18n/number_notation.cpp
source/i18n/number_output.cpp
source/i18n/number_padding.cpp
source/i18n/number_patternmodifier.cpp
source/i18n/number_patternstring.cpp
@@ -405,6 +414,8 @@ set(ICU_I18N_SOURCES
source/i18n/numparse_stringsegment.cpp
source/i18n/numparse_symbols.cpp
source/i18n/numparse_validators.cpp
source/i18n/numrange_fluent.cpp
source/i18n/numrange_impl.cpp
source/i18n/numsys.cpp
source/i18n/olsontz.cpp
source/i18n/persncal.cpp
@@ -472,6 +483,7 @@ set(ICU_I18N_SOURCES
source/i18n/udatpg.cpp
source/i18n/ufieldpositer.cpp
source/i18n/uitercollationiterator.cpp
source/i18n/ulistformatter.cpp
source/i18n/ulocdata.cpp
source/i18n/umsg.cpp
source/i18n/unesctrn.cpp
@@ -519,22 +531,33 @@ target_link_libraries(icui18n PUBLIC icuuc)

###### tools BEGIN ####
set(ICU_TOOLSUTILS_SOURCES
source/tools/toolutil/collationinfo.cpp
source/tools/toolutil/dbgutil.cpp
source/tools/toolutil/denseranges.cpp
source/tools/toolutil/filestrm.cpp
source/tools/toolutil/filetools.cpp
source/tools/toolutil/flagparser.cpp
source/tools/toolutil/package.cpp
source/tools/toolutil/pkgitems.cpp
source/tools/toolutil/ppucd.cpp
source/tools/toolutil/swapimpl.cpp
source/tools/toolutil/toolutil.cpp
source/tools/toolutil/unewdata.cpp
source/tools/toolutil/ucln_tu.cpp
source/tools/toolutil/ucm.cpp
source/tools/toolutil/ucmstate.cpp
source/tools/toolutil/udbgutil.cpp
source/tools/toolutil/uoptions.cpp
source/tools/toolutil/uparse.cpp
source/tools/toolutil/ucbuf.cpp
source/tools/toolutil/writesrc.cpp
source/tools/toolutil/pkg_genc.cpp
source/tools/toolutil/pkg_gencmn.cpp
source/tools/toolutil/pkg_icu.cpp
source/tools/toolutil/xmlparser.cpp

java/data/data_as_asm.cpp
source/stubdata/stubdata.cpp
source/stubdata/stubdata.cpp
)

add_executable(data_as_asm ${ICU_TOOLSUTILS_SOURCES})
@@ -1,7 +1,7 @@
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)

Copyright © 1991-2018 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Copyright © 1991-2019 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
@@ -241,13 +241,13 @@ void BMPSet::overrideIllegal() {
bmpBlockBits[i]|=bits;
}

mask=~(0x10001<<0xd); // Lead byte 0xED.
mask= static_cast<uint32_t>(~(0x10001<<0xd)); // Lead byte 0xED.
bits=1<<0xd;
for(i=32; i<64; ++i) { // Second half of 4k block.
bmpBlockBits[i]=(bmpBlockBits[i]&mask)|bits;
}
} else {
mask=~(0x10001<<0xd); // Lead byte 0xED.
mask= static_cast<uint32_t>(~(0x10001<<0xd)); // Lead byte 0xED.
for(i=32; i<64; ++i) { // Second half of 4k block.
bmpBlockBits[i]&=mask;
}
@@ -124,13 +124,12 @@ static void U_CALLCONV _deleteEngine(void *obj) {
U_CDECL_END
U_NAMESPACE_BEGIN

static UMutex gBreakEngineMutex = U_MUTEX_INITIALIZER;

const LanguageBreakEngine *
ICULanguageBreakFactory::getEngineFor(UChar32 c) {
const LanguageBreakEngine *lbe = NULL;
UErrorCode status = U_ZERO_ERROR;

static UMutex gBreakEngineMutex = U_MUTEX_INITIALIZER;
Mutex m(&gBreakEngineMutex);

if (fEngines == NULL) {
@@ -11,6 +11,7 @@
#include "unicode/utf8.h"
#include "unicode/utf16.h"
#include "bytesinkutil.h"
#include "charstr.h"
#include "cmemory.h"
#include "uassert.h"

@@ -120,4 +121,41 @@ ByteSinkUtil::appendUnchanged(const uint8_t *s, const uint8_t *limit,
return TRUE;
}

CharStringByteSink::CharStringByteSink(CharString* dest) : dest_(*dest) {
}

CharStringByteSink::~CharStringByteSink() = default;

void
CharStringByteSink::Append(const char* bytes, int32_t n) {
UErrorCode status = U_ZERO_ERROR;
dest_.append(bytes, n, status);
// Any errors are silently ignored.
}

char*
CharStringByteSink::GetAppendBuffer(int32_t min_capacity,
int32_t desired_capacity_hint,
char* scratch,
int32_t scratch_capacity,
int32_t* result_capacity) {
if (min_capacity < 1 || scratch_capacity < min_capacity) {
*result_capacity = 0;
return nullptr;
}

UErrorCode status = U_ZERO_ERROR;
char* result = dest_.getAppendBuffer(
min_capacity,
desired_capacity_hint,
*result_capacity,
status);
if (U_SUCCESS(status)) {
return result;
}

*result_capacity = scratch_capacity;
return scratch;
}

U_NAMESPACE_END
@@ -13,6 +13,7 @@
U_NAMESPACE_BEGIN

class ByteSink;
class CharString;
class Edits;

class U_COMMON_API ByteSinkUtil {
@@ -58,4 +59,25 @@ class U_COMMON_API ByteSinkUtil {
ByteSink &sink, uint32_t options, Edits *edits);
};

class CharStringByteSink : public ByteSink {
public:
CharStringByteSink(CharString* dest);
~CharStringByteSink() override;

CharStringByteSink() = delete;
CharStringByteSink(const CharStringByteSink&) = delete;
CharStringByteSink& operator=(const CharStringByteSink&) = delete;

void Append(const char* bytes, int32_t n) override;

char* GetAppendBuffer(int32_t min_capacity,
int32_t desired_capacity_hint,
char* scratch,
int32_t scratch_capacity,
int32_t* result_capacity) override;

private:
CharString& dest_;
};

U_NAMESPACE_END
@@ -339,7 +339,8 @@ BytesTrieBuilder::indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, UChar

BytesTrieBuilder::BTLinearMatchNode::BTLinearMatchNode(const char *bytes, int32_t len, Node *nextNode)
: LinearMatchNode(len, nextNode), s(bytes) {
hash=hash*37+ustr_hashCharsN(bytes, len);
hash=static_cast<int32_t>(
static_cast<uint32_t>(hash)*37u + static_cast<uint32_t>(ustr_hashCharsN(bytes, len)));
}

UBool
@@ -0,0 +1,97 @@
// © 2018 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

#ifndef __CAPI_HELPER_H__
#define __CAPI_HELPER_H__

#include "unicode/utypes.h"

U_NAMESPACE_BEGIN

/**
* An internal helper class to help convert between C and C++ APIs.
*/
template<typename CType, typename CPPType, int32_t kMagic>
class IcuCApiHelper {
public:
/**
* Convert from the C type to the C++ type (const version).
*/
static const CPPType* validate(const CType* input, UErrorCode& status);

/**
* Convert from the C type to the C++ type (non-const version).
*/
static CPPType* validate(CType* input, UErrorCode& status);

/**
* Convert from the C++ type to the C type (const version).
*/
const CType* exportConstForC() const;

/**
* Convert from the C++ type to the C type (non-const version).
*/
CType* exportForC();

/**
* Invalidates the object.
*/
~IcuCApiHelper();

private:
/**
* While the object is valid, fMagic equals kMagic.
*/
int32_t fMagic = kMagic;
};


template<typename CType, typename CPPType, int32_t kMagic>
const CPPType*
IcuCApiHelper<CType, CPPType, kMagic>::validate(const CType* input, UErrorCode& status) {
if (U_FAILURE(status)) {
return nullptr;
}
if (input == nullptr) {
status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
}
auto* impl = reinterpret_cast<const CPPType*>(input);
if (static_cast<const IcuCApiHelper<CType, CPPType, kMagic>*>(impl)->fMagic != kMagic) {
status = U_INVALID_FORMAT_ERROR;
return nullptr;
}
return impl;
}

template<typename CType, typename CPPType, int32_t kMagic>
CPPType*
IcuCApiHelper<CType, CPPType, kMagic>::validate(CType* input, UErrorCode& status) {
auto* constInput = static_cast<const CType*>(input);
auto* validated = validate(constInput, status);
return const_cast<CPPType*>(validated);
}

template<typename CType, typename CPPType, int32_t kMagic>
const CType*
IcuCApiHelper<CType, CPPType, kMagic>::exportConstForC() const {
return reinterpret_cast<const CType*>(static_cast<const CPPType*>(this));
}

template<typename CType, typename CPPType, int32_t kMagic>
CType*
IcuCApiHelper<CType, CPPType, kMagic>::exportForC() {
return reinterpret_cast<CType*>(static_cast<CPPType*>(this));
}

template<typename CType, typename CPPType, int32_t kMagic>
IcuCApiHelper<CType, CPPType, kMagic>::~IcuCApiHelper() {
// head off application errors by preventing use of of deleted objects.
fMagic = 0;
}


U_NAMESPACE_END

#endif // __CAPI_HELPER_H__
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.