1From 736e1d804d1efa2077c4f1fe0b9084927d82e249 Mon Sep 17 00:00:00 2001
2From: "stephan.szabo@sony.com"
3 <stephan.szabo@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
4Date: Tue, 3 Nov 2020 20:06:15 +0000
5Subject: [PATCH] [WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and
6 TRUE macros by default https://bugs.webkit.org/show_bug.cgi?id=218522
7
8Reviewed by Don Olmstead.
9
10Source/WebCore:
11
12* platform/text/TextCodecICU.cpp: Replace use of TRUE with true
13
14Source/WebKit:
15
16* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Replace FALSE with false
17
18Source/WTF:
19
20Replace uses of FALSE and TRUE with false and true.
21
22* wtf/text/icu/UTextProvider.h:
23* wtf/text/icu/UTextProviderLatin1.cpp:
24* wtf/text/icu/UTextProviderUTF16.cpp:
25
26Change-Id: I876cf2b10b8c858c3d265113c062d159749a2f3e
27git-svn-id: http://svn.webkit.org/repository/webkit/trunk@269325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
29[james.hilliard1@gmail.com: backport from upstream commit
30736e1d804d1efa2077c4f1fe0b9084927d82e249]
31---
32 Source/WebCore/platform/text/TextCodecICU.cpp      |  2 +-
33 Source/WebCore/platform/text/icu/UTextProvider.h   |  8 ++++----
34 .../platform/text/icu/UTextProviderLatin1.cpp      | 14 +++++++-------
35 .../platform/text/icu/UTextProviderUTF16.cpp       |  4 ++--
36 7 files changed, 45 insertions(+), 14 deletions(-)
37
38diff --git a/Source/WebCore/platform/text/TextCodecICU.cpp b/Source/WebCore/platform/text/TextCodecICU.cpp
39index dd6ff0675bb1..e0f4bd718828 100644
40--- a/Source/WebCore/platform/text/TextCodecICU.cpp
41+++ b/Source/WebCore/platform/text/TextCodecICU.cpp
42@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
43     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
44     ASSERT(U_SUCCESS(err));
45     if (m_converterICU)
46-        ucnv_setFallback(m_converterICU, TRUE);
47+        ucnv_setFallback(m_converterICU, true);
48 }
49
50 int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
51diff --git a/Source/WebCore/platform/text/icu/UTextProvider.h b/Source/WebCore/platform/text/icu/UTextProvider.h
52index c254fc4c7ce2..6d1e1cbc5eb2 100644
53--- a/Source/WebCore/platform/text/icu/UTextProvider.h
54+++ b/Source/WebCore/platform/text/icu/UTextProvider.h
55@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
56             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
57             ASSERT(offset < std::numeric_limits<int32_t>::max());
58             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
59-            isAccessible = TRUE;
60+            isAccessible = true;
61             return true;
62         }
63         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
64             text->chunkOffset = text->chunkLength;
65-            isAccessible = FALSE;
66+            isAccessible = false;
67             return true;
68         }
69     } else {
70@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
71             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
72             ASSERT(offset < std::numeric_limits<int32_t>::max());
73             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
74-            isAccessible = TRUE;
75+            isAccessible = true;
76             return true;
77         }
78         if (nativeIndex <= 0 && !text->chunkNativeStart) {
79             text->chunkOffset = 0;
80-            isAccessible = FALSE;
81+            isAccessible = false;
82             return true;
83         }
84     }
85diff --git a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
86index cd6852c71e55..6a864b1c1567 100644
87--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
88+++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
89@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
90         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
91             // Already inside the buffer. Set the new offset.
92             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
93-            return TRUE;
94+            return true;
95         }
96         if (index >= length && uText->chunkNativeLimit == length) {
97             // Off the end of the buffer, but we can't get it.
98             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
99-            return FALSE;
100+            return false;
101         }
102     } else {
103         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
104             // Already inside the buffer. Set the new offset.
105             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
106-            return TRUE;
107+            return true;
108         }
109         if (!index && !uText->chunkNativeStart) {
110             // Already at the beginning; can't go any farther.
111             uText->chunkOffset = 0;
112-            return FALSE;
113+            return false;
114         }
115     }
116
117@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
118
119     uText->nativeIndexingLimit = uText->chunkLength;
120
121-    return TRUE;
122+    return true;
123 }
124
125 static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
126@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UText* text)
127 static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
128 {
129     if (!text->context)
130-        return FALSE;
131+        return false;
132     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
133     UBool isAccessible;
134     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
135@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBo
136         ASSERT(newContext == UTextProviderContext::PriorContext);
137         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
138     }
139-    return TRUE;
140+    return true;
141 }
142
143 static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
144diff --git a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
145index 7aaac48c8151..9ae0d367f1f6 100644
146--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
147+++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
148@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLength(UText* text)
149 static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
150 {
151     if (!text->context)
152-        return FALSE;
153+        return false;
154     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
155     UBool isAccessible;
156     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
157@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBoo
158         ASSERT(newContext == UTextProviderContext::PriorContext);
159         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
160     }
161-    return TRUE;
162+    return true;
163 }
164
165 static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
166--
1672.25.1
168
169