You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/09/16 20:18:49 UTC

[GitHub] [cordova-osx] fortuna commented on a change in pull request #113: Cast objc_msgSend when calling plugin methods

fortuna commented on a change in pull request #113:
URL: https://github.com/apache/cordova-osx/pull/113#discussion_r710445774



##########
File path: CordovaLib/CordovaLib/Classes/CDVBridge.m
##########
@@ -74,7 +74,8 @@ - (void) exec:(NSString*) callbackId withService:(NSString*) service andAction:(
     SEL normalSelector = NSSelectorFromString(methodName);
     if ([obj respondsToSelector:normalSelector]) {
         // [obj performSelector:normalSelector withObject:command];
-        objc_msgSend(obj, normalSelector, command);
+        void (*msgSend)(id, SEL, CDVInvokedUrlCommand*) = (void (*)(id, SEL, CDVInvokedUrlCommand*)) objc_msgSend;

Review comment:
       +1 for casting at the call site. It seem a bit more obvious what's going on.
   
   By the way, the cast is the right fix, according to https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.html




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org