Skip to content
Snippets Groups Projects
Commit 17c432d4 authored by George Nachman's avatar George Nachman
Browse files

Fix warnings new in xcode 9

parent ab2a7c9b
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 25 deletions
Loading
Loading
@@ -299,7 +299,10 @@ static NSInteger kNonAsciiFontButtonTag = 1;
[[NSFontManager sharedFontManager] orderFrontFontPanel:self];
}
 
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel {
#pragma clang diagnostic pop
return kValidModesForFontPanel;
}
 
Loading
Loading
Loading
Loading
@@ -7495,10 +7495,13 @@ ITERM_WEAKLY_REFERENCEABLE
userInfo:nil];
}
 
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel
{
return kValidModesForFontPanel;
}
#pragma clang diagnostic pop
 
- (void)incrementBadge {
if (![iTermAdvancedSettingsModel indicateBellsInDockBadgeLabel]) {
Loading
Loading
Loading
Loading
@@ -17,6 +17,6 @@
+ (BOOL)willOpenWindows;
 
// Block is run when all windows are restored. It may be run immediately.
+ (void)setRestorationCompletionBlock:(void(^)())completion;
+ (void)setRestorationCompletionBlock:(void(^)(void))completion;
 
@end
Loading
Loading
@@ -204,7 +204,7 @@ static BOOL gWaitingForFullScreen;
}
}
 
+ (void)setRestorationCompletionBlock:(void(^)())completion {
+ (void)setRestorationCompletionBlock:(void(^)(void))completion {
if (queuedBlocks) {
[queuedBlocks addObject:[[completion copy] autorelease]];
} else {
Loading
Loading
Loading
Loading
@@ -11,6 +11,9 @@
#import "DebugLogging.h"
#import "PTYTask.h"
 
#include <sys/time.h>
#include <sys/select.h>
#define PtyTaskDebugLog(args...)
 
NSString *const kTaskNotifierDidSpin = @"kTaskNotifierDidSpin";
Loading
Loading
Loading
Loading
@@ -350,7 +350,7 @@ static int OctalValue(const char *bytes) {
DLog(@"Updating existing tab");
[tabToUpdate_ setTmuxLayout:parseTree
tmuxController:controller_
zoomed:NO];
zoomed:@NO];
if ([tabToUpdate_ layoutIsTooLarge]) {
DLog(@"layout is too large! fit the layout to windows");
[controller_ fitLayoutToWindows];
Loading
Loading
Loading
Loading
@@ -87,7 +87,7 @@
- (int)moveCursorDownOneLineScrollingIntoLineBuffer:(LineBuffer *)lineBuffer
unlimitedScrollback:(BOOL)unlimitedScrollback
useScrollbackWithRegion:(BOOL)useScrollbackWithRegion
willScroll:(void (^)())willScroll;
willScroll:(void (^)(void))willScroll;
 
// Move cursor to the left by n steps. Does not wrap around when it hits the left margin.
// If it starts left of the scroll region, clamp it to the left. If it starts right of the scroll
Loading
Loading
Loading
Loading
@@ -445,7 +445,7 @@ static NSString *const kGridSizeKey = @"Size";
- (int)moveCursorDownOneLineScrollingIntoLineBuffer:(LineBuffer *)lineBuffer
unlimitedScrollback:(BOOL)unlimitedScrollback
useScrollbackWithRegion:(BOOL)useScrollbackWithRegion
willScroll:(void (^)())willScroll {
willScroll:(void (^)(void))willScroll {
// This doesn't call -bottomMargin because it was a hotspot in profiling.
const int scrollBottom = VT100GridRangeMax(scrollRegionRows_);
 
Loading
Loading
Loading
Loading
@@ -189,7 +189,7 @@ ITERM_WEAKLY_REFERENCEABLE
if ([self activationModiferPressIsDoubleTap]) {
NSArray *siblings = [[[iTermFlagsChangedEventTap sharedInstance] observers] mapWithBlock:^id(iTermWeakReference<id<iTermEventTapObserver>> *anObject) {
if (![anObject.weaklyReferencedObject isKindOfClass:[self class]]) {
return NO;
return nil;
}
iTermBaseHotKey *other = (iTermBaseHotKey *)anObject;
if (other.hasModifierActivation && other.modifierActivation == self.modifierActivation) {
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@
 
@interface iTermDisclosableView : NSView
 
@property (nonatomic, copy) void (^requestLayout)();
@property (nonatomic, copy) void (^requestLayout)(void);
 
- (instancetype)initWithFrame:(NSRect)frameRect prompt:(NSString *)prompt message:(NSString *)message;
 
Loading
Loading
Loading
Loading
@@ -5,7 +5,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
#include <syslog.h>
Loading
Loading
Loading
Loading
@@ -15,9 +15,12 @@
[NSFontManager setFontPanelFactory:[iTermFontPanel class]];
}
 
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel
{
return kValidModesForFontPanel;
}
#pragma clang diagnostic pop
 
@end
Loading
Loading
@@ -9,6 +9,7 @@
#import "iTermHTTPConnection.h"
#import "DebugLogging.h"
#import "iTermSocketAddress.h"
#include <sys/select.h>
 
@implementation iTermHTTPConnection {
int _fd;
Loading
Loading
Loading
Loading
@@ -37,7 +37,7 @@ NSString *const iTermImageDidLoad = @"iTermImageDidLoad";
NSData *_data;
NSString *_uniqueIdentifier;
NSDictionary *_dictionary;
void (^_queuedBlock)();
void (^_queuedBlock)(void);
}
 
- (instancetype)initWithCode:(unichar)code {
Loading
Loading
@@ -97,7 +97,7 @@ NSString *const iTermImageDidLoad = @"iTermImageDidLoad";
_dictionary = nil;
DLog(@"Queueing load of %@", self.uniqueIdentifier);
void (^block)() = ^{
void (^block)(void) = ^{
// This is a slow operation that blocks for a long time.
iTermImage *image = [iTermImage imageWithCompressedData:_data];
dispatch_sync(dispatch_get_main_queue(), ^{
Loading
Loading
@@ -116,7 +116,7 @@ NSString *const iTermImageDidLoad = @"iTermImageDidLoad";
[blocks insertObject:_queuedBlock atIndex:0];
}
dispatch_async(queue, ^{
void (^blockToRun)() = nil;
void (^blockToRun)(void) = nil;
@synchronized(self) {
blockToRun = [blocks firstObject];
[blockToRun retain];
Loading
Loading
Loading
Loading
@@ -124,7 +124,7 @@
_self = self;
}
 
- (void)clickThroughElements:(NSArray *)elements completion:(void(^)())completion {
- (void)clickThroughElements:(NSArray *)elements completion:(void(^)(void))completion {
if (_menu.delegate != self) {
DLog(@"I'm not the menu's delegate. We must have been canceled.");
return;
Loading
Loading
Loading
Loading
@@ -62,7 +62,7 @@ static BOOL sAuthenticated;
return [[array sortedArrayUsingSelector:@selector(compare:)] retain];
}
 
+ (void)authenticateWithPolicy:(LAPolicy)policy context:(LAContext *)myContext reply:(void(^)(BOOL success, NSError * __nullable error))reply {
+ (void)authenticateWithPolicy:(LAPolicy)policy context:(LAContext *)myContext reply:(void(^)(BOOL success, NSError * __nullable error))reply NS_AVAILABLE_MAC(10_11) {
DLog(@"Requesting authentication with policy %@", @(policy));
 
NSString *myLocalizedReasonString = @"open the password manager";
Loading
Loading
@@ -87,7 +87,10 @@ static BOOL sAuthenticated;
sAuthenticated = NO;
if (error.code != LAErrorSystemCancel &&
error.code != LAErrorAppCancel) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
BOOL isTouchID = (policy == LAPolicyDeviceOwnerAuthenticationWithBiometrics);
#pragma clang diagnostic pop
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
alert.messageText = @"Authentication Failed";
alert.informativeText = [NSString stringWithFormat:@"Authentication failed because %@", [self reasonForAuthenticationError:error touchID:isTouchID]];
Loading
Loading
@@ -101,7 +104,7 @@ static BOOL sAuthenticated;
}];
}
 
+ (NSString *)reasonForAuthenticationError:(NSError *)error touchID:(BOOL)touchID {
+ (NSString *)reasonForAuthenticationError:(NSError *)error touchID:(BOOL)touchID NS_AVAILABLE_MAC(10_11) {
switch (error.code) {
case LAErrorAuthenticationFailed:
return @"valid credentials weren't supplied.";
Loading
Loading
@@ -296,18 +299,26 @@ static BOOL sAuthenticated;
return;
}
 
LAContext *myContext = [[[LAContext alloc] init] autorelease];
if (![self tryToAuthenticateWithPolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics context:myContext]) {
if (![self tryToAuthenticateWithPolicy:LAPolicyDeviceOwnerAuthentication context:myContext]) {
DLog(@"There are no auth policies that can succeed on this machine. Giving up.");
sAuthenticated = YES;
if (@available(macOS 10.11, *)) {
LAContext *myContext = [[[LAContext alloc] init] autorelease];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
if (![self tryToAuthenticateWithPolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics context:myContext]) {
#pragma clang diagnostic pop
if (![self tryToAuthenticateWithPolicy:LAPolicyDeviceOwnerAuthentication context:myContext]) {
DLog(@"There are no auth policies that can succeed on this machine. Giving up.");
sAuthenticated = YES;
}
}
}
}
 
- (BOOL)policyAvailableOnThisOSVersion:(LAPolicy)policy {
- (BOOL)policyAvailableOnThisOSVersion:(LAPolicy)policy NS_AVAILABLE_MAC(10_11) {
switch (policy) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
case LAPolicyDeviceOwnerAuthenticationWithBiometrics:
#pragma clang diagnostic pop
return IsTouchBarAvailable();
 
case LAPolicyDeviceOwnerAuthentication:
Loading
Loading
@@ -318,7 +329,7 @@ static BOOL sAuthenticated;
}
}
 
- (BOOL)tryToAuthenticateWithPolicy:(LAPolicy)policy context:(LAContext *)myContext {
- (BOOL)tryToAuthenticateWithPolicy:(LAPolicy)policy context:(LAContext *)myContext NS_AVAILABLE_MAC(10_11) {
DLog(@"Try to auth with %@", @(policy));
NSError *authError = nil;
if (![self policyAvailableOnThisOSVersion:policy]) {
Loading
Loading
@@ -335,7 +346,7 @@ static BOOL sAuthenticated;
}
}
 
- (void)authenticateWithPolicy:(LAPolicy)policy context:(LAContext *)myContext {
- (void)authenticateWithPolicy:(LAPolicy)policy context:(LAContext *)myContext NS_AVAILABLE_MAC(10_11) {
[[self class] authenticateWithPolicy:policy context:myContext reply:^(BOOL success, NSError * _Nullable error) {
// When a sheet is attached to a hotkey window another app becomes active after the auth dialog
// is dismissed, leaving the hotkey behind another app.
Loading
Loading
Loading
Loading
@@ -355,7 +355,7 @@ static NSString *sPreviousVersion;
}
 
+ (id)computedObjectForKey:(NSString *)key {
id (^block)() = [self computedObjectDictionary][key];
id (^block)(void) = [self computedObjectDictionary][key];
if (block) {
return block();
} else {
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ extern NSString *const kPreferenceDidChangeFromOtherPanelKeyUserInfoKey;
key:(NSString *)key
type:(PreferenceInfoType)type
settingChanged:(void (^)(id))settingChanged
update:(BOOL (^)())update;
update:(BOOL (^)(void))update;
 
#pragma mark - IBActions
 
Loading
Loading
Loading
Loading
@@ -264,7 +264,7 @@ NSString *const kPreferenceDidChangeFromOtherPanelKeyUserInfoKey = @"key";
key:(NSString *)key
type:(PreferenceInfoType)type
settingChanged:(void (^)(id))settingChanged
update:(BOOL (^)())update {
update:(BOOL (^)(void))update {
assert(![_keyMap objectForKey:key]);
assert(key);
assert(control);
Loading
Loading
Loading
Loading
@@ -14,6 +14,6 @@
@property(nonatomic, assign) BOOL blackAndWhite;
 
// Called when any property here changes.
@property (nonatomic, copy) void (^userDidChangeSetting)();
@property (nonatomic, copy) void (^userDidChangeSetting)(void);
 
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment