Modified: trunk/Source/WTF/ChangeLog (234410 => 234411)
--- trunk/Source/WTF/ChangeLog 2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Source/WTF/ChangeLog 2018-07-31 09:20:57 UTC (rev 234411)
@@ -1,3 +1,16 @@
+2018-07-31 Tomas Popela <tpop...@redhat.com>
+
+ [WTF] String::formatWithArguments() is unused
+ https://bugs.webkit.org/show_bug.cgi?id=187955
+
+ Reviewed by Darin Adler.
+
+ This method is unused, remove it.
+
+ * wtf/text/WTFString.cpp:
+ (WTF::String::formatWithArguments): Deleted.
+ * wtf/text/WTFString.h:
+
2018-07-28 Mark Lam <mark....@apple.com>
Gardening: build fix for internal builds.
Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (234410 => 234411)
--- trunk/Source/WTF/wtf/text/WTFString.cpp 2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp 2018-07-31 09:20:57 UTC (rev 234411)
@@ -499,11 +499,6 @@
return StringImpl::create(reinterpret_cast<const LChar*>(buffer.data()), len);
}
-String String::formatWithArguments(const char *format, va_list args)
-{
- return createWithFormatAndArguments(format, args);
-}
-
String String::format(const char *format, ...)
{
va_list args;
Modified: trunk/Source/WTF/wtf/text/WTFString.h (234410 => 234411)
--- trunk/Source/WTF/wtf/text/WTFString.h 2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Source/WTF/wtf/text/WTFString.h 2018-07-31 09:20:57 UTC (rev 234411)
@@ -263,7 +263,6 @@
WTF_EXPORT_PRIVATE String foldCase() const;
WTF_EXPORT_PRIVATE static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
- WTF_EXPORT_PRIVATE static String formatWithArguments(const char *, va_list) WTF_ATTRIBUTE_PRINTF(1, 0);
// Returns an uninitialized string. The characters needs to be written
// into the buffer returned in data before the returned string is used.
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp (234410 => 234411)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp 2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp 2018-07-31 09:20:57 UTC (rev 234411)
@@ -460,45 +460,6 @@
EXPECT_EQ(reference.reverseFind('c', 4), notFound);
}
-WTF_ATTRIBUTE_PRINTF(2, 3)
-static void testWithFormatAndArguments(const char* expected, const char* format, ...)
-{
- va_list arguments;
- va_start(arguments, format);
-
-#if COMPILER(GCC_OR_CLANG)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-#endif
- String result = String::formatWithArguments(format, arguments);
-#if COMPILER(GCC_OR_CLANG)
-#pragma GCC diagnostic pop
-#endif
-
- va_end(arguments);
-
- EXPECT_STREQ(expected, result.utf8().data());
-}
-
-TEST(WTF, StringFormatWithArguments)
-{
- testWithFormatAndArguments("hello cruel world", "%s %s %s", "hello", "cruel" , "world");
-
- testWithFormatAndArguments("hello 17890 world", "%s%u%s", "hello ", 17890u, " world");
-
- testWithFormatAndArguments("hello 17890.000 world", "%s %.3f %s", "hello", 17890.0f, "world");
- testWithFormatAndArguments("hello 17890.50 world", "%s %.2f %s", "hello", 17890.5f, "world");
-
- testWithFormatAndArguments("hello -17890 world", "%s %.0f %s", "hello", -17890.0f, "world");
- testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5f, "world");
-
- testWithFormatAndArguments("hello 17890 world", "%s %.0f %s", "hello", 17890.0, "world");
- testWithFormatAndArguments("hello 17890.5 world", "%s %.1f %s", "hello", 17890.5, "world");
-
- testWithFormatAndArguments("hello -17890 world", "%s %.0f %s", "hello", -17890.0, "world");
- testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5, "world");
-}
-
TEST(WTF, StringSplitWithConsecutiveSeparators)
{
String string { " This is a sentence. " };