Skip to content

Tools: replace UChar with char16_t #46966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

adetaylor
Copy link
Contributor

@adetaylor adetaylor commented Jun 19, 2025

29d7763

Tools: replace UChar with char16_t
https://bugs.webkit.org/show_bug.cgi?id=294732
rdar://153822948

Reviewed by Alex Christensen.

WebKit wishes to move from UChar to the C++ standard char16_t. This PR makes
that change for the Tools subdirectory. It's a plain textual substitution of
\bUChar\b for char16_t. These types are identical due to typedef so no
functional changes are expected.

This is one of a series of PRs making this change for each part of WebKit.

* Tools/DumpRenderTree/TestRunner.cpp:
(TestRunner::runUIScript):
* Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback):
* Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F(FileSystemTest, isAncestor)):
* Tools/TestWebKitAPI/Tests/WTF/HexNumber.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::builderContent):
(TestWebKitAPI::TEST(StringBuilderTest, Append)):
* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
(TestWebKitAPI::TEST(WTF_StringCommon, Find16NonASCII)):
(TestWebKitAPI::TEST(WTF_StringCommon, CharactersContain16)):
(TestWebKitAPI::TEST(WTF_StringCommon, CountMatchedCharacters16)):
* Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST(WTF, StringConcatenate_Tuple)):
* Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp:
(TestWebKitAPI::TEST(WTF, StringHasher)):
(TestWebKitAPI::TEST(WTF, StringHasher_SuperFastHash_VS_WYHash)):
* Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST(WTF, StringImplReplaceWithLiteral)):
(TestWebKitAPI::TEST(WTF, ExternalStringImplCreate16bit)):
* Tools/TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::compareLoopIterations):
(TestWebKitAPI::build):
(TestWebKitAPI::TEST(WTF, StringViewIterators)):
(TestWebKitAPI::TEST(WTF, StringView8Bit)):
(TestWebKitAPI::TEST(WTF, StringViewTrim)):
(TestWebKitAPI::TEST(WTF, StringViewContainsOnlyASCII)):
* Tools/TestWebKitAPI/Tests/WTF/SuperFastHash.cpp:
(TestWebKitAPI::TEST(WTF, SuperFastHash_addCharacters)):
(TestWebKitAPI::TEST(WTF, SuperFastHash_addCharactersAssumingAligned)):
(TestWebKitAPI::TEST(WTF, SuperFastHash_computeHash)):
(TestWebKitAPI::TEST(WTF, SuperFastHash_computeHashAndMaskTop8Bits)):
* Tools/TestWebKitAPI/Tests/WTF/TextBreakIterator.cpp:
(TestWebKitAPI::makeUTF16):
* Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST(WTF_Vector, ConstructorOtherRawPointerTypeAndLength)):
* Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST(WTF, StringReplaceWithLiteral)):
(TestWebKitAPI::TEST(WTF, StringUnicodeEqualUCharArray)):
* Tools/TestWebKitAPI/Tests/WTF/WYHash.cpp:
(TestWebKitAPI::TEST(WTF, WYHasher)):
* Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST(URLExtras, URLExtras_ParsingError)):
* Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInRTL)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceInRTL)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInLTR)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceInLTR)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceInRTLNoOrigins)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, LeftExpansion)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, VerticalAdvances)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, TotalWidthWithJustification)):
* Tools/TestWebKitAPI/Tests/WebCore/FontCascade.cpp:
(TestWebKitAPI::testCodePath):
(TestWebKitAPI::testCodePathRange):
* Tools/TestWebKitAPI/Tests/WebCore/LineBreaking.mm:
(breakingLocationsFromICU):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::TestArgumentCoder<String>::decode):
* Tools/TestWebKitAPI/WTFTestUtilities.h:
(TestWebKitAPI::utf16String):
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTF::StringTypeAdapter<WKStringRef>::writeTo<char16_t> const):
(WTF::StringTypeAdapter<WKStringRef>::writeTo<UChar> const): Deleted.
* Tools/gdb/webkit.py:
(UCharStringPrinter):
(add_pretty_printers.lookup_function):
* Tools/lldb/lldbWebKitTester/main.cpp:
(utf16String):

Canonical link: https://commits.webkit.org/296802@main

abcef23

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@adetaylor adetaylor marked this pull request as ready for review June 19, 2025 14:09
@achristensen07 achristensen07 added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jun 30, 2025
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Tools-replace-UChar-with-char16_t branch 2 times, most recently from efe2b0b to 503f151 Compare June 30, 2025 16:17
https://bugs.webkit.org/show_bug.cgi?id=294732
rdar://153822948

