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 243 additions and 212 deletions
Loading
Loading
@@ -2409,6 +2409,18 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button misplaced="YES" id="4773">
<rect key="frame" x="324" y="366" width="119" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Blinking cursor" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="4834">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="settingChanged:" target="lhd-u6-xr5" id="fKi-di-3fk"/>
<outlet property="nextKeyView" destination="4782" id="5249"/>
</connections>
</button>
<button verticalHuggingPriority="750" misplaced="YES" id="4774">
<rect key="frame" x="14" y="139" width="138" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
Loading
Loading
@@ -2586,19 +2598,6 @@ DQ
<action selector="settingChanged:" target="lhd-u6-xr5" id="aVZ-El-bBQ"/>
</connections>
</popUpButton>
<button misplaced="YES" id="jlZ-SF-XtE">
<rect key="frame" x="280" y="234" width="207" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<string key="toolTip">Apps (such as your shell or your editor) expect each character to have a particular “width,” between 0 and 2 cells. If the app and the terminal emulator have different width tables, rendering problems ensue. Notably, Unicode 8 defines most Emoji to be 1 cell wide. Most fonts render them as two cells wide. Unicode 9 fixes this. If your apps have been updated for Unicode 9, you should enable this.</string>
<buttonCell key="cell" type="check" title="Use Unicode Version 9 Widths" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="usB-uD-pmw">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="settingChanged:" target="lhd-u6-xr5" id="c3k-nj-VMp"/>
<outlet property="nextKeyView" destination="4765" id="uIt-qC-lLY"/>
</connections>
</button>
<button misplaced="YES" id="mlk-a6-xcL">
<rect key="frame" x="18" y="123" width="106" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
Loading
Loading
@@ -2622,7 +2621,7 @@ DQ
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" misplaced="YES" id="XDS-1Z-hVv">
<rect key="frame" x="198" y="229" width="71" height="26"/>
<rect key="frame" x="198" y="229" width="84" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="None" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="td0-LJ-Zf9" id="ttZ-UD-tsk">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
Loading
Loading
@@ -2685,16 +2684,17 @@ DQ
<outlet property="nextKeyView" destination="4765" id="5254"/>
</connections>
</button>
<button misplaced="YES" id="4773">
<rect key="frame" x="324" y="366" width="119" height="18"/>
<button misplaced="YES" id="jlZ-SF-XtE">
<rect key="frame" x="324" y="234" width="207" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Blinking cursor" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="4834">
<string key="toolTip">Apps (such as your shell or your editor) expect each character to have a particular “width,” between 0 and 2 cells. If the app and the terminal emulator have different width tables, rendering problems ensue. Notably, Unicode 8 defines most Emoji to be 1 cell wide. Most fonts render them as two cells wide. Unicode 9 fixes this. If your apps have been updated for Unicode 9, you should enable this.</string>
<buttonCell key="cell" type="check" title="Use Unicode Version 9 Widths" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="usB-uD-pmw">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="settingChanged:" target="lhd-u6-xr5" id="fKi-di-3fk"/>
<outlet property="nextKeyView" destination="4782" id="5249"/>
<action selector="settingChanged:" target="lhd-u6-xr5" id="c3k-nj-VMp"/>
<outlet property="nextKeyView" destination="4765" id="uIt-qC-lLY"/>
</connections>
</button>
</subviews>
Loading
Loading
Loading
Loading
@@ -17,14 +17,14 @@
- (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag
{
self = [super initWithFrame:frameRect pullsDown:YES];
if (self) {
if (self) {
[self setBezelStyle:NSRegularSquareBezelStyle];
[self setBordered:NO];
[self setTitle:@""];
[self setPreferredEdge:NSMaxXEdge];
_PSMTabBarOverflowPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImage"]];
_PSMTabBarOverflowDownPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImagePressed"]];
_animatingAlternateImage = NO;
_PSMTabBarOverflowDownPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImagePressed"]];
_animatingAlternateImage = NO;
}
return self;
}
Loading
Loading
@@ -32,7 +32,7 @@
- (void)dealloc
{
[_PSMTabBarOverflowPopUpImage release];
[_PSMTabBarOverflowDownPopUpImage release];
[_PSMTabBarOverflowDownPopUpImage release];
[super dealloc];
}
 
Loading
Loading
@@ -42,89 +42,91 @@
[super drawRect:rect];
return;
}
NSImage *image = (_down) ? _PSMTabBarOverflowDownPopUpImage : _PSMTabBarOverflowPopUpImage;
NSSize imageSize = [image size];
NSRect bounds = [self bounds];
NSPoint drawPoint = NSMakePoint(NSMidX(bounds) - (imageSize.width * 0.5f), NSMidY(bounds) - (imageSize.height * 0.5f));
NSSize imageSize = [image size];
NSRect bounds = [self bounds];
NSPoint drawPoint = NSMakePoint(NSMidX(bounds) - (imageSize.width * 0.5f), NSMidY(bounds) - (imageSize.height * 0.5f));
 
[image drawAtPoint:drawPoint
fromRect:NSZeroRect
operation:NSCompositeSourceOver
fraction:_animatingAlternateImage ? 0.7f : 1.0f];
 
if (_animatingAlternateImage) {
NSImage *alternateImage = [self alternateImage];
NSSize altImageSize = [alternateImage size];
drawPoint = NSMakePoint(NSMidX(bounds) - (altImageSize.width * 0.5f),
if (_animatingAlternateImage) {
NSImage *alternateImage = [self alternateImage];
NSSize altImageSize = [alternateImage size];
drawPoint = NSMakePoint(NSMidX(bounds) - (altImageSize.width * 0.5f),
NSMidY(bounds) - (altImageSize.height * 0.5f));
 
[[self alternateImage] drawAtPoint:drawPoint
fromRect:NSZeroRect
operation:NSCompositeSourceOver
fraction:sin(_animationValue * M_PI)];
}
}
}
 
- (void)mouseDown:(NSEvent *)event
{
_down = YES;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationReceived:) name:NSMenuDidEndTrackingNotification object:[self menu]];
[self setNeedsDisplay:YES];
[super mouseDown:event];
_down = YES;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationReceived:) name:NSMenuDidEndTrackingNotification object:[self menu]];
[self setNeedsDisplay:YES];
[super mouseDown:event];
}
 
- (void)setHidden:(BOOL)value
{
if (!value && _animatingAlternateImage) {
_animationValue = ANIMATION_STEP;
_animationTimer = [NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self selector:@selector(animateStep:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_animationTimer forMode:NSEventTrackingRunLoopMode];
} else {
[_animationTimer invalidate], _animationTimer = nil;
}
[super setHidden:value];
if (!value && _animatingAlternateImage) {
_animationValue = ANIMATION_STEP;
_animationTimer = [NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self selector:@selector(animateStep:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_animationTimer forMode:NSEventTrackingRunLoopMode];
} else {
[_animationTimer invalidate];
_animationTimer = nil;
}
[super setHidden:value];
}
 
- (void)notificationReceived:(NSNotification *)notification
{
_down = NO;
[self setNeedsDisplay:YES];
[[NSNotificationCenter defaultCenter] removeObserver:self];
_down = NO;
[self setNeedsDisplay:YES];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
 
- (void)setAnimatingAlternateImage:(BOOL)flag
{
_animatingAlternateImage = flag;
[self setNeedsDisplay:YES];
if (![self isHidden] && !_animationTimer) {
if (flag) {
_animationValue = ANIMATION_STEP;
_animationTimer = [NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self selector:@selector(animateStep:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_animationTimer forMode:NSEventTrackingRunLoopMode];
} else {
[_animationTimer invalidate], _animationTimer = nil;
}
}
_animatingAlternateImage = flag;
[self setNeedsDisplay:YES];
if (![self isHidden] && !_animationTimer) {
if (flag) {
_animationValue = ANIMATION_STEP;
_animationTimer = [NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self selector:@selector(animateStep:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_animationTimer forMode:NSEventTrackingRunLoopMode];
} else {
[_animationTimer invalidate];
_animationTimer = nil;
}
}
}
 
- (BOOL)animatingAlternateImage
{
return _animatingAlternateImage;
return _animatingAlternateImage;
}
 
- (void)animateStep:(NSTimer *)timer
{
_animationValue += ANIMATION_STEP;
if (_animationValue >= 1) {
_animationValue = ANIMATION_STEP;
}
[self setNeedsDisplay:YES];
_animationValue += ANIMATION_STEP;
if (_animationValue >= 1) {
_animationValue = ANIMATION_STEP;
}
[self setNeedsDisplay:YES];
}
 
#pragma mark -
Loading
Loading
@@ -135,7 +137,7 @@
if ([aCoder allowsKeyedCoding]) {
[aCoder encodeObject:_PSMTabBarOverflowPopUpImage forKey:@"PSMTabBarOverflowPopUpImage"];
[aCoder encodeObject:_PSMTabBarOverflowDownPopUpImage forKey:@"PSMTabBarOverflowDownPopUpImage"];
[aCoder encodeBool:_animatingAlternateImage forKey:@"PSMTabBarOverflowAnimatingAlternateImage"];
[aCoder encodeBool:_animatingAlternateImage forKey:@"PSMTabBarOverflowAnimatingAlternateImage"];
}
}
 
Loading
Loading
@@ -144,7 +146,7 @@
if ([aDecoder allowsKeyedCoding]) {
_PSMTabBarOverflowPopUpImage = [[aDecoder decodeObjectForKey:@"PSMTabBarOverflowPopUpImage"] retain];
_PSMTabBarOverflowDownPopUpImage = [[aDecoder decodeObjectForKey:@"PSMTabBarOverflowDownPopUpImage"] retain];
[self setAnimatingAlternateImage:[aDecoder decodeBoolForKey:@"PSMTabBarOverflowAnimatingAlternateImage"]];
[self setAnimatingAlternateImage:[aDecoder decodeBoolForKey:@"PSMTabBarOverflowAnimatingAlternateImage"]];
}
}
return self;
Loading
Loading
Loading
Loading
@@ -492,7 +492,7 @@
 
[[[self sourceTabBar] tabView] removeTabViewItem:[[self draggedCell] representedObject]];
 
void (^fixOriginBlock)() = nil;
void (^fixOriginBlock)(void) = nil;
switch (self.sourceTabBar.tabLocation) {
case PSMTab_BottomTab: {
NSPoint bottomLeft = control.window.frame.origin;
Loading
Loading
Loading
Loading
@@ -106,7 +106,8 @@
 
- (void)dealloc
{
[_eventDate release], _eventDate = nil;
[_eventDate release];
_eventDate = nil;
[super dealloc];
}
Loading
Loading
Loading
Loading
@@ -42,16 +42,16 @@ static const NSUInteger SCEventsDefaultIgnoreEventsFromSubDirs = 1;
@interface SCEvents ()
 
static FSEventStreamRef _create_events_stream(SCEvents *watcher,
CFArrayRef paths,
CFTimeInterval latency,
FSEventStreamEventId sinceWhen);
CFArrayRef paths,
CFTimeInterval latency,
FSEventStreamEventId sinceWhen);
 
static void _events_callback(ConstFSEventStreamRef streamRef,
void *clientCallBackInfo,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[]);
void *clientCallBackInfo,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[]);
 
static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
 
Loading
Loading
@@ -80,10 +80,10 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
{
if ((self = [super init])) {
_isWatchingPaths = NO;
pthread_mutex_init(&_eventsLock, NULL);
pthread_mutex_init(&_eventsLock, NULL);
[self setResumeFromEventId:kFSEventStreamEventIdSinceNow];
[self setResumeFromEventId:kFSEventStreamEventIdSinceNow];
[self setNotificationLatency:SCEventsDefaultNotificationLatency];
[self setIgnoreEventsFromSubDirs:SCEventsDefaultIgnoreEventsFromSubDirs];
}
Loading
Loading
@@ -102,18 +102,18 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
*/
- (BOOL)flushEventStreamSync
{
pthread_mutex_lock(&_eventsLock);
pthread_mutex_lock(&_eventsLock);
if (!_isWatchingPaths) {
pthread_mutex_unlock(&_eventsLock);
return NO;
}
pthread_mutex_unlock(&_eventsLock);
return NO;
}
FSEventStreamFlushSync(_eventStream);
pthread_mutex_unlock(&_eventsLock);
pthread_mutex_unlock(&_eventsLock);
return YES;
}
 
Loading
Loading
@@ -126,17 +126,17 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
- (BOOL)flushEventStreamAsync
{
pthread_mutex_lock(&_eventsLock);
if (!_isWatchingPaths) {
pthread_mutex_unlock(&_eventsLock);
return NO;
}
pthread_mutex_unlock(&_eventsLock);
return NO;
}
FSEventStreamFlushAsync(_eventStream);
pthread_mutex_unlock(&_eventsLock);
pthread_mutex_unlock(&_eventsLock);
return YES;
}
 
Loading
Loading
@@ -165,19 +165,19 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
*/
- (BOOL)startWatchingPaths:(NSArray *)paths onRunLoop:(NSRunLoop *)runLoop
{
pthread_mutex_lock(&_eventsLock);
_runLoop = [runLoop getCFRunLoop];
pthread_mutex_lock(&_eventsLock);
_runLoop = [runLoop getCFRunLoop];
if ([paths count] == 0 || _isWatchingPaths) {
pthread_mutex_unlock(&_eventsLock);
return NO;
}
pthread_mutex_unlock(&_eventsLock);
return NO;
}
[self setWatchedPaths:paths];
_eventStream = _create_events_stream(self, ((CFArrayRef)_watchedPaths), _notificationLatency, _resumeFromEventId);
_eventStream = _create_events_stream(self, ((CFArrayRef)_watchedPaths), _notificationLatency, _resumeFromEventId);
// Schedule the event stream on the supplied run loop
FSEventStreamScheduleWithRunLoop(_eventStream, _runLoop, kCFRunLoopDefaultMode);
Loading
Loading
@@ -187,8 +187,8 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
_isWatchingPaths = YES;
pthread_mutex_unlock(&_eventsLock);
pthread_mutex_unlock(&_eventsLock);
return YES;
}
 
Loading
Loading
@@ -201,26 +201,28 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
*/
- (BOOL)stopWatchingPaths
{
pthread_mutex_lock(&_eventsLock);
pthread_mutex_lock(&_eventsLock);
if (!_isWatchingPaths) {
pthread_mutex_unlock(&_eventsLock);
return NO;
}
pthread_mutex_unlock(&_eventsLock);
return NO;
}
FSEventStreamStop(_eventStream);
if (_runLoop) FSEventStreamUnscheduleFromRunLoop(_eventStream, _runLoop, kCFRunLoopDefaultMode);
if (_runLoop) FSEventStreamUnscheduleFromRunLoop(_eventStream, _runLoop, kCFRunLoopDefaultMode);
FSEventStreamInvalidate(_eventStream);
if (_eventStream) FSEventStreamRelease(_eventStream), _eventStream = NULL;
if (_eventStream) {
FSEventStreamRelease(_eventStream);
_eventStream = NULL;
}
_isWatchingPaths = NO;
pthread_mutex_unlock(&_eventsLock);
pthread_mutex_unlock(&_eventsLock);
return YES;
}
 
Loading
Loading
@@ -231,13 +233,13 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
*/
- (NSString *)streamDescription
{
pthread_mutex_lock(&_eventsLock);
NSString *description = (_isWatchingPaths) ? (NSString *)FSEventStreamCopyDescription(_eventStream) : nil;
pthread_mutex_unlock(&_eventsLock);
return [description autorelease];
pthread_mutex_lock(&_eventsLock);
NSString *description = (_isWatchingPaths) ? (NSString *)FSEventStreamCopyDescription(_eventStream) : nil;
pthread_mutex_unlock(&_eventsLock);
return [description autorelease];
}
 
#pragma mark -
Loading
Loading
@@ -258,16 +260,19 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
 
- (void)dealloc
{
_delegate = nil;
// Stop the event stream if it's still running
if (_isWatchingPaths) [self stopWatchingPaths];
_delegate = nil;
// Stop the event stream if it's still running
if (_isWatchingPaths) [self stopWatchingPaths];
pthread_mutex_destroy(&_eventsLock);
pthread_mutex_destroy(&_eventsLock);
[_lastEvent release], _lastEvent = nil;
[_watchedPaths release], _watchedPaths = nil;
[_excludedPaths release], _excludedPaths = nil;
[_lastEvent release];
_lastEvent = nil;
[_watchedPaths release];
_watchedPaths = nil;
[_excludedPaths release];
_excludedPaths = nil;
[super dealloc];
}
Loading
Loading
@@ -284,21 +289,21 @@ static CFStringRef _strip_trailing_slash_from_path(CFStringRef path);
*/
static FSEventStreamRef _create_events_stream(SCEvents *watcher, CFArrayRef paths, CFTimeInterval latency, FSEventStreamEventId sinceWhen)
{
FSEventStreamContext callbackInfo;
callbackInfo.version = 0;
callbackInfo.info = (void *)watcher;
callbackInfo.retain = NULL;
callbackInfo.release = NULL;
callbackInfo.copyDescription = NULL;
FSEventStreamContext callbackInfo;
callbackInfo.version = 0;
callbackInfo.info = (void *)watcher;
callbackInfo.retain = NULL;
callbackInfo.release = NULL;
callbackInfo.copyDescription = NULL;
return FSEventStreamCreate(kCFAllocatorDefault,
&_events_callback,
&callbackInfo,
paths,
sinceWhen,
latency,
kFSEventStreamCreateFlagUseCFTypes | kFSEventStreamCreateFlagWatchRoot);
&_events_callback,
&callbackInfo,
paths,
sinceWhen,
latency,
kFSEventStreamCreateFlagUseCFTypes | kFSEventStreamCreateFlagWatchRoot);
}
 
/**
Loading
Loading
@@ -316,20 +321,20 @@ static FSEventStreamRef _create_events_stream(SCEvents *watcher, CFArrayRef path
* @param eventIds An array of IDs associated with the events
*/
static void _events_callback(ConstFSEventStreamRef streamRef,
void *clientCallBackInfo,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
void *clientCallBackInfo,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
NSUInteger i;
BOOL shouldIgnore = NO;
CFArrayRef paths = (CFArrayRef)eventPaths;
CFArrayRef paths = (CFArrayRef)eventPaths;
SCEvents *pathWatcher = (SCEvents *)clientCallBackInfo;
for (i = 0; i < numEvents; i++)
{
{
/* Please note that we are estimating the date for when the event occurred
* because the FSEvents API does not provide us with it. This date however
* should not be taken as the date the event actually occurred and more
Loading
Loading
@@ -345,8 +350,8 @@ static void _events_callback(ConstFSEventStreamRef streamRef,
* The drawback to this approach however, is the increased resources required
* calling this callback more frequently.
*/
NSArray *excludedPaths = [pathWatcher excludedPaths];
NSArray *excludedPaths = [pathWatcher excludedPaths];
CFStringRef eventPath = CFArrayGetValueAtIndex(paths, (CFIndex)i);
// Check to see if the event should be ignored if it's path is in the exclude list
Loading
Loading
@@ -358,25 +363,25 @@ static void _events_callback(ConstFSEventStreamRef streamRef,
// sub-directories then see if the exclude paths match as a prefix of the event path.
if ([pathWatcher ignoreEventsFromSubDirs]) {
for (NSString *path in [pathWatcher excludedPaths])
{
if (CFStringHasPrefix(eventPath, (CFStringRef)path)) {
shouldIgnore = YES;
{
if (CFStringHasPrefix(eventPath, (CFStringRef)path)) {
shouldIgnore = YES;
break;
}
}
}
}
}
if (!shouldIgnore) {
// If present remove the path's trailing slash
eventPath = _strip_trailing_slash_from_path(eventPath);
// If present remove the path's trailing slash
eventPath = _strip_trailing_slash_from_path(eventPath);
SCEvent *event = [SCEvent eventWithEventId:(NSUInteger)eventIds[i]
eventDate:[NSDate date]
eventPath:(NSString *)eventPath
eventFlags:(SCEventFlags)eventFlags[i]];
eventDate:[NSDate date]
eventPath:(NSString *)eventPath
eventFlags:(SCEventFlags)eventFlags[i]];
if ([[pathWatcher delegate] conformsToProtocol:@protocol(SCEventListenerProtocol)]) {
[[pathWatcher delegate] pathWatcher:pathWatcher eventOccurred:event];
}
Loading
Loading
@@ -397,11 +402,11 @@ static void _events_callback(ConstFSEventStreamRef streamRef,
*/
static CFStringRef _strip_trailing_slash_from_path(CFStringRef path)
{
NSString *string = (NSString *)path;
NSString *string = (NSString *)path;
 
NSUInteger length = [string length];
return (length > 1 && [string hasSuffix:@"/"]) ? (CFStringRef)[string substringToIndex:length - 1] : path;
NSUInteger length = [string length];
return (length > 1 && [string hasSuffix:@"/"]) ? (CFStringRef)[string substringToIndex:length - 1] : path;
}
 
@end
Loading
Loading
@@ -7201,7 +7201,7 @@
0464AB0C006CD2EC7F000001 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
TargetAttributes = {
1D6ED85219AEA20D005A7799 = {
DevelopmentTeam = H7V7XYVQ7D;
Loading
Loading
@@ -8959,12 +8959,18 @@
ASSETCATALOG_COMPILER_APPICON_NAME = iTerm2;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ENABLE_CODE_COVERAGE = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Loading
Loading
@@ -10312,12 +10318,18 @@
ASSETCATALOG_COMPILER_APPICON_NAME = iTerm2;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ENABLE_CODE_COVERAGE = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Loading
Loading
@@ -10354,12 +10366,18 @@
ASSETCATALOG_COMPILER_APPICON_NAME = iTerm2;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ENABLE_CODE_COVERAGE = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Loading
Loading
@@ -26,8 +26,9 @@
buildConfiguration = "Development"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
enableAddressSanitizer = "YES">
enableAddressSanitizer = "YES"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Loading
Loading
@@ -61,11 +62,12 @@
buildConfiguration = "Development"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
enableAddressSanitizer = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
Loading
Loading
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Loading
Loading
@@ -26,6 +26,7 @@
buildConfiguration = "Development"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Loading
Loading
@@ -55,6 +56,7 @@
buildConfiguration = "Development"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Loading
Loading
Loading
Loading
@@ -326,6 +326,6 @@ typedef NS_ENUM(NSUInteger, iTermUnicodeNormalization) {
// Removes the profile from the model, removes key mappings that reference this profile, and posts a
// kProfileWasDeletedNotification notification, then flushes the model to backing store.
+ (BOOL)removeProfile:(Profile *)profile fromModel:(ProfileModel *)model;
+ (void)performBlockWithCoalescedNotifications:(void (^)())block;
+ (void)performBlockWithCoalescedNotifications:(void (^)(void))block;
 
@end
Loading
Loading
@@ -747,7 +747,7 @@ static NSMutableArray<NSNotification *> *sDelayedNotifications;
}
}
 
+ (void)performBlockWithCoalescedNotifications:(void (^)())block {
+ (void)performBlockWithCoalescedNotifications:(void (^)(void))block {
if (!sDelayedNotifications) {
sDelayedNotifications = [[NSMutableArray alloc] init];
 
Loading
Loading
Loading
Loading
@@ -188,6 +188,6 @@ int OffsetOfWrappedLine(screen_char_t* p, int n, int length, int width, BOOL may
- (int)numberOfTrailingEmptyLines;
 
// Call this only before a line block has been created.
void EnableDoubleWidthCharacterLineCache();
void EnableDoubleWidthCharacterLineCache(void);
 
@end
Loading
Loading
@@ -45,7 +45,7 @@
// _delayedPerform.canceled = YES;
// _delayedPerform = nil;
// }
- (iTermDelayedPerform *)performBlock:(void (^)())block afterDelay:(NSTimeInterval)delay;
- (iTermDelayedPerform *)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
 
// Returns nil if this object is an instance of NSNull, otherwise returns self.
- (instancetype)nilIfNull;
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@
waitUntilDone:NO];
}
 
- (iTermDelayedPerform *)performBlock:(void (^)())block afterDelay:(NSTimeInterval)delay {
- (iTermDelayedPerform *)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay {
[self retain];
iTermDelayedPerform *delayedPerform = [[iTermDelayedPerform alloc] init];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)),
Loading
Loading
Loading
Loading
@@ -9124,6 +9124,7 @@ ITERM_WEAKLY_REFERENCEABLE
 
case ITMNotificationType_NotifyOnNewSession:
case ITMNotificationType_NotifyOnTerminateSession:
case ITMNotificationType_NotifyOnLayoutChange:
// We won't get called for this
assert(NO);
break;
Loading
Loading
Loading
Loading
@@ -3609,10 +3609,10 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
// This computes what to do and returns a block that actually does it. But if
// it's not allowed, then it returns null. This combines the "can move" with
// the "move" into a single function.
- (void (^)())blockToMoveView:(NSView *)view
inSplit:(NSView *)possibleSplit
horizontally:(BOOL)horizontally
by:(int)direction {
- (void (^)(void))blockToMoveView:(NSView *)view
inSplit:(NSView *)possibleSplit
horizontally:(BOOL)horizontally
by:(int)direction {
if (![possibleSplit isKindOfClass:[PTYSplitView class]] ||
possibleSplit.subviews.count == 1) {
return NULL;
Loading
Loading
@@ -3672,7 +3672,7 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
}
 
// It would be ok to move the divider. Return a block that updates views' frames.
void (^block)() = ^void() {
void (^block)(void) = ^void() {
[self splitView:split draggingWillBeginOfSplit:splitterIndex];
before.frame = beforeFrame;
after.frame = afterFrame;
Loading
Loading
@@ -3686,10 +3686,10 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
inSplit:(NSView *)possibleSplit
horizontally:(BOOL)horizontally
by:(int)direction {
void (^block)() = [self blockToMoveView:view
inSplit:possibleSplit
horizontally:horizontally
by:direction];
void (^block)(void) = [self blockToMoveView:view
inSplit:possibleSplit
horizontally:horizontally
by:direction];
if (block) {
block();
}
Loading
Loading
@@ -3699,10 +3699,10 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
inSplit:(NSView *)possibleSplit
horizontally:(BOOL)horizontally
by:(int)direction {
void (^block)() = [self blockToMoveView:view
inSplit:possibleSplit
horizontally:horizontally
by:direction];
void (^block)(void) = [self blockToMoveView:view
inSplit:possibleSplit
horizontally:horizontally
by:direction];
return block != nil;
}
 
Loading
Loading
Loading
Loading
@@ -127,7 +127,7 @@ static const int kDragThreshold = 3;
@property(nonatomic, retain) iTermFindCursorView *findCursorView;
@property(nonatomic, retain) NSWindow *findCursorWindow; // For find-cursor animation
@property(nonatomic, retain) iTermQuickLookController *quickLookController;
@property(strong, readwrite, nullable) NSTouchBar *touchBar;
@property(strong, readwrite, nullable) NSTouchBar *touchBar NS_AVAILABLE_MAC(10_12_2);
 
// Set when a context menu opens, nilled when it closes. If the data source changes between when we
// ask the context menu to open and when the main thread enters a tracking runloop, the text under
Loading
Loading
Loading
Loading
@@ -33,7 +33,7 @@ typedef NS_ENUM(NSInteger, PreferenceInfoType) {
 
// A function that indicates if the control should be enabled. If nil, then the control is always
// enabled.
@property(nonatomic, copy) BOOL (^shouldBeEnabled)();
@property(nonatomic, copy) BOOL (^shouldBeEnabled)(void);
 
// Called when the user changes a control's value by interacting with it (after the underlying user
// default or profile is update), or after its value is changed programmatically. It is also invoked
Loading
Loading
@@ -41,12 +41,12 @@ typedef NS_ENUM(NSInteger, PreferenceInfoType) {
// This is typically used when changing one view's value affects another view's appearance. For
// example, if turning on a checkbox causes a view to appear, the checkbox's observer would update
// the view's hidden flag.
@property(nonatomic, copy) void (^observer)();
@property(nonatomic, copy) void (^observer)(void);
 
// Called when the user changes a control's value by interacting with it.
// This is typically used when changing a control triggers an event beyond simply updating the
// display style. For example, it might open a file picker dialog or register for a hotkey.
@property(nonatomic, copy) void (^onChange)();
@property(nonatomic, copy) void (^onChange)(void);
 
// Called when a user interacts with a control, changing its value. This is called before anything
// else happens (such as invoking customSettingChangedHandler()) or updating user defaults.
Loading
Loading
@@ -54,14 +54,14 @@ typedef NS_ENUM(NSInteger, PreferenceInfoType) {
// irreparable harm (for example, renaming a profile while there is a search filter in place, such
// that the renamed profile would no longer match the filter), and is the last chance to mitigate
// the damage.
@property(nonatomic, copy) void (^willChange)();
@property(nonatomic, copy) void (^willChange)(void);
 
// Called before a control's value is changed programatically (e.g., when a different profile is
// selected). If it returns YES, the normal path is not taken, and the block is responsible for
// updating the control to reflect the user preference.
// This is normally used on popups and matrixes to update the control to reflect the
// user preference.
@property(nonatomic, copy) BOOL (^onUpdate)();
@property(nonatomic, copy) BOOL (^onUpdate)(void);
 
// Replaces the default settingChanged: handler, which updates user defaults and calls onChange.
// It is called when the user interacts with a control, changing its value.
Loading
Loading
Loading
Loading
@@ -49,7 +49,7 @@
[super dealloc];
}
 
- (void)setObserver:(void (^)())observer {
- (void)setObserver:(void (^)(void))observer {
[_observer autorelease];
_observer = [observer copy];
}
Loading
Loading
Loading
Loading
@@ -132,7 +132,7 @@ typedef struct {
toMenu:(NSMenu*)menu
params:(JournalParams*)params;
 
- (void)performBlockWithCoalescedNotifications:(void (^)())block;
- (void)performBlockWithCoalescedNotifications:(void (^)(void))block;
 
@end
 
Loading
Loading
Loading
Loading
@@ -721,7 +721,7 @@ int gMigrated;
[self postChangeNotification];
}
 
- (void)performBlockWithCoalescedNotifications:(void (^)())block {
- (void)performBlockWithCoalescedNotifications:(void (^)(void))block {
if (!_delayedNotifications) {
_delayedNotifications = [[NSMutableArray alloc] init];
 
Loading
Loading
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