Skip to content

Commit

Permalink
Merge branch 'main' into mihai_mf2_icu4j_errors, resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mihnita committed Sep 19, 2024
2 parents 5be286e + 5991c93 commit 25840d6
Showing 145 changed files with 906 additions and 754 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/icu4c.yml
Original file line number Diff line number Diff line change
@@ -314,8 +314,8 @@ jobs:
run: |
cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux/clang && make -j -l4.5 check
# Clang Linux 16 with CPP20 and treat warnings as errors
clang16-cpp20-warning-as-errors:
# Clang Linux 18 with CPP20 and treat warnings as errors
clang18-cpp20-warning-as-errors:
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -325,21 +325,19 @@ jobs:
- '-std=c++20 -stdlib=libc++'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Clang-16
- name: Install Clang-18
run: |
curl -Ls https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
sudo apt update
sudo apt install -qy clang-16 lld-16 libc++-16-dev libc++abi-16-dev
- name: Clang-16 build and Test
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 18 all
- name: Clang-18 build and Test
env:
CC: clang-16
CXX: clang++-16
# TODO: add '-Werror' after fixing ICU-22873
CPPFLAGS: '-Wall -Wextra -Wctad-maybe-unsupported'
CC: clang-18
CXX: clang++-18
CPPFLAGS: '-Wall -Wextra -Wctad-maybe-unsupported -Werror'
CXXFLAGS: ${{ matrix.flags }}
run: |
cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux/clang && make -j -l4.5 check
cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j -l4.5 check
# MacOS with clang
macos-clang:
15 changes: 12 additions & 3 deletions docs/processes/release/tasks/versions.md
Original file line number Diff line number Diff line change
@@ -161,7 +161,12 @@ Changing the version for Java starting with ICU 74 requires a few steps:
public static final String <b>ICU_DATA_VERSION_PATH = "74b";</b>
</pre>

2. When creating the final release of a major ICU version,
2. [icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/DebugUtilitiesData.java)

There is a public string named `ICU4C_VERSION` which should be updated accordingly.
'public static final String ICU4C_VERSION="74.0.1";'

