diff options
| author | Tomáš Znamenáček | 2015-10-12 09:28:19 +0200 | 
|---|---|---|
| committer | Tomáš Znamenáček | 2015-10-12 09:28:19 +0200 | 
| commit | dd2507b7f97b9601e60ab7529e24d4b7a9cf657e (patch) | |
| tree | 8d6dc3c63fe6d3fc6f3530e6f210b3306e76eb33 | |
| parent | a0af086f16597146db71e1339c6cd2a55a00ff1b (diff) | |
| download | MASShortcut-dd2507b7f97b9601e60ab7529e24d4b7a9cf657e.tar.bz2 | |
Silenced a potential “tautological compare” warning in MASShortcutView.
Fixes #76. I considered putting the #pragma just around the particular
compare line, but I think having it around the whole block is more readable
and there’s little chance of having some legitimate warnings silenced.
| -rw-r--r-- | Framework/MASShortcutView.m | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index 2e303cf..8540e61 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -138,6 +138,12 @@ static const CGFloat MASButtonFontSize = 11;      [self setNeedsDisplay:YES];      // Give VoiceOver users feedback on the result. Requires at least 10.9 to run. +    // We’re silencing the “tautological compare” warning here so that if someone +    // takes the naked source files and compiles them with -Wall, the following +    // NSAccessibilityPriorityKey comparison doesn’t cause a warning. See: +    // https://github.com/shpakovski/MASShortcut/issues/76 +    #pragma clang diagnostic push +    #pragma clang diagnostic ignored "-Wtautological-compare"      if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) {          NSString* msg = _shortcutValue ?                           MASLocalizedString(@"Shortcut set", @"VoiceOver: Shortcut set") : @@ -148,6 +154,7 @@ static const CGFloat MASButtonFontSize = 11;          };          NSAccessibilityPostNotificationWithUserInfo(self, NSAccessibilityAnnouncementRequestedNotification, announcementInfo);      } +    #pragma clang diagnostic pop  }  - (void)setShortcutValue:(MASShortcut *)shortcutValue | 