Reviewed by Alex Christensen.

WebKit wishes to move from UChar to the C++ standard char16_t. This PR makes
that change for the Tools subdirectory. It's a plain textual substitution of
\bUChar\b for char16_t. These types are identical due to typedef so no
functional changes are expected.

This is one of a series of PRs making this change for each part of WebKit.

* Tools/DumpRenderTree/TestRunner.cpp:
(TestRunner::runUIScript):
* Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback):
* Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F(FileSystemTest, isAncestor)):
* Tools/TestWebKitAPI/Tests/WTF/HexNumber.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::builderContent):
(TestWebKitAPI::TEST(StringBuilderTest, Append)):
* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
(TestWebKitAPI::TEST(WTF_StringCommon, Find16NonASCII)):
(TestWebKitAPI::TEST(WTF_StringCommon, CharactersContain16)):
(TestWebKitAPI::TEST(WTF_StringCommon, CountMatchedCharacters16)):
* Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST(WTF, StringConcatenate_Tuple)):
* Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp:
(TestWebKitAPI::TEST(WTF, StringHasher)):
(TestWebKitAPI::TEST(WTF, StringHasher_SuperFastHash_VS_WYHash)):
* Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST(WTF, StringImplReplaceWithLiteral)):
(TestWebKitAPI::TEST(WTF, ExternalStringImplCreate16bit)):
* Tools/TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::compareLoopIterations):
(TestWebKitAPI::build):
(TestWebKitAPI::TEST(WTF, StringViewIterators)):
(TestWebKitAPI::TEST(WTF, StringView8Bit)):
(TestWebKitAPI::TEST(WTF, StringViewTrim)):
(TestWebKitAPI::TEST(WTF, StringViewContainsOnlyASCII)):
* Tools/TestWebKitAPI/Tests/WTF/SuperFastHash.cpp:
(TestWebKitAPI::TEST(WTF, SuperFastHash_addCharacters)):
(TestWebKitAPI::TEST(WTF, SuperFastHash_addCharactersAssumingAligned)):
(TestWebKitAPI::TEST(WTF, SuperFastHash_computeHash)):
(TestWebKitAPI::TEST(WTF, SuperFastHash_computeHashAndMaskTop8Bits)):
* Tools/TestWebKitAPI/Tests/WTF/TextBreakIterator.cpp:
(TestWebKitAPI::makeUTF16):
* Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST(WTF_Vector, ConstructorOtherRawPointerTypeAndLength)):
* Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST(WTF, StringReplaceWithLiteral)):
(TestWebKitAPI::TEST(WTF, StringUnicodeEqualUCharArray)):
* Tools/TestWebKitAPI/Tests/WTF/WYHash.cpp:
(TestWebKitAPI::TEST(WTF, WYHasher)):
* Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST(URLExtras, URLExtras_ParsingError)):
* Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInRTL)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceInRTL)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInLTR)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceInLTR)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, InitialAdvanceInRTLNoOrigins)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, LeftExpansion)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, VerticalAdvances)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, TotalWidthWithJustification)):
* Tools/TestWebKitAPI/Tests/WebCore/FontCascade.cpp:
(TestWebKitAPI::testCodePath):
(TestWebKitAPI::testCodePathRange):
* Tools/TestWebKitAPI/Tests/WebCore/LineBreaking.mm:
(breakingLocationsFromICU):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::TestArgumentCoder<String>::decode):
* Tools/TestWebKitAPI/WTFTestUtilities.h:
(TestWebKitAPI::utf16String):
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTF::StringTypeAdapter<WKStringRef>::writeTo<char16_t> const):
(WTF::StringTypeAdapter<WKStringRef>::writeTo<UChar> const): Deleted.
* Tools/gdb/webkit.py:
(UCharStringPrinter):
(add_pretty_printers.lookup_function):
* Tools/lldb/lldbWebKitTester/main.cpp:
(utf16String):

Canonical link: https://commits.webkit.org/296802@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Tools-replace-UChar-with-char16_t branch from 503f151 to 29d7763 Compare June 30, 2025 16:18
@webkit-commit-queue
Copy link
Collaborator

Committed 296802@main (29d7763): https://commits.webkit.org/296802@main

Reviewed commits have been landed. Closing PR #46966 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 29d7763 into WebKit:main Jun 30, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants