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/12/12 16:13:19 UTC

[GitHub] [cordova-plugin-dialogs] nacho4d opened a new pull request #156: Fix warning in CDVNotification.m: Cast to smaller integer type 'int' from 'void *'

nacho4d opened a new pull request #156:
URL: https://github.com/apache/cordova-plugin-dialogs/pull/156


   ### Platforms affected
   iOS
   
   ### Motivation and Context
   Xcode reports warning in CDVNotification.m in soundCompletionCallback (callback function of AudioServicesAddSystemSoundCompletion playBeep).
   
   ### Description
   
   In order to implement an loop counter an int was passed to the callback function (it requires `void*`) so internally a cast from void* to int was required however this is bad practice and fragile.
   
   Instead of using a raw int value I changed to NSNumber which is is a pointer and can be retained while the beep is being played. 
   
   I wrote the code to support ARC and non-ARC code as same as surrounding code.
   
   ### Testing
   
   Play beep works normally. No visible changes for users as expected.
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [x] I added automated test coverage as appropriate for this change
   - [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


-- 
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