Submitted By: Marty Jack Date: 2020-11-02 Initial Package Version: 5.15.1 Upstream Status: Unknown Origin: self Description: Allows qtwebengine to build against system ICU_68.1 which has dropped the TRUE and FALSE macros. Comment by Ken: This code actually comes from chromium, but they only take bugs against their latest release, which I do not have. I have attempted to raise a bug at qt. diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/base/i18n/string_compare.cc qtwebengine-5.15.1/src/3rdparty/chromium/base/i18n/string_compare.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/base/i18n/string_compare.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/base/i18n/string_compare.cc 2020-10-29 10:13:58.752618113 -0400 @@ -18,8 +18,8 @@ StringPiece16 rhs) { UErrorCode error = U_ZERO_ERROR; UCollationResult result = collator.compare( - icu::UnicodeString(FALSE, lhs.data(), static_cast(lhs.length())), - icu::UnicodeString(FALSE, rhs.data(), static_cast(rhs.length())), + icu::UnicodeString(false, lhs.data(), static_cast(lhs.length())), + icu::UnicodeString(false, rhs.data(), static_cast(rhs.length())), error); DCHECK(U_SUCCESS(error)); return result; diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/base/i18n/time_formatting.cc qtwebengine-5.15.1/src/3rdparty/chromium/base/i18n/time_formatting.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/base/i18n/time_formatting.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/base/i18n/time_formatting.cc 2020-10-29 10:13:53.202674098 -0400 @@ -236,7 +236,7 @@ icu::FieldPosition ignore(icu::FieldPosition::DONT_CARE); measure_format.formatMeasures(measures, 3, formatted, ignore, status); *out = i18n::UnicodeStringToString16(formatted); - return U_SUCCESS(status) == TRUE; + return U_SUCCESS(status) == true; } string16 DateIntervalFormat(const Time& begin_time, diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/components/autofill/core/common/autofill_regexes.cc qtwebengine-5.15.1/src/3rdparty/chromium/components/autofill/core/common/autofill_regexes.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/components/autofill/core/common/autofill_regexes.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/components/autofill/core/common/autofill_regexes.cc 2020-10-29 10:14:20.312401706 -0400 @@ -43,7 +43,7 @@ icu::RegexMatcher* AutofillRegexes::GetMatcher(const base::string16& pattern) { auto it = matchers_.find(pattern); if (it == matchers_.end()) { - const icu::UnicodeString icu_pattern(FALSE, pattern.data(), + const icu::UnicodeString icu_pattern(false, pattern.data(), pattern.length()); UErrorCode status = U_ZERO_ERROR; @@ -70,20 +70,20 @@ base::AutoLock lock(*g_lock); icu::RegexMatcher* matcher = g_autofill_regexes->GetMatcher(pattern); - icu::UnicodeString icu_input(FALSE, input.data(), input.length()); + icu::UnicodeString icu_input(false, input.data(), input.length()); matcher->reset(icu_input); UErrorCode status = U_ZERO_ERROR; UBool matched = matcher->find(0, status); DCHECK(U_SUCCESS(status)); - if (matched == TRUE && match) { + if (matched == true && match) { icu::UnicodeString match_unicode = matcher->group(0, status); DCHECK(U_SUCCESS(status)); *match = base::i18n::UnicodeStringToString16(match_unicode); } - return matched == TRUE; + return matched == true; } } // namespace autofill diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/components/spellcheck/renderer/spellcheck_worditerator.cc qtwebengine-5.15.1/src/3rdparty/chromium/components/spellcheck/renderer/spellcheck_worditerator.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/components/spellcheck/renderer/spellcheck_worditerator.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/components/spellcheck/renderer/spellcheck_worditerator.cc 2020-10-29 10:14:26.692337946 -0400 @@ -424,7 +424,7 @@ // spellchecker and we need manual normalization as well. The normalized // text does not have to be NUL-terminated since its characters are copied to // string16, which adds a NUL character when we need. - icu::UnicodeString input(FALSE, &text_[input_start], + icu::UnicodeString input(false, &text_[input_start], base::checked_cast(input_length)); UErrorCode status = U_ZERO_ERROR; icu::UnicodeString output; diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/components/url_formatter/spoof_checks/idn_spoof_checker.cc qtwebengine-5.15.1/src/3rdparty/chromium/components/url_formatter/spoof_checks/idn_spoof_checker.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/components/url_formatter/spoof_checks/idn_spoof_checker.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/components/url_formatter/spoof_checks/idn_spoof_checker.cc 2020-10-29 10:14:04.785890761 -0400 @@ -315,7 +315,7 @@ if (U_FAILURE(status) || (result & USPOOF_ALL_CHECKS)) return false; - icu::UnicodeString label_string(FALSE /* isTerminated */, label.data(), + icu::UnicodeString label_string(false /* isTerminated */, label.data(), base::checked_cast(label.size())); // A punycode label with 'xn--' prefix is not subject to the URL @@ -491,7 +491,7 @@ Skeletons IDNSpoofChecker::GetSkeletons(base::StringPiece16 hostname) { Skeletons skeletons; size_t hostname_length = hostname.length() - (hostname.back() == '.' ? 1 : 0); - icu::UnicodeString host(FALSE, hostname.data(), hostname_length); + icu::UnicodeString host(false, hostname.data(), hostname_length); // If input has any characters outside Latin-Greek-Cyrillic and [0-9._-], // there is no point in getting rid of diacritics because combining marks // attached to non-LGC characters are already blocked. @@ -690,7 +690,7 @@ base::StringPiece tld, base::StringPiece16 tld_unicode) const { icu::UnicodeString tld_string( - FALSE /* isTerminated */, tld_unicode.data(), + false /* isTerminated */, tld_unicode.data(), base::checked_cast(tld_unicode.size())); if (cyrillic_letters_.containsSome(tld_string)) { return true; diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/services/service_manager/zygote/zygote_linux.cc qtwebengine-5.15.1/src/3rdparty/chromium/services/service_manager/zygote/zygote_linux.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/services/service_manager/zygote/zygote_linux.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/services/service_manager/zygote/zygote_linux.cc 2020-10-29 10:14:12.405814235 -0400 @@ -564,7 +564,7 @@ if (!iter.ReadString16(&timezone_id)) return -1; icu::TimeZone::adoptDefault(icu::TimeZone::createTimeZone( - icu::UnicodeString(FALSE, timezone_id.data(), timezone_id.length()))); + icu::UnicodeString(false, timezone_id.data(), timezone_id.length()))); if (!iter.ReadInt(&numfds)) return -1; diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/text/locale_icu.cc qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/text/locale_icu.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/text/locale_icu.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/text/locale_icu.cc 2020-10-29 10:14:45.248819903 -0400 @@ -168,12 +168,12 @@ return g_empty_string; UErrorCode status = U_ZERO_ERROR; - int32_t length = udat_toPattern(date_format, TRUE, nullptr, 0, &status); + int32_t length = udat_toPattern(date_format, true, nullptr, 0, &status); if (status != U_BUFFER_OVERFLOW_ERROR || !length) return g_empty_string; StringBuffer buffer(length); status = U_ZERO_ERROR; - udat_toPattern(date_format, TRUE, buffer.Characters(), length, &status); + udat_toPattern(date_format, true, buffer.Characters(), length, &status); if (U_FAILURE(status)) return g_empty_string; return String::Adopt(buffer); diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc 2020-10-29 10:14:33.172273328 -0400 @@ -311,13 +311,13 @@ text->chunkOffset = offset <= std::numeric_limits::max() ? static_cast(offset) : 0; - is_accessible = TRUE; + is_accessible = true; return true; } if (native_index >= native_length && text->chunkNativeLimit == native_length) { text->chunkOffset = text->chunkLength; - is_accessible = FALSE; + is_accessible = false; return true; } } else { @@ -330,12 +330,12 @@ text->chunkOffset = offset <= std::numeric_limits::max() ? static_cast(offset) : 0; - is_accessible = TRUE; + is_accessible = true; return true; } if (native_index <= 0 && !text->chunkNativeStart) { text->chunkOffset = 0; - is_accessible = FALSE; + is_accessible = false; return true; } } @@ -346,7 +346,7 @@ int64_t native_index, UBool forward) { if (!text->context) - return FALSE; + return false; int64_t native_length = TextNativeLength(text); UBool is_accessible; if (TextInChunkOrOutOfRange(text, native_index, native_length, forward, @@ -370,7 +370,7 @@ DCHECK_EQ(new_context, kPriorContext); TextLatin1SwitchToPriorContext(text, native_index, native_length, forward); } - return TRUE; + return true; } static const struct UTextFuncs kTextLatin1Funcs = { @@ -510,7 +510,7 @@ static UBool TextUTF16Access(UText* text, int64_t native_index, UBool forward) { if (!text->context) - return FALSE; + return false; int64_t native_length = TextNativeLength(text); UBool is_accessible; if (TextInChunkOrOutOfRange(text, native_index, native_length, forward, @@ -532,7 +532,7 @@ DCHECK_EQ(new_context, kPriorContext); TextUTF16SwitchToPriorContext(text, native_index, native_length, forward); } - return TRUE; + return true; } static const struct UTextFuncs kTextUTF16Funcs = { diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/text/unicode_utilities.cc qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/text/unicode_utilities.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/text/unicode_utilities.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/text/unicode_utilities.cc 2020-10-29 10:14:38.645552178 -0400 @@ -300,7 +300,7 @@ DCHECK(U_SUCCESS(status)); int32_t input_length = static_cast(length); // copy-on-write. - icu::UnicodeString normalized(FALSE, characters, input_length); + icu::UnicodeString normalized(false, characters, input_length); // In the vast majority of cases, input is already NFC. Run a quick check // to avoid normalizing the entire input unnecessarily. int32_t normalized_prefix_length = diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/text/text_codec_icu.cc 2020-10-29 10:13:46.952737247 -0400 @@ -326,7 +326,7 @@ DLOG_IF(ERROR, err == U_AMBIGUOUS_ALIAS_WARNING) << "ICU ambiguous alias warning for encoding: " << encoding_.GetName(); if (converter_icu_) - ucnv_setFallback(converter_icu_, TRUE); + ucnv_setFallback(converter_icu_, true); } int TextCodecICU::DecodeToBuffer(UChar* target, diff -Naur qtwebengine-5.15.1.orig/src/3rdparty/chromium/ui/base/l10n/formatter.cc qtwebengine-5.15.1/src/3rdparty/chromium/ui/base/l10n/formatter.cc --- qtwebengine-5.15.1.orig/src/3rdparty/chromium/ui/base/l10n/formatter.cc 2020-09-01 07:02:34.000000000 -0400 +++ qtwebengine-5.15.1/src/3rdparty/chromium/ui/base/l10n/formatter.cc 2020-10-29 10:14:52.995409771 -0400 @@ -232,7 +232,7 @@ int value, icu::UnicodeString* formatted_string) const { DCHECK(simple_format_[unit]); - DCHECK(formatted_string->isEmpty() == TRUE); + DCHECK(formatted_string->isEmpty() == true); UErrorCode error = U_ZERO_ERROR; FormatNumberInPlural(*simple_format_[unit], value, formatted_string, &error); @@ -248,7 +248,7 @@ << "Detailed() not implemented for your (format, length) combination!"; DCHECK(detailed_format_[units][1]) << "Detailed() not implemented for your (format, length) combination!"; - DCHECK(formatted_string->isEmpty() == TRUE); + DCHECK(formatted_string->isEmpty() == true); UErrorCode error = U_ZERO_ERROR; FormatNumberInPlural(*detailed_format_[units][0], value_1, formatted_string, &error); @@ -281,7 +281,7 @@ base::string16 pattern = l10n_util::GetStringUTF16(pluralities.id); UErrorCode error = U_ZERO_ERROR; std::unique_ptr format(new icu::MessageFormat( - icu::UnicodeString(FALSE, pattern.data(), pattern.length()), error)); + icu::UnicodeString(false, pattern.data(), pattern.length()), error)); DCHECK(U_SUCCESS(error)); if (format.get()) return format;