3. When creating the final release of a major ICU version,
or a point release (minor version update on a maintenance branch),
update the Maven project version for ICU4J at the root (`icu4j/pom.xml`) and all of the submodules
with the following Maven command.
@@ -185,7 +190,7 @@ The command requires a version number string that follows the typical Java / Mav
mvn versions:set -DnewVersion=74.1 -DgenerateBackupPoms=false
```

3. Immediately after creating the final release of a major ICU version, update the value that represents just the major version number of the semantic version. To do this, update the value of the ICU `icu.major.version` property in the root Maven pom.xml file at `icu4j/pom.xml`.
4. Immediately after creating the final release of a major ICU version, update the value that represents just the major version number of the semantic version. To do this, update the value of the ICU `icu.major.version` property in the root Maven pom.xml file at `icu4j/pom.xml`.

This can be done by running the following command:

@@ -198,13 +203,17 @@ The command requires a version number string that follows the typical Java / Mav
In other words, the above `versions:set-property` step should be executed at the same time
`mvn versions:set -DnewVersion=74.0.1-SNAPSHOT` is executed.
4. Update the following variables in `icu4j/releases_tools/shared.sh`
5. Update the following variables in `icu4j/releases_tools/shared.sh`
* `artifact_version` - The version used in the Maven `pom.xml` files. You can alternatively produce this value by running `mvn help:evaluate -Dexpression=project.version -q -DforceStdout`.
* `github_rel_version` - The version used in the name of the GitHub downloadable artifacts. For example "73_2" or "74rc".
* `api_report_version` - The major version of the new version. Change during RC BRS.
* `api_report_prev_version` - The major version of the previous version. Change during RC BRS.
6. cldr-to-icu build tool has a dependency on the icu4j packages which needs to be updated in [`tools/cldr/cldr-to-icu/pom.xml`](https://github.com/unicode-org/icu/blob/main/tools/cldr/cldr-to-icu/pom.xml). Please update it to match the version that was updated in `icu4j/pom.xml` in the steps above.
`<version>74.0.1-SNAPSHOT</version>`
#### Until ICU 73 (inclusive)
Binary file modified docs/userguide/assets/gha_run_workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/userguide/assets/gha_tab.png
Binary file not shown.
3 changes: 1 addition & 2 deletions docs/userguide/dev/ci.md
Original file line number Diff line number Diff line change
@@ -128,8 +128,7 @@ which is a part of the release process.
It may be desirable to run exhaustive tests manually on a PR for areas of code that are known to need the extra test coverage provided by exhaustive tests.
To trigger exhaustive tests manually:

1. Go to your respective fork of the project (username/icu) if the PR is not already merged. Otherwise, go to https://github.com/unicode-org/icu
1. Go to your respective fork of the project (username/icu) if the PR is not already merged. Otherwise, go to https://github.com/unicode-org/icu (Note: your fork's default (main) branch should be in sync with upstream main branch for new actions to appear in your fork)
2. Select on the "Actions" tab from the top bar
![GHA Actions](../assets/gha_tab.png)
3. On the left pane under All workflows, find "Exhaustive Tests for ICU" and click on run workflow, select branch and click 'Run workflow'.
![Run Workflow](../assets/gha_run_workflow.png)
2 changes: 1 addition & 1 deletion docs/userguide/format_parse/datetime/index.md
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ Note that the examples may not reflect current CLDR data.
| --- | --- | --- | --- |
| `G` | era designator | `G`, `GG`, or `GGG`<br/>`GGGG`<br/>`GGGGG` | AD<br/>Anno Domini<br/>A |
| `y` | year | `yy`<br/>`y` or `yyyy` | 96<br/>1996 |
| `Y` | year of "Week of Year" | `Y` | 1997 |
| `Y` | year in “Week of Year” based calendars in which the year transition occurs on a week boundary; may differ from calendar year ‘y’ near a year transition. This year designation is used with pattern character ‘w’ in the ISO 8601 year-week calendar, for example. | `Y` | 1997 |
| `u` | extended year | `u` | 4601 |
| `U` | cyclic year name, as in Chinese lunar calendar | `U` | 甲子 |
| `r` | related Gregorian year | `r` | 1996 |
4 changes: 2 additions & 2 deletions icu4c/source/common/bmpset.cpp
Original file line number Diff line number Diff line change
@@ -293,14 +293,14 @@ BMPSet::contains(UChar32 c) const {
if (static_cast<uint32_t>(c) <= 0xff) {
return latin1Contains[c];
} else if (static_cast<uint32_t>(c) <= 0x7ff) {
return static_cast<UBool>((table7FF[c & 0x3f] & (static_cast<uint32_t>(1) << (c >> 6))) != 0);
return (table7FF[c & 0x3f] & (static_cast<uint32_t>(1) << (c >> 6))) != 0;
} else if (static_cast<uint32_t>(c) < 0xd800 || (c >= 0xe000 && c <= 0xffff)) {
int lead=c>>12;
uint32_t twoBits=(bmpBlockBits[(c>>6)&0x3f]>>lead)&0x10001;
if(twoBits<=1) {
// All 64 code points with the same bits 15..6
// are either in the set or not.
return static_cast<UBool>(twoBits);
return twoBits;
} else {
// Look up the code point in its 4k block of code points.
return containsSlow(c, list4kStarts[lead], list4kStarts[lead+1]);
2 changes: 1 addition & 1 deletion icu4c/source/common/bmpset.h
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ class BMPSet : public UMemory {
};

inline UBool BMPSet::containsSlow(UChar32 c, int32_t lo, int32_t hi) const {
return static_cast<UBool>(findCodePoint(c, lo, hi) & 1);
return findCodePoint(c, lo, hi) & 1;
}

U_NAMESPACE_END
2 changes: 1 addition & 1 deletion icu4c/source/common/normalizer2impl.h
Original file line number Diff line number Diff line change
@@ -364,7 +364,7 @@ class U_COMMON_API Normalizer2Impl : public UObject {
// 0<=lead<=0xffff
uint8_t bits=smallFCD[lead>>8];
if(bits==0) { return false; }
return static_cast<UBool>((bits >> ((lead >> 5) & 7)) & 1);
return (bits >> ((lead >> 5) & 7)) & 1;
}
/** Returns the FCD value from the regular normalization data. */
uint16_t getFCD16FromNormData(UChar32 c) const;
10 changes: 5 additions & 5 deletions icu4c/source/common/patternprops.cpp
Original file line number Diff line number Diff line change
@@ -120,12 +120,12 @@ PatternProps::isSyntax(UChar32 c) {
if(c<0) {
return false;
} else if(c<=0xff) {
return static_cast<UBool>(latin1[c] >> 1) & 1;
return (latin1[c] >> 1) & 1;
} else if(c<0x2010) {
return false;
} else if(c<=0x3030) {
uint32_t bits=syntax2000[index2000[(c-0x2000)>>5]];
return static_cast<UBool>((bits >> (c & 0x1f)) & 1);
return (bits >> (c & 0x1f)) & 1;
} else if(0xfd3e<=c && c<=0xfe46) {
return c<=0xfd3f || 0xfe45<=c;
} else {
@@ -138,12 +138,12 @@ PatternProps::isSyntaxOrWhiteSpace(UChar32 c) {
if(c<0) {
return false;
} else if(c<=0xff) {
return static_cast<UBool>(latin1[c] & 1);
return latin1[c] & 1;
} else if(c<0x200e) {
return false;
} else if(c<=0x3030) {
uint32_t bits=syntaxOrWhiteSpace2000[index2000[(c-0x2000)>>5]];
return static_cast<UBool>((bits >> (c & 0x1f)) & 1);
return (bits >> (c & 0x1f)) & 1;
} else if(0xfd3e<=c && c<=0xfe46) {
return c<=0xfd3f || 0xfe45<=c;
} else {
@@ -156,7 +156,7 @@ PatternProps::isWhiteSpace(UChar32 c) {
if(c<0) {
return false;
} else if(c<=0xff) {
return static_cast<UBool>(latin1[c] >> 2) & 1;
return (latin1[c] >> 2) & 1;
} else if(0x200e<=c && c<=0x2029) {
return c<=0x200f || 0x2028<=c;
} else {
4 changes: 2 additions & 2 deletions icu4c/source/common/propsvec.cpp
Original file line number Diff line number Diff line change
@@ -194,8 +194,8 @@ upvec_setValue(UPropsVectors *pv,
* input range (only possible for the first and last rows)
* and if their value differs from the input value.
*/
splitFirstRow= (UBool)(start!=(UChar32)firstRow[0] && value!=(firstRow[column]&mask));
splitLastRow= (UBool)(limit!=(UChar32)lastRow[1] && value!=(lastRow[column]&mask));
splitFirstRow = start != static_cast<UChar32>(firstRow[0]) && value != (firstRow[column] & mask);
splitLastRow = limit != static_cast<UChar32>(lastRow[1]) && value != (lastRow[column] & mask);

/* split first/last rows if necessary */
if(splitFirstRow || splitLastRow) {
6 changes: 3 additions & 3 deletions icu4c/source/common/punycode.cpp
Original file line number Diff line number Diff line change
@@ -353,10 +353,10 @@ u_strToPunycode(const char16_t *src, int32_t srcLength,
}

if(destLength<destCapacity) {
dest[destLength]=digitToBasic(q, (UBool)(cpBuffer[j]<0));
dest[destLength] = digitToBasic(q, cpBuffer[j] < 0);
}
++destLength;
bias=adaptBias(delta, handledCPCount+1, (UBool)(handledCPCount==basicLength));
bias = adaptBias(delta, handledCPCount + 1, handledCPCount == basicLength);
delta=0;
++handledCPCount;
}
@@ -500,7 +500,7 @@ u_strFromPunycode(const char16_t *src, int32_t srcLength,
* where needed instead of in for() loop tail.
*/
++destCPCount;
bias=adaptBias(i-oldi, destCPCount, (UBool)(oldi==0));
bias = adaptBias(i - oldi, destCPCount, oldi == 0);

/*
* i was supposed to wrap around from (incremented) destCPCount to 0,
12 changes: 6 additions & 6 deletions icu4c/source/common/putil.cpp
Original file line number Diff line number Diff line change
@@ -342,7 +342,7 @@ uprv_isNaN(double number)
BitPatternConversion convertedNumber;
convertedNumber.d64 = number;
/* Infinity is 0x7FF0000000000000U. Anything greater than that is a NaN */
return (UBool)((convertedNumber.i64 & U_INT64_MAX) > gInf.i64);
return (convertedNumber.i64 & U_INT64_MAX) > gInf.i64;

#elif U_PLATFORM == U_PF_OS390
uint32_t highBits = *(uint32_t*)u_topNBytesOfDouble(&number,
@@ -368,7 +368,7 @@ uprv_isInfinite(double number)
BitPatternConversion convertedNumber;
convertedNumber.d64 = number;
/* Infinity is exactly 0x7FF0000000000000U. */
return (UBool)((convertedNumber.i64 & U_INT64_MAX) == gInf.i64);
return (convertedNumber.i64 & U_INT64_MAX) == gInf.i64;
#elif U_PLATFORM == U_PF_OS390
uint32_t highBits = *(uint32_t*)u_topNBytesOfDouble(&number,
sizeof(uint32_t));
@@ -389,7 +389,7 @@ U_CAPI UBool U_EXPORT2
uprv_isPositiveInfinity(double number)
{
#if IEEE_754 || U_PLATFORM == U_PF_OS390
return (UBool)(number > 0 && uprv_isInfinite(number));
return number > 0 && uprv_isInfinite(number);
#else
return uprv_isInfinite(number);
#endif
@@ -399,7 +399,7 @@ U_CAPI UBool U_EXPORT2
uprv_isNegativeInfinity(double number)
{
#if IEEE_754 || U_PLATFORM == U_PF_OS390
return (UBool)(number < 0 && uprv_isInfinite(number));
return number < 0 && uprv_isInfinite(number);

#else
uint32_t highBits = *(uint32_t*)u_topNBytesOfDouble(&number,
@@ -744,11 +744,11 @@ static UBool isValidOlsonID(const char *id) {
The timezone is sometimes set to "CST-7CDT", "CST6CDT5,J129,J131/19:30",
"GRNLNDST3GRNLNDDT" or similar, so we cannot use it.
The rest of the time it could be an Olson ID. George */
return static_cast<UBool>(id[idx] == 0
return id[idx] == 0
|| uprv_strcmp(id, "PST8PDT") == 0
|| uprv_strcmp(id, "MST7MDT") == 0
|| uprv_strcmp(id, "CST6CDT") == 0
|| uprv_strcmp(id, "EST5EDT") == 0);
|| uprv_strcmp(id, "EST5EDT") == 0;
}

/* On some Unix-like OS, 'posix' subdirectory in
2 changes: 1 addition & 1 deletion icu4c/source/common/ubidi.cpp
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@ ubidi_setReorderingMode(UBiDi *pBiDi, UBiDiReorderingMode reorderingMode) UPRV_N
if ((pBiDi!=nullptr) && (reorderingMode >= UBIDI_REORDER_DEFAULT)
&& (reorderingMode < UBIDI_REORDER_COUNT)) {
pBiDi->reorderingMode = reorderingMode;
pBiDi->isInverse = (UBool)(reorderingMode == UBIDI_REORDER_INVERSE_NUMBERS_AS_L);
pBiDi->isInverse = reorderingMode == UBIDI_REORDER_INVERSE_NUMBERS_AS_L;
}
}

6 changes: 3 additions & 3 deletions icu4c/source/common/ubidi_props.cpp
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ ubidi_getClass(UChar32 c) {
U_CFUNC UBool
ubidi_isMirrored(UChar32 c) {
uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_IS_MIRRORED_SHIFT);
return UBIDI_GET_FLAG(props, UBIDI_IS_MIRRORED_SHIFT);
}

static UChar32
@@ -183,13 +183,13 @@ ubidi_getMirror(UChar32 c) {
U_CFUNC UBool
ubidi_isBidiControl(UChar32 c) {
uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_BIDI_CONTROL_SHIFT);
return UBIDI_GET_FLAG(props, UBIDI_BIDI_CONTROL_SHIFT);
}

U_CFUNC UBool
ubidi_isJoinControl(UChar32 c) {
uint16_t props=UTRIE2_GET16(&ubidi_props_singleton.trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_JOIN_CONTROL_SHIFT);
return UBIDI_GET_FLAG(props, UBIDI_JOIN_CONTROL_SHIFT);
}

U_CFUNC UJoiningType
10 changes: 5 additions & 5 deletions icu4c/source/common/ucase.cpp
Original file line number Diff line number Diff line change
@@ -696,17 +696,17 @@ getDotType(UChar32 c) {

U_CAPI UBool U_EXPORT2
ucase_isSoftDotted(UChar32 c) {
return (UBool)(getDotType(c)==UCASE_SOFT_DOTTED);
return getDotType(c)==UCASE_SOFT_DOTTED;
}

U_CAPI UBool U_EXPORT2
ucase_isCaseSensitive(UChar32 c) {
uint16_t props=UTRIE2_GET16(&ucase_props_singleton.trie, c);
if(!UCASE_HAS_EXCEPTION(props)) {
return (UBool)((props&UCASE_SENSITIVE)!=0);
return (props&UCASE_SENSITIVE)!=0;
} else {
const uint16_t *pe=GET_EXCEPTIONS(&ucase_props_singleton, props);
return (UBool)((*pe&UCASE_EXC_SENSITIVE)!=0);
return (*pe&UCASE_EXC_SENSITIVE)!=0;
}
}

@@ -1623,12 +1623,12 @@ ucase_toFullFolding(UChar32 c,

U_CAPI UBool U_EXPORT2
u_isULowercase(UChar32 c) {
return (UBool)(UCASE_LOWER==ucase_getType(c));
return UCASE_LOWER==ucase_getType(c);
}

U_CAPI UBool U_EXPORT2
u_isUUppercase(UChar32 c) {
return (UBool)(UCASE_UPPER==ucase_getType(c));
return UCASE_UPPER==ucase_getType(c);
}

/* Transforms the Unicode character to its lower case equivalent.*/
Loading

0 comments on commit 25840d6

Please sign in to comment.