Skip to content

Commit

Permalink
deps: icu 63.1 bump (CLDR 34)
Browse files Browse the repository at this point in the history
- Full release notes: http://site.icu-project.org/download/63

Fixes: nodejs#22344

PR-URL: nodejs#23715
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
srl295 committed Oct 24, 2018
1 parent d8f2d27 commit 6786ff4
Show file tree
Hide file tree
Showing 260 changed files with 15,760 additions and 6,131 deletions.
4 changes: 2 additions & 2 deletions deps/icu-small/README-SMALL-ICU.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Small ICU sources - auto generated by shrink-icu-src.py

This directory contains the ICU subset used by --with-intl=small-icu (the default)
It is a strict subset of ICU 62 source files with the following exception(s):
* deps/icu-small/source/data/in/icudt62l.dat : Reduced-size data file
It is a strict subset of ICU 63 source files with the following exception(s):
* deps/icu-small/source/data/in/icudt63l.dat : Reduced-size data file


To rebuild this directory, see ../../tools/icu/README.md
4 changes: 2 additions & 2 deletions deps/icu-small/source/common/bmpset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
38 changes: 38 additions & 0 deletions deps/icu-small/source/common/bytesinkutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "unicode/utf8.h"
#include "unicode/utf16.h"
#include "bytesinkutil.h"
#include "charstr.h"
#include "cmemory.h"
#include "uassert.h"

Expand Down Expand Up @@ -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
22 changes: 22 additions & 0 deletions deps/icu-small/source/common/bytesinkutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
U_NAMESPACE_BEGIN

class ByteSink;
class CharString;
class Edits;

class U_COMMON_API ByteSinkUtil {
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion deps/icu-small/source/common/bytestriebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 6786ff4

Please sign in to comment.