--- /dev/null
+# © 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
*.vcxproj.user
*_debug
*_release
+bazel-*
cygicudata*
libicu*
libicutest*
--- /dev/null
+# © 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.
--- /dev/null
+# © 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"],
+)
---------------------------------------------------------------------------- ***
+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/
--- /dev/null
+#!/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
+
--- /dev/null
+#!/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/
--- /dev/null
+# © 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
--- /dev/null
+# © 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",
+ ],
+)
--- /dev/null
+# © 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"],
+)
+
#include <stdio.h>
#include <sys/stat.h>
+#include <time.h>
#include "unicode/utypes.h"
#ifndef U_TOOLUTIL_IMPLEMENTATION
#include "cmemory.h"
#include "cstring.h"
#include "toolutil.h"
-#include "unicode/ucal.h"
U_NAMESPACE_BEGIN
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;
}
--- /dev/null
+# © 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",
+ ],
+)
value|=(uint32_t)bpt<<UBIDI_BPT_SHIFT;
value|=(uint32_t)props.getIntProp(UCHAR_JOINING_TYPE)<<UBIDI_JT_SHIFT;
value|=(uint32_t)props.getIntProp(UCHAR_BIDI_CLASS);
- utrie2_setRange32(pTrie, start, end, value, TRUE, &errorCode);
+ utrie2_setRange32(pTrie, start, end, value, true, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "genprops error: BiDiPropsBuilder utrie2_setRange32() failed - %s\n",
u_errorName(errorCode));
BiDiPropsBuilder::makeMirror(UErrorCode &errorCode) {
/* sort the mirroring table by source code points */
uprv_sortArray(mirrors, mirrorTop, 8,
- compareMirror, NULL, FALSE, &errorCode);
+ compareMirror, NULL, false, &errorCode);
if(U_FAILURE(errorCode)) { return; }
/*
struct ExcProps {
ExcProps() :
- delta(0), hasConditionalCaseMappings(FALSE), hasTurkicCaseFolding(FALSE),
- hasNoSimpleCaseFolding(FALSE) {}
+ delta(0), hasConditionalCaseMappings(false), hasTurkicCaseFolding(false),
+ hasNoSimpleCaseFolding(false) {}
ExcProps(const UniProps &otherProps) :
props(otherProps),
- delta(0), hasConditionalCaseMappings(FALSE), hasTurkicCaseFolding(FALSE),
- hasNoSimpleCaseFolding(FALSE) {}
+ delta(0), hasConditionalCaseMappings(false), hasTurkicCaseFolding(false),
+ hasNoSimpleCaseFolding(false) {}
UniProps props;
UnicodeSet closure;
/* default: map to self */
int32_t delta=0;
- UBool noDelta=FALSE;
+ UBool noDelta=false;
uint32_t type;
if(props.binProps[UCHAR_LOWERCASE]) {
uint32_t value=type;
// Examine simple case mappings.
- UBool hasMapping=FALSE;
+ UBool hasMapping=false;
if(props.suc>=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;
}
// 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;
}
// (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;
}
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;
}
value|=((uint32_t)delta<<UCASE_DELTA_SHIFT)&UCASE_DELTA_MASK;
}
- utrie2_setRange32(pTrie, start, end, value, TRUE, &errorCode);
+ utrie2_setRange32(pTrie, start, end, value, true, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "genprops error: unable to set case mapping values: %s\n",
u_errorName(errorCode));
int32_t unfoldRows=unfoldLength/UGENCASE_UNFOLD_WIDTH-1;
UChar *unfoldBuffer=unfold.getBuffer(-1);
uprv_sortArray(unfoldBuffer+UGENCASE_UNFOLD_WIDTH, unfoldRows, UGENCASE_UNFOLD_WIDTH*2,
- compareUnfold, NULL, FALSE, &errorCode);
+ compareUnfold, NULL, false, &errorCode);
/* make unique-string rows by merging adjacent ones' code point columns */
* each code point will in the end have some mapping to each other
* code point in the group.
*
- * @return TRUE if a closure mapping was added
+ * @return true if a closure mapping was added
*/
UBool
CasePropsBuilder::addClosure(UChar32 orig, UChar32 prev2, UChar32 prev, UChar32 c, uint32_t value,
UErrorCode &errorCode) {
- if(U_FAILURE(errorCode)) { return FALSE; }
+ if(U_FAILURE(errorCode)) { return false; }
UChar32 next;
- UBool someMappingsAdded=FALSE;
+ UBool someMappingsAdded=false;
if(c!=orig) {
/* get the properties for c */
next=iter.getCodepoint(); /* next!=c */
if(next==orig) {
- mapsToOrig=TRUE; /* remember that we map to orig */
+ mapsToOrig=true; /* remember that we map to orig */
} else if(prev2<0 && next!=prev) {
/*
* recurse unless
if(!mapsToOrig) {
addClosureMapping(c, orig, errorCode);
- return TRUE;
+ return true;
}
} else {
if((value&UCASE_TYPE_MASK)>UCASE_NONE) {
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;
}
}
}
/* 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);
/* 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;
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",
U_NAMESPACE_USE
-UBool beVerbose=FALSE;
-UBool beQuiet=FALSE;
+UBool beVerbose=false;
+UBool beQuiet=false;
PropsBuilder::PropsBuilder() {}
PropsBuilder::~PropsBuilder() {}
/* 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) {
/* 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) {
UBool PNamesPropertyNames::containsName(BytesTrie &trie, const char *name) const {
if(name==NULL) {
- return FALSE;
+ return false;
}
UStringTrieResult result=USTRINGTRIE_NO_VALUE;
char c;
continue;
}
if(!USTRINGTRIE_HAS_NEXT(result)) {
- return FALSE;
+ return false;
}
result=trie.next((uint8_t)c);
}