diff --git a/.bazeliskrc b/.bazeliskrc new file mode 100644 index 00000000000..7f64ba6fa62 --- /dev/null +++ b/.bazeliskrc @@ -0,0 +1,9 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# .bazeliskrc is the configuration file for the wrapper program for the Bazel +# build system, called Bazelisk. Bazelisk can be used as a drop-in replacement +# for running Bazel commands while ensuring, through configuration, that only a +# specific version of Bazel is executed. + +USE_BAZEL_VERSION=3.7.1 diff --git a/.gitignore b/.gitignore index 4efac556dfe..626facc5f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ *.vcxproj.user *_debug *_release +bazel-* cygicudata* libicu* libicutest* diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 00000000000..dbaa1776055 --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,5 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This file tells Bazel where the root directory of the project is. +# "Target" and file paths in Bazel BUILD files are relative to this root directory. diff --git a/icu4c/source/common/BUILD b/icu4c/source/common/BUILD new file mode 100644 index 00000000000..51c0ad458e8 --- /dev/null +++ b/icu4c/source/common/BUILD @@ -0,0 +1,356 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This file defines Bazel targets for a subset of ICU4C "common" library header and source files. +# The configuration of dependencies among targets is strongly assisted by the +# file in depstest that maintains such information, at +# icu4c/source/test/depstest/dependencies.txt . + +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + +package( + default_visibility = ["//visibility:public"], +) + +# When compiling code in the `common` dir, the constant +# `U_COMMON_IMPLEMENTATION` needs to be defined. See +# https://unicode-org.github.io/icu/userguide/howtouseicu#c-with-your-own-build-system . + +# If linker errors occur, then this may be a sign that the dependencies were +# not specified correctly. Use dependencies.txt in depstest for assistance. See +# https://stackoverflow.com/q/66111709/2077918 . + +cc_library( + name = "headers", + hdrs = glob([ + "unicode/*.h", # public + "*.h", # internal + ], + # Instead of using this checked-in file, our Bazel build process + # regenerates this file and then uses the new version. + exclude = ["norm2_nfc_data.h"], + ), + # We need to add includes in order to preserve existing source files' + # include directives that use traditional paths, not paths relative to + # Bazel workspace: + # https://stackoverflow.com/a/65635893/2077918 + includes = ["."], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "platform", + srcs = [ + "cmemory.cpp", + "uobject.cpp", + "cstring.cpp", + "cwchar.cpp", + "uinvchar.cpp", + "charstr.cpp", + "unistr.cpp", + "appendable.cpp", + "stringpiece.cpp", + "ustrtrns.cpp", + "ustring.cpp", + "ustrfmt.cpp", + "utf_impl.cpp", + "putil.cpp", + "ucln_cmn.cpp", + "udataswp.cpp", + "umath.cpp", + "umutex.cpp", + "sharedobject.cpp", + "utrace.cpp", + ], + deps = [ + ":headers", + # omit other deps b/c they are sys symbols + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], + linkopts = ["-ldl"], +) + +cc_library( + name = "utrie", + srcs = ["utrie.cpp"], + deps = [":platform"], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "utrie2", + srcs = ["utrie2.cpp"], + deps = [":platform"], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "utrie2_builder", + srcs = ["utrie2_builder.cpp"], + deps = [ + ":utrie", + ":utrie2", + ":platform", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "ucptrie", + srcs = ["ucptrie.cpp"], + deps = [":platform"], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "umutablecptrie", + srcs = ["umutablecptrie.cpp"], + deps = [":ucptrie"], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "bytestrie", + srcs = ["bytestrie.cpp"], + deps = [":platform"], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "bytestriebuilder", + srcs = ["bytestriebuilder.cpp"], + deps = [ + ":bytestrie", + ":stringtriebuilder", + ":sort", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "stringtriebuilder", + srcs = ["stringtriebuilder.cpp"], + deps = [ + ":uhash", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "uhash", + hdrs = [ + "uhash.h", + ], + srcs = [ + "uhash.cpp", + ], + deps = [ + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "errorcode", + hdrs = [ + ], + srcs = [ + "errorcode.cpp", + ], + includes = ["."], + deps = [ + ":platform", + ":utypes", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "utypes", + srcs = [ + "utypes.cpp", + ], + includes = ["."], + deps = [ + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "uniset", + srcs = [ + "uniset.cpp", + "unifilt.cpp", + "unisetspan.cpp", + "bmpset.cpp", + "util.cpp", + "unifunct.cpp", + "usetiter.cpp", + ], + includes = ["."], + deps = [ + ":patternprops", + ":uvector", + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "patternprops", + srcs = [ + "patternprops.cpp", + ], + includes = ["."], + deps = [ + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "propsvec", + srcs = [ + "propsvec.cpp", + ], + includes = ["."], + deps = [ + ":sort", + ":utrie2_builder", + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "propname", + srcs = [ + "propname.cpp", + ], + includes = ["."], + deps = [ + ":bytestrie", + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +# Note: cc_library target name "uvector32" matches dependencies.txt group name, +# but filename "uvectr32.*" differs in spelling. +cc_library( + name = "uvector32", + srcs = [ + "uvectr32.cpp", + ], + includes = ["."], + deps = [ + ":platform", + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "sort", + srcs = [ + "uarrsort.cpp", + ], + includes = ["."], + deps = [ + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + +cc_library( + name = "uvector", + srcs = [ + "uvector.cpp", + ], + includes = ["."], + deps = [ + ":platform", + ":sort", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + + +# Building this target will indirectly cause the creation of a header file that +# integrates normalization data. This header file is generated by a genrule +# target that invokes the gennorm2 binary. +cc_library( + name = "normalizer2", + srcs = [ + "normalizer2.cpp", + "normalizer2impl.cpp", + ], + includes = ["."], + hdrs = [ + "normalizer2impl.h", + "norm2_nfc_data.h", # generated by gennorm2 + ], + deps = [ + ":headers", + ], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) + + + +# Note: Bazel has chosen specifically to disallow any official support for breaking +# through constraints that would allow copying to or generating to source +# directories: https://stackoverflow.com/questions/51283183/how-to-generate-files-in-source-folder-using-bazel + +genrule( + name = "gen_norm2_nfc_data_h", + srcs = [ + "//icu4c/source/data/unidata/norm2:nfc.txt", + ], + outs = ["norm2_nfc_data.h"], + cmd = "./$(location //icu4c/source/tools/gennorm2) -o $@ $(location //icu4c/source/data/unidata/norm2:nfc.txt) --csource && cp $@ /tmp", + tools = ["//icu4c/source/tools/gennorm2"], +) diff --git a/icu4c/source/data/unidata/changes.txt b/icu4c/source/data/unidata/changes.txt index 9e7bd1ebc1b..7336b8d012a 100644 --- a/icu4c/source/data/unidata/changes.txt +++ b/icu4c/source/data/unidata/changes.txt @@ -49,6 +49,12 @@ For new script codes see http://www.unicode.org/iso15924/codechanges.html ---------------------------------------------------------------------------- *** +Unicode 14.0 update for ICU 70 + +Note: running `bazelisk clean` is optional but not necessary along with running `clean.sh`. + +---------------------------------------------------------------------------- *** + Unicode 13.0 update for ICU 66 https://www.unicode.org/versions/Unicode13.0.0/ diff --git a/icu4c/source/data/unidata/clean.sh b/icu4c/source/data/unidata/clean.sh new file mode 100644 index 00000000000..b71b3e8122c --- /dev/null +++ b/icu4c/source/data/unidata/clean.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This script deletes files that generate.sh tries to regenerate. + +# Required environment variables: +# - ICU_SRC - the root directory of ICU source. This directory contains the +# `icu4c` directory. + + +rm $ICU_SRC/icu4c/source/common/norm2_nfc_data.h + +rm $ICU_SRC/icu4c/source/common/uchar_props_data.h +rm $ICU_SRC/icu4c/source/data/in/uprops.icu + diff --git a/icu4c/source/data/unidata/generate.sh b/icu4c/source/data/unidata/generate.sh new file mode 100644 index 00000000000..11a4271e5c2 --- /dev/null +++ b/icu4c/source/data/unidata/generate.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This script runs Bazel to create (generate) header files from data that are +# needed for bootstrapping the ICU4C build to integrate the data. + +# Required environment variables: +# - ICU_SRC - the root directory of ICU source. This directory contains the +# `icu4c` directory. + + +bazelisk build //icu4c/source/common:normalizer2 +cp $ICU_SRC/bazel-bin/icu4c/source/common/norm2_nfc_data.h $ICU_SRC/icu4c/source/common/norm2_nfc_data.h + +bazelisk run //tools/unicode/c/genprops $ICU_SRC/icu4c/ diff --git a/icu4c/source/data/unidata/norm2/BUILD b/icu4c/source/data/unidata/norm2/BUILD new file mode 100644 index 00000000000..f5fb9b11704 --- /dev/null +++ b/icu4c/source/data/unidata/norm2/BUILD @@ -0,0 +1,13 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This Bazel build file is needed to declare targets for the files used as +# inputs to binary executables that are a part of other Bazel genrule targets. + +package( + default_visibility = ["//visibility:public"], +) + +exports_files([ + "nfc.txt", +]) \ No newline at end of file diff --git a/icu4c/source/tools/gennorm2/BUILD b/icu4c/source/tools/gennorm2/BUILD new file mode 100644 index 00000000000..700a9505900 --- /dev/null +++ b/icu4c/source/tools/gennorm2/BUILD @@ -0,0 +1,38 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This Bazel build file defines a target for the gennorm2 binary that generates +# headers needed for bootstrapping the ICU4C build process in a way that +# integrates the normalization data. + +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + +package( + default_visibility = ["//visibility:public"], +) + +cc_binary( + name = "gennorm2", + srcs = glob([ + "*.c", + "*.cpp", + "*.h", # cannot have hdrs section in cc_binary + ]), + deps = [ + "//icu4c/source/common:uhash", + "//icu4c/source/common:umutablecptrie", + "//icu4c/source/common:ucptrie", + "//icu4c/source/common:errorcode", + "//icu4c/source/common:uniset", + "//icu4c/source/common:uvector32", + + "//icu4c/source/common:platform", + "//icu4c/source/common:headers", + + "//icu4c/source/tools/toolutil:toolutil", + "//icu4c/source/tools/toolutil:unewdata", + "//icu4c/source/tools/toolutil:writesrc", + "//icu4c/source/tools/toolutil:uoptions", + "//icu4c/source/tools/toolutil:uparse", + ], +) diff --git a/icu4c/source/tools/toolutil/BUILD b/icu4c/source/tools/toolutil/BUILD new file mode 100644 index 00000000000..69571c4a2cd --- /dev/null +++ b/icu4c/source/tools/toolutil/BUILD @@ -0,0 +1,111 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This Bazel build file defines targets that are dependencies for building +# the gennorm2 and genprops binaries. + +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + +package( + default_visibility = ["//visibility:public"], +) + + +cc_library( + name = "toolutil", + includes = ["."], + hdrs = ["toolutil.h"], + srcs = ["toolutil.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = ["//icu4c/source/common:platform"], +) + +cc_library( + name = "unewdata", + includes = ["."], + hdrs = ["unewdata.h"], + srcs = ["unewdata.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = [ + ":filestrm", + "//icu4c/source/common:platform", + ], +) + +cc_library( + name = "uoptions", + includes = ["."], + hdrs = ["uoptions.h"], + srcs = ["uoptions.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = ["//icu4c/source/common:platform"], +) + +cc_library( + name = "writesrc", + includes = ["."], + hdrs = ["writesrc.h"], + srcs = ["writesrc.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = ["//icu4c/source/common:platform"], +) + +cc_library( + name = "uparse", + includes = ["."], + hdrs = ["uparse.h"], + srcs = ["uparse.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = [ + ":filestrm", + "//icu4c/source/common:platform", + ], +) + +cc_library( + name = "filestrm", + includes = ["."], + hdrs = ["filestrm.h"], + srcs = ["filestrm.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = ["//icu4c/source/common:platform"], +) + +cc_library( + name = "ppucd", + includes = ["."], + hdrs = ["ppucd.h"], + srcs = ["ppucd.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = [ + ":uparse", + "//icu4c/source/common:propname", + "//icu4c/source/common:platform", + ], +) + +cc_library( + name = "denseranges", + includes = ["."], + hdrs = ["denseranges.h"], + srcs = ["denseranges.cpp"], + local_defines = [ + "U_TOOLUTIL_IMPLEMENTATION", + ], + deps = ["//icu4c/source/common:platform"], +) + diff --git a/icu4c/source/tools/toolutil/toolutil.cpp b/icu4c/source/tools/toolutil/toolutil.cpp index 7a574f41bb6..6ca7a8c3cf9 100644 --- a/icu4c/source/tools/toolutil/toolutil.cpp +++ b/icu4c/source/tools/toolutil/toolutil.cpp @@ -30,6 +30,7 @@ #include #include +#include #include "unicode/utypes.h" #ifndef U_TOOLUTIL_IMPLEMENTATION @@ -67,7 +68,6 @@ #include "cmemory.h" #include "cstring.h" #include "toolutil.h" -#include "unicode/ucal.h" U_NAMESPACE_BEGIN @@ -86,19 +86,11 @@ U_NAMESPACE_END static int32_t currentYear = -1; U_CAPI int32_t U_EXPORT2 getCurrentYear() { -#if !UCONFIG_NO_FORMATTING - UErrorCode status=U_ZERO_ERROR; - UCalendar *cal = NULL; - if(currentYear == -1) { - cal = ucal_open(NULL, -1, NULL, UCAL_TRADITIONAL, &status); - ucal_setMillis(cal, ucal_getNow(), &status); - currentYear = ucal_get(cal, UCAL_YEAR, &status); - ucal_close(cal); + time_t now = time(nullptr); + tm *fields = gmtime(&now); + currentYear = 1900 + fields->tm_year; } -#else - /* No formatting- no way to set the current year. */ -#endif return currentYear; } diff --git a/tools/unicode/c/genprops/BUILD b/tools/unicode/c/genprops/BUILD new file mode 100644 index 00000000000..b0f2117efe4 --- /dev/null +++ b/tools/unicode/c/genprops/BUILD @@ -0,0 +1,49 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This Bazel build file defines a target representing the binary executable, +# `genprops`, which is used for generating headers needing for bootstrapping +# the ICU4C build process in a way that integrates core properties data. + +# Defining a binary executable (done in Bazel using `cc_binary`) +# enables the use of the output file from executing the binary as a part of +# other Bazel targets defined using `genrule`. + +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + +package( + default_visibility = ["//visibility:public"], +) + +cc_binary( + name = "genprops", + srcs = glob([ + "*.c", + "*.cpp", + "*.h", # cannot have hdrs section in cc_binary + ]), + deps = [ + "//icu4c/source/common:uhash", + "//icu4c/source/common:umutablecptrie", + "//icu4c/source/common:ucptrie", + "//icu4c/source/common:utrie2", + "//icu4c/source/common:utrie2_builder", + "//icu4c/source/common:bytestrie", + "//icu4c/source/common:bytestriebuilder", + "//icu4c/source/common:propsvec", + "//icu4c/source/common:errorcode", + "//icu4c/source/common:uniset", + "//icu4c/source/common:uvector32", + + "//icu4c/source/common:platform", + "//icu4c/source/common:headers", + + "//icu4c/source/tools/toolutil:ppucd", + "//icu4c/source/tools/toolutil:unewdata", + "//icu4c/source/tools/toolutil:writesrc", + "//icu4c/source/tools/toolutil:uoptions", + "//icu4c/source/tools/toolutil:uparse", + "//icu4c/source/tools/toolutil:toolutil", + "//icu4c/source/tools/toolutil:denseranges", + ], +) diff --git a/tools/unicode/c/genprops/bidipropsbuilder.cpp b/tools/unicode/c/genprops/bidipropsbuilder.cpp index 703ed7fd6ca..e4f737bf1f0 100644 --- a/tools/unicode/c/genprops/bidipropsbuilder.cpp +++ b/tools/unicode/c/genprops/bidipropsbuilder.cpp @@ -298,7 +298,7 @@ BiDiPropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues, value|=(uint32_t)bpt<=0) { /* uppercase mapping as delta if the character is lowercase */ - hasMapping=TRUE; + hasMapping=true; if(type==UCASE_LOWER) { delta=props.suc-start; } else { - noDelta=TRUE; + noDelta=true; value|=UCASE_EXCEPTION; } } if(props.slc>=0) { /* lowercase mapping as delta if the character is uppercase or titlecase */ - hasMapping=TRUE; + hasMapping=true; if(type>=UCASE_UPPER) { delta=props.slc-start; } else { - noDelta=TRUE; + noDelta=true; value|=UCASE_EXCEPTION; } } if(props.stc>=0) { - hasMapping=TRUE; + hasMapping=true; } if(props.suc!=props.stc) { - noDelta=TRUE; + noDelta=true; value|=UCASE_EXCEPTION; } @@ -447,7 +447,7 @@ CasePropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues, // If they differ, then store them separately. UChar32 scf=props.scf; if(scf>=0 && scf!=props.slc) { - hasMapping=noDelta=TRUE; + hasMapping=noDelta=true; value|=UCASE_EXCEPTION; } @@ -457,9 +457,9 @@ CasePropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues, // (Full case folding falls back to simple case folding, // not to full lowercasing, so we need not also handle it specially // for such cases.) - UBool hasNoSimpleCaseFolding=FALSE; + UBool hasNoSimpleCaseFolding=false; if(scf<0 && props.slc>=0) { - hasNoSimpleCaseFolding=TRUE; + hasNoSimpleCaseFolding=true; value|=UCASE_EXCEPTION; } @@ -475,13 +475,13 @@ CasePropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues, if(!props.lc.isEmpty() || !props.uc.isEmpty() || !props.tc.isEmpty() || newValues.contains(PPUCD_CONDITIONAL_CASE_MAPPINGS) ) { - hasMapping=TRUE; + hasMapping=true; value|=UCASE_EXCEPTION; } if( (!props.cf.isEmpty() && props.cf!=UnicodeString(props.scf)) || newValues.contains(PPUCD_TURKIC_CASE_FOLDING) ) { - hasMapping=TRUE; + hasMapping=true; value|=UCASE_EXCEPTION; } @@ -547,7 +547,7 @@ CasePropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues, value|=((uint32_t)delta<UCASE_NONE) { @@ -836,7 +836,7 @@ CasePropsBuilder::addClosure(UChar32 orig, UChar32 prev2, UChar32 prev, UChar32 if(c!=orig && next!=orig) { /* c does not map to orig, add a closure mapping c->orig */ addClosureMapping(c, orig, errorCode); - return TRUE; + return true; } } } @@ -880,7 +880,7 @@ CasePropsBuilder::makeCaseClosure(UErrorCode &errorCode) { /* add further closure mappings from analyzing simple mappings */ UBool someMappingsAdded; do { - someMappingsAdded=FALSE; + someMappingsAdded=false; for(UChar32 c=0; c<=0x10ffff; ++c) { uint32_t value=utrie2_get32(pTrie, c); diff --git a/tools/unicode/c/genprops/corepropsbuilder.cpp b/tools/unicode/c/genprops/corepropsbuilder.cpp index af7aadea148..30a91524bb4 100644 --- a/tools/unicode/c/genprops/corepropsbuilder.cpp +++ b/tools/unicode/c/genprops/corepropsbuilder.cpp @@ -407,10 +407,10 @@ encodeNumericValue(UChar32 start, const char *s, UErrorCode &errorCode) { /* get a possible minus sign */ UBool isNegative; if(*s=='-') { - isNegative=TRUE; + isNegative=true; ++s; } else { - isNegative=FALSE; + isNegative=false; } int32_t value=0, den=0, exp=0, ntv=0; @@ -568,7 +568,7 @@ CorePropsBuilder::setGcAndNumeric(const UniProps &props, const UnicodeSet &newVa if(start==end) { utrie2_set32(pTrie, start, value, &errorCode); } else { - utrie2_setRange32(pTrie, start, end, value, TRUE, &errorCode); + utrie2_setRange32(pTrie, start, end, value, true, &errorCode); } if(U_FAILURE(errorCode)) { fprintf(stderr, "error: utrie2_setRange32(properties trie %04lX..%04lX) failed - %s\n", diff --git a/tools/unicode/c/genprops/genprops.cpp b/tools/unicode/c/genprops/genprops.cpp index 39e06b72cf6..e88c7905553 100644 --- a/tools/unicode/c/genprops/genprops.cpp +++ b/tools/unicode/c/genprops/genprops.cpp @@ -33,8 +33,8 @@ U_NAMESPACE_USE -UBool beVerbose=FALSE; -UBool beQuiet=FALSE; +UBool beVerbose=false; +UBool beQuiet=false; PropsBuilder::PropsBuilder() {} PropsBuilder::~PropsBuilder() {} diff --git a/tools/unicode/c/genprops/namespropsbuilder.cpp b/tools/unicode/c/genprops/namespropsbuilder.cpp index 0684e0183a7..e8a6e72165e 100644 --- a/tools/unicode/c/genprops/namespropsbuilder.cpp +++ b/tools/unicode/c/genprops/namespropsbuilder.cpp @@ -495,7 +495,7 @@ compress(UErrorCode &errorCode) { /* sort the words in reverse order by weight */ uprv_sortArray(words, wordCount, sizeof(Word), - compareWords, NULL, FALSE, &errorCode); + compareWords, NULL, false, &errorCode); /* remove the words that do not save anything */ while(wordCount>0 && words[wordCount-1].weight<1) { @@ -543,7 +543,7 @@ compress(UErrorCode &errorCode) { /* sort these words in reverse order by weight */ errorCode=U_ZERO_ERROR; uprv_sortArray(words+tokenCount, wordCount-tokenCount, sizeof(Word), - compareWords, NULL, FALSE, &errorCode); + compareWords, NULL, false, &errorCode); /* remove the words that do not save anything */ while(wordCount>0 && words[wordCount-1].weight<1) { diff --git a/tools/unicode/c/genprops/pnamesbuilder.cpp b/tools/unicode/c/genprops/pnamesbuilder.cpp index b38ed734fd1..e1142e0ece8 100644 --- a/tools/unicode/c/genprops/pnamesbuilder.cpp +++ b/tools/unicode/c/genprops/pnamesbuilder.cpp @@ -552,7 +552,7 @@ int32_t PNamesPropertyNames::findProperty(int32_t property) const { UBool PNamesPropertyNames::containsName(BytesTrie &trie, const char *name) const { if(name==NULL) { - return FALSE; + return false; } UStringTrieResult result=USTRINGTRIE_NO_VALUE; char c; @@ -563,7 +563,7 @@ UBool PNamesPropertyNames::containsName(BytesTrie &trie, const char *name) const continue; } if(!USTRINGTRIE_HAS_NEXT(result)) { - return FALSE; + return false; } result=trie.next((uint8_t)c); }