WebKit fixes to enable -Wstrict-prototypes for Safari
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Dec 2017 21:34:53 +0000 (21:34 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Dec 2017 21:34:53 +0000 (21:34 +0000)
<https://webkit.org/b/181146>

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/ios/wak/WebCoreThread.h:
(WebThreadLockFromAnyThread):
(WebThreadLockFromAnyThreadNoLog):
(WebThreadUnlockFromAnyThread):
(WebThreadUnlockGuardForMail):
(WebThreadSetShouldYield):
- Add 'void' to C function declarations.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadLockFromAnyThread):
(WebThreadLockFromAnyThreadNoLog):
(WebThreadUnlockFromAnyThread):
(WebThreadUnlockGuardForMail):
- Add 'void' to C function implementations.
* platform/ios/wak/WebCoreThreadRun.cpp:
(class WebThreadBlock): Add 'void' to block declarations.
Rename 'task' to 'block' for consistency.
(_WebThreadRun): Add 'void' to block declaration.  Make
argument name match declaration by changing 'task' to 'block'.
(WebThreadRun): Ditto.
* platform/ios/wak/WebCoreThreadRun.h:
(WebThreadRun): Add 'void' to block declaration.

Source/WebKit:

* Shared/API/c/WKGeometry.cpp:
(WKSizeGetTypeID):
(WKPointGetTypeID):
(WKRectGetTypeID):
* Shared/API/c/WKGeometry.h:
(WKSizeGetTypeID):
(WKPointGetTypeID):
(WKRectGetTypeID):
* Shared/API/c/WKImage.cpp:
(WKImageGetTypeID):
* Shared/API/c/WKImage.h:
(WKImageGetTypeID):
- Add 'void' to C function declarations and implementations as
  necessary.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView applyAutocorrection:toString:withCompletionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
- Add 'void' to block declarations as necessary.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@226291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/ios/wak/WebCoreThread.h
Source/WebCore/platform/ios/wak/WebCoreThread.mm
Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp
Source/WebCore/platform/ios/wak/WebCoreThreadRun.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/c/WKGeometry.cpp
Source/WebKit/Shared/API/c/WKGeometry.h
Source/WebKit/Shared/API/c/WKImage.cpp
Source/WebKit/Shared/API/c/WKImage.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

index 80c4d2a..c3d6c70 100644 (file)
@@ -1,3 +1,32 @@
+2017-12-24  David Kilzer  <ddkilzer@apple.com>
+
+        WebKit fixes to enable -Wstrict-prototypes for Safari
+        <https://webkit.org/b/181146>
+
+        Reviewed by Dan Bernstein.
+
+        * platform/ios/wak/WebCoreThread.h:
+        (WebThreadLockFromAnyThread):
+        (WebThreadLockFromAnyThreadNoLog):
+        (WebThreadUnlockFromAnyThread):
+        (WebThreadUnlockGuardForMail):
+        (WebThreadSetShouldYield):
+        - Add 'void' to C function declarations.
+        * platform/ios/wak/WebCoreThread.mm:
+        (WebThreadLockFromAnyThread):
+        (WebThreadLockFromAnyThreadNoLog):
+        (WebThreadUnlockFromAnyThread):
+        (WebThreadUnlockGuardForMail):
+        - Add 'void' to C function implementations.
+        * platform/ios/wak/WebCoreThreadRun.cpp:
+        (class WebThreadBlock): Add 'void' to block declarations.
+        Rename 'task' to 'block' for consistency.
+        (_WebThreadRun): Add 'void' to block declaration.  Make
+        argument name match declaration by changing 'task' to 'block'.
+        (WebThreadRun): Ditto.
+        * platform/ios/wak/WebCoreThreadRun.h:
+        (WebThreadRun): Add 'void' to block declaration.
+
 2017-12-22  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Implement Element.animate()
index 279470c..e7d7bc6 100644 (file)
@@ -74,16 +74,16 @@ WEBCORE_EXPORT bool WebThreadNotCurrent(void);
     
 // These are for <rdar://problem/6817341> Many apps crashing calling -[UIFieldEditor text] in secondary thread
 // Don't use them to solve any random problems you might have.
-WEBCORE_EXPORT void WebThreadLockFromAnyThread();
-WEBCORE_EXPORT void WebThreadLockFromAnyThreadNoLog();
-WEBCORE_EXPORT void WebThreadUnlockFromAnyThread();
+WEBCORE_EXPORT void WebThreadLockFromAnyThread(void);
+WEBCORE_EXPORT void WebThreadLockFromAnyThreadNoLog(void);
+WEBCORE_EXPORT void WebThreadUnlockFromAnyThread(void);
 
 // This is for <rdar://problem/8005192> Mail entered a state where message subject and content isn't displayed.
 // It should only be used for MobileMail to work around <rdar://problem/8005192>.
-WEBCORE_EXPORT void WebThreadUnlockGuardForMail();
+WEBCORE_EXPORT void WebThreadUnlockGuardForMail(void);
 
 static inline bool WebThreadShouldYield(void) { return webThreadShouldYield; }
-static inline void WebThreadSetShouldYield() { webThreadShouldYield = true; }
+static inline void WebThreadSetShouldYield(void) { webThreadShouldYield = true; }
 
 WEBCORE_EXPORT NSRunLoop* WebThreadNSRunLoop(void);
 
index c6f38b2..1bf15f4 100644 (file)
@@ -742,12 +742,12 @@ void WebThreadUnlock(void)
     ASSERT(!WebThreadIsCurrent());
 }
 
-void WebThreadLockFromAnyThread()
+void WebThreadLockFromAnyThread(void)
 {
     _WebThreadLockFromAnyThread(true);
 }
     
-void WebThreadLockFromAnyThreadNoLog()
+void WebThreadLockFromAnyThreadNoLog(void)
 {
     _WebThreadLockFromAnyThread(false);
 }
@@ -771,7 +771,7 @@ static void _WebThreadLockFromAnyThread(bool shouldLog)
     webThreadShouldYield = false;
 }
 
-void WebThreadUnlockFromAnyThread()
+void WebThreadUnlockFromAnyThread(void)
 {
     if (!webThreadStarted)
         return;
@@ -786,7 +786,7 @@ void WebThreadUnlockFromAnyThread()
     webLock.unlock();
 }
 
-void WebThreadUnlockGuardForMail()
+void WebThreadUnlockGuardForMail(void)
 {
     ASSERT(!WebThreadIsCurrent());
 
index 3047649..efefc22 100644 (file)
@@ -67,41 +67,41 @@ private:
 
 class WebThreadBlock {
 public:
-    WebThreadBlock(void (^task)(), WebThreadBlockState* state)
-        : m_task(Block_copy(task))
+    WebThreadBlock(void (^block)(void), WebThreadBlockState* state)
+        : m_block(Block_copy(block))
         , m_state(state)
     {
     }
 
     WebThreadBlock(const WebThreadBlock& other)
-        : m_task(Block_copy(other.m_task))
+        : m_block(Block_copy(other.m_block))
         , m_state(other.m_state)
     {
     }
 
     WebThreadBlock& operator=(const WebThreadBlock& other)
     {
-        void (^oldTask)() = m_task;
-        m_task = Block_copy(other.m_task);
-        Block_release(oldTask);
+        void (^oldBlock)() = m_block;
+        m_block = Block_copy(other.m_block);
+        Block_release(oldBlock);
         m_state = other.m_state;
         return *this;
     }
 
     ~WebThreadBlock()
     {
-        Block_release(m_task);
+        Block_release(m_block);
     }
 
     void operator()() const
     {
-        m_task();
+        m_block();
         if (m_state)
             m_state->setCompleted();
     }
 
 private:
-    void (^m_task)();
+    void (^m_block)(void);
     WebThreadBlockState* m_state;
 };
 
@@ -133,10 +133,10 @@ static void HandleRunSource(void *info)
         block();
 }
 
-static void _WebThreadRun(void (^task)(), bool synchronous)
+static void _WebThreadRun(void (^block)(void), bool synchronous)
 {
     if (WebThreadIsCurrent() || !WebThreadIsEnabled()) {
-        task();
+        block();
         return;
     }
 
@@ -149,7 +149,7 @@ static void _WebThreadRun(void (^task)(), bool synchronous)
 
     {
         std::lock_guard<StaticLock> lock(runQueueMutex);
-        runQueue->append(WebThreadBlock(task, state));
+        runQueue->append(WebThreadBlock(block, state));
     }
 
     CFRunLoopSourceSignal(runSource);
@@ -161,9 +161,9 @@ static void _WebThreadRun(void (^task)(), bool synchronous)
     }
 }
 
-void WebThreadRun(void (^task)())
+void WebThreadRun(void (^block)(void))
 {
-    _WebThreadRun(task, false);
+    _WebThreadRun(block, false);
 }
 
 void WebThreadInitRunQueue()
index 1e4eb79..62519e6 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 
 // On the web thread WebThreadRun just runs the block immediately.
 // On any other thread, it will queue the block for asynchronous execution on the web thread.
-WEBCORE_EXPORT void WebThreadRun(void (^block)());
+WEBCORE_EXPORT void WebThreadRun(void (^block)(void));
 
 #if defined(__cplusplus)
 } // extern "C"
index f2eead1..4ee584f 100644 (file)
@@ -1,5 +1,32 @@
 2017-12-24  David Kilzer  <ddkilzer@apple.com>
 
+        WebKit fixes to enable -Wstrict-prototypes for Safari
+        <https://webkit.org/b/181146>
+
+        Reviewed by Dan Bernstein.
+
+        * Shared/API/c/WKGeometry.cpp:
+        (WKSizeGetTypeID):
+        (WKPointGetTypeID):
+        (WKRectGetTypeID):
+        * Shared/API/c/WKGeometry.h:
+        (WKSizeGetTypeID):
+        (WKPointGetTypeID):
+        (WKRectGetTypeID):
+        * Shared/API/c/WKImage.cpp:
+        (WKImageGetTypeID):
+        * Shared/API/c/WKImage.h:
+        (WKImageGetTypeID):
+        - Add 'void' to C function declarations and implementations as
+          necessary.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        - Add 'void' to block declarations as necessary.
+
+2017-12-24  David Kilzer  <ddkilzer@apple.com>
+
         REGRESSION (r224313): Fix build warning when compiling WebKit.xcassets
         <https://webkit.org/b/181148>
 
index e1ea824..4cd5e3d 100644 (file)
 
 using namespace WebKit;
 
-WKTypeID WKSizeGetTypeID()
+WKTypeID WKSizeGetTypeID(void)
 {
     return toAPI(API::Size::APIType);
 }
 
-WKTypeID WKPointGetTypeID()
+WKTypeID WKPointGetTypeID(void)
 {
     return toAPI(API::Point::APIType);
 }
 
-WKTypeID WKRectGetTypeID()
+WKTypeID WKRectGetTypeID(void)
 {
     return toAPI(API::Rect::APIType);
 }
index 124fe24..c82cede 100644 (file)
@@ -76,9 +76,9 @@ WK_INLINE WKRect WKRectMake(double x, double y, double width, double height)
     return rect;
 }
 
-WK_EXPORT WKTypeID WKSizeGetTypeID();
-WK_EXPORT WKTypeID WKPointGetTypeID();
-WK_EXPORT WKTypeID WKRectGetTypeID();
+WK_EXPORT WKTypeID WKSizeGetTypeID(void);
+WK_EXPORT WKTypeID WKPointGetTypeID(void);
+WK_EXPORT WKTypeID WKRectGetTypeID(void);
 
 WK_EXPORT WKPointRef WKPointCreate(WKPoint point);
 WK_EXPORT WKSizeRef WKSizeCreate(WKSize size);
index 2741199..68e6381 100644 (file)
@@ -31,7 +31,7 @@
 
 using namespace WebKit;
 
-WKTypeID WKImageGetTypeID()
+WKTypeID WKImageGetTypeID(void)
 {
     return toAPI(WebImage::APIType);
 }
index 88579c9..a7da3bf 100644 (file)
@@ -51,7 +51,7 @@ enum {
 };
 typedef uint32_t WKSnapshotOptions;
 
-WK_EXPORT WKTypeID WKImageGetTypeID();
+WK_EXPORT WKTypeID WKImageGetTypeID(void);
 
 WK_EXPORT WKImageRef WKImageCreate(WKSize size, WKImageOptions options);
 
index e4fc0db..028f4e5 100644 (file)
@@ -5707,7 +5707,7 @@ static WebCore::UserInterfaceLayoutDirection toUserInterfaceLayoutDirection(UISe
     [_contentView accessoryTab:NO];
 }
 
-- (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)())completionHandler
+- (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)(void))completionHandler
 {
     [_contentView applyAutocorrection:newString toString:oldString withCompletionHandler:[capturedCompletionHandler = makeBlockPtr(completionHandler)] (UIWKAutocorrectionRects *rects) {
         capturedCompletionHandler();
index f5897e0..c0b40b0 100644 (file)
@@ -377,7 +377,7 @@ typedef NS_OPTIONS(NSInteger, _WKRectEdge) {
 - (void)dismissFormAccessoryView WK_API_AVAILABLE(ios(10.3));
 - (void)selectFormAccessoryPickerRow:(int)rowIndex WK_API_AVAILABLE(ios(10.3));
 
-- (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)())completionHandler WK_API_AVAILABLE(ios(11.0));
+- (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(ios(11.0));
 
 - (void)didStartFormControlInteraction WK_API_AVAILABLE(ios(10.3));
 - (void)didEndFormControlInteraction WK_API_AVAILABLE(ios(10.3));