Title: [217847] trunk/Tools
Revision
217847
Author
[email protected]
Date
2017-06-06 11:45:24 -0700 (Tue, 06 Jun 2017)

Log Message

Move WTF_ATTRIBUTE_PRINTF() from implementation to declaration
<https://webkit.org/b/172804>

Reviewed by Darin Adler.

WTF_ATTRIBUTE_PRINTF() only works outside the current
compilation unit if it's on the declaration, not the
implementation, of a function or class method.

* DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
* DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
* DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
- Move WTF_ATTRIBUTE_PRINTF() macro to declaration.
* DumpRenderTree/TestNetscapePlugIn/main.cpp:
- Remove redundant CRASH() macro definition.  Use the one from
  <wtf/Assertions.h> instead.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (217846 => 217847)


--- trunk/Tools/ChangeLog	2017-06-06 18:35:41 UTC (rev 217846)
+++ trunk/Tools/ChangeLog	2017-06-06 18:45:24 UTC (rev 217847)
@@ -1,3 +1,23 @@
+2017-06-06  David Kilzer  <[email protected]>
+
+        Move WTF_ATTRIBUTE_PRINTF() from implementation to declaration
+        <https://webkit.org/b/172804>
+
+        Reviewed by Darin Adler.
+
+        WTF_ATTRIBUTE_PRINTF() only works outside the current
+        compilation unit if it's on the declaration, not the
+        implementation, of a function or class method.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+        * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+        - Move WTF_ATTRIBUTE_PRINTF() macro to declaration.
+        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+        - Remove redundant CRASH() macro definition.  Use the one from
+          <wtf/Assertions.h> instead.
+
 2017-06-06  Joseph Pecoraro  <[email protected]>
 
         Move Resource Timing / User Timing from experimental features into main preferences

Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp (217846 => 217847)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp	2017-06-06 18:35:41 UTC (rev 217846)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp	2017-06-06 18:45:24 UTC (rev 217847)
@@ -37,7 +37,6 @@
 #include <string.h>
 #include <wtf/Platform.h>
 #include <wtf/ExportMacros.h>
-#include <wtf/Assertions.h>
 
 // Helper function which takes in the plugin window object for logging to the console object.
 static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, const char* message)
@@ -64,7 +63,6 @@
     browser->releaseobject(consoleObject);
 }
 
-WTF_ATTRIBUTE_PRINTF(2, 0)
 void pluginLogWithArguments(NPP instance, const char* format, va_list args)
 {
     const size_t messageBufferSize = 2048;
@@ -85,7 +83,6 @@
 }
 
 // Helper function to log to the console object.
-WTF_ATTRIBUTE_PRINTF(2, 3)
 void pluginLog(NPP instance, const char* format, ...)
 {
     va_list args;

Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h (217846 => 217847)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h	2017-06-06 18:35:41 UTC (rev 217846)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h	2017-06-06 18:45:24 UTC (rev 217847)
@@ -28,6 +28,7 @@
 
 #include <WebKit/npfunctions.h>
 #include <stdarg.h>
+#include <wtf/Assertions.h>
 
 class PluginTest;
 
@@ -76,8 +77,8 @@
 extern void handleCallback(PluginObject* object, const char *url, NPReason reason, void *notifyData);
 extern void notifyStream(PluginObject* object, const char *url, const char *headers);
 extern void testNPRuntime(NPP npp);
-extern void pluginLog(NPP instance, const char* format, ...);
-extern void pluginLogWithArguments(NPP instance, const char* format, va_list args);
+extern void pluginLog(NPP instance, const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3);
+extern void pluginLogWithArguments(NPP instance, const char* format, va_list args) WTF_ATTRIBUTE_PRINTF(2, 0);
 extern bool testDocumentOpen(NPP npp);
 extern bool testWindowOpen(NPP npp);
 

Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp (217846 => 217847)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp	2017-06-06 18:35:41 UTC (rev 217846)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp	2017-06-06 18:45:24 UTC (rev 217847)
@@ -30,7 +30,6 @@
 #include <string.h>
 #include <wtf/Platform.h>
 #include <wtf/ExportMacros.h>
-#include <wtf/Assertions.h>
 
 #if defined(XP_UNIX) || defined(ANDROID)
 #include <unistd.h>
@@ -272,7 +271,6 @@
     browser->releasevariantvalue(&browserResult);
 }
 
-WTF_ATTRIBUTE_PRINTF(2, 3)
 void PluginTest::log(const char* format, ...)
 {
     va_list args;

Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h (217846 => 217847)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h	2017-06-06 18:35:41 UTC (rev 217846)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h	2017-06-06 18:45:24 UTC (rev 217847)
@@ -30,6 +30,7 @@
 #include <assert.h>
 #include <map>
 #include <string>
+#include <wtf/Assertions.h>
 
 // Helper classes for implementing has_member
 typedef char (&no_tag)[1];
@@ -101,7 +102,7 @@
 
     bool executeScript(const NPString*, NPVariant* result);
     void executeScript(const char*);
-    void log(const char* format, ...);
+    void log(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3);
 
     void registerNPShutdownFunction(void (*)());
 

Modified: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp (217846 => 217847)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp	2017-06-06 18:35:41 UTC (rev 217846)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp	2017-06-06 18:45:24 UTC (rev 217847)
@@ -41,18 +41,6 @@
 
 using namespace std;
 
-#if defined(__GNUC__)
-#define CRASH() do { \
-    *(int *)(uintptr_t)0xbbadbeef = 0; \
-    __builtin_trap(); /* More reliable, but doesn't say BBADBEEF. */ \
-} while (false)
-#else
-#define CRASH() do { \
-    *(int *)(uintptr_t)0xbbadbeef = 0; \
-    ((void(*)())0)(); /* More reliable, but doesn't say BBADBEEF */ \
-} while (false)
-#endif
-
 static bool getEntryPointsWasCalled;
 static bool initializeWasCalled;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to