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