Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce compilation warnings #415

Merged
merged 1 commit into from Sep 27, 2018

Conversation

verpeteren
Copy link
Contributor

It appears that a cast can reduce some of the compile warnings.

See also:

The compile warnings were:

../src/keypress.c:214:48: warning: incompatible pointer types passing 'unsigned short (*)[2]' to parameter of type
      'const UniChar * _Nullable' (aka 'const unsigned short *') [-Wincompatible-pointer-types]
                CGEventKeyboardSetUnicodeString(keyEvent, 2, &surrogates);
                                                             ^~~~~~~~~~~
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h:206:59: note: passing argument to parameter 'unicodeString' here
    UniCharCount stringLength, const UniChar * __nullable unicodeString)
                                                          ^
../src/keypress.c:216:48: warning: incompatible pointer types passing 'unsigned long *' to parameter of type
      'const UniChar * _Nullable' (aka 'const unsigned short *') [-Wincompatible-pointer-types]
                CGEventKeyboardSetUnicodeString(keyEvent, 1, &ch);
                                                             ^~~
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h:206:59: note: passing argument to parameter 'unicodeString' here
    UniCharCount stringLength, const UniChar * __nullable unicodeString)

It appears that a cast can reduce some of the compile warnings.

See also:

* octalmage#183
* octalmage#413

The compile warnings were:

```
../src/keypress.c:214:48: warning: incompatible pointer types passing 'unsigned short (*)[2]' to parameter of type
      'const UniChar * _Nullable' (aka 'const unsigned short *') [-Wincompatible-pointer-types]
                CGEventKeyboardSetUnicodeString(keyEvent, 2, &surrogates);
                                                             ^~~~~~~~~~~
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h:206:59: note: passing argument to parameter 'unicodeString' here
    UniCharCount stringLength, const UniChar * __nullable unicodeString)
                                                          ^
../src/keypress.c:216:48: warning: incompatible pointer types passing 'unsigned long *' to parameter of type
      'const UniChar * _Nullable' (aka 'const unsigned short *') [-Wincompatible-pointer-types]
                CGEventKeyboardSetUnicodeString(keyEvent, 1, &ch);
                                                             ^~~
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h:206:59: note: passing argument to parameter 'unicodeString' here
    UniCharCount stringLength, const UniChar * __nullable unicodeString)
```
@octalmage
Copy link
Owner

Thanks!

@octalmage octalmage merged commit 37d34d7 into octalmage:master Sep 27, 2018
@verpeteren verpeteren deleted the reduce-compilation-warnings branch September 28, 2018 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants