diff options
| author | Teddy Wing | 2021-03-07 14:54:33 +0100 |
|---|---|---|
| committer | Teddy Wing | 2021-03-07 14:54:33 +0100 |
| commit | 615c7534df4eb4b02d6425a725039710b3d06efc (patch) | |
| tree | bde5058dfbb4af3957cda0be888a6168a2483caa /DDHotKeyCenter.m | |
| parent | 13297ddeb7d89356f75e0e21f123a69a3f692f3d (diff) | |
| download | DDHotKey-remove-modifier-mask-deprecation-warnings.tar.bz2 | |
Fix `-Wnon-literal-null-conversion` warningsremove-modifier-mask-deprecation-warnings
$ clang -x objective-c \
-fobjc-arc \
-c \
DDHotKeyCenter.m
DDHotKeyCenter.m:188:85: warning: expression which evaluates to zero treated as a null pointer constant of type 'DDHotKey *' [-Wnon-literal-null-conversion]
if ([self hasRegisteredHotKeyWithKeyCode:keyCode modifierFlags:flags]) { return NO; }
^~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:90:13: note: expanded from macro 'NO'
#define NO __objc_no
^~~~~~~~~
DDHotKeyCenter.m:200:85: warning: expression which evaluates to zero treated as a null pointer constant of type 'DDHotKey *' [-Wnon-literal-null-conversion]
if ([self hasRegisteredHotKeyWithKeyCode:keyCode modifierFlags:flags]) { return NO; }
^~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/objc.h:90:13: note: expanded from macro 'NO'
#define NO __objc_no
^~~~~~~~~
2 warnings generated.
Diffstat (limited to 'DDHotKeyCenter.m')
| -rw-r--r-- | DDHotKeyCenter.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/DDHotKeyCenter.m b/DDHotKeyCenter.m index e2d5997..a389a81 100644 --- a/DDHotKeyCenter.m +++ b/DDHotKeyCenter.m @@ -185,7 +185,7 @@ static DDHotKeyCenter *sharedHotKeyCenter = nil; - (DDHotKey *)registerHotKeyWithKeyCode:(unsigned short)keyCode modifierFlags:(NSUInteger)flags task:(DDHotKeyTask)task { //we can't add a new hotkey if something already has this combo - if ([self hasRegisteredHotKeyWithKeyCode:keyCode modifierFlags:flags]) { return NO; } + if ([self hasRegisteredHotKeyWithKeyCode:keyCode modifierFlags:flags]) { return NULL; } DDHotKey *newHotKey = [[DDHotKey alloc] init]; [newHotKey _setTask:task]; @@ -197,7 +197,7 @@ static DDHotKeyCenter *sharedHotKeyCenter = nil; - (DDHotKey *)registerHotKeyWithKeyCode:(unsigned short)keyCode modifierFlags:(NSUInteger)flags target:(id)target action:(SEL)action object:(id)object { //we can't add a new hotkey if something already has this combo - if ([self hasRegisteredHotKeyWithKeyCode:keyCode modifierFlags:flags]) { return NO; } + if ([self hasRegisteredHotKeyWithKeyCode:keyCode modifierFlags:flags]) { return NULL; } //build the hotkey object: DDHotKey *newHotKey = [[DDHotKey alloc] init]; |
