Skip to content

Commit

Permalink
Fixes #597 Xcode 11 warnings (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasderraugh authored Oct 13, 2019
1 parent f8231e7 commit bc8d340
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 51 deletions.
10 changes: 3 additions & 7 deletions GitUp/Application/Document.m
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)windowController {
}

// Override -updateChangeCount: which is trigged by NSUndoManager to do nothing and not mark document as updated
- (void)updateChangeCount:(NSDocumentChangeType)change {
;
}
- (void)updateChangeCount:(NSDocumentChangeType)change {}

- (BOOL)presentError:(NSError*)error {
if (error == nil) {
Expand Down Expand Up @@ -1507,9 +1505,7 @@ - (void)commitListViewControllerDidChangeSelection:(GICommitListViewController*)

#pragma mark - GICommitViewControllerDelegate

- (void)commitViewController:(GICommitViewController*)controller didCreateCommit:(GCCommit*)commit {
;
}
- (void)commitViewController:(GICommitViewController*)controller didCreateCommit:(GCCommit*)commit {}

#pragma mark - GICommitRewriterViewControllerDelegate

Expand Down Expand Up @@ -1629,7 +1625,7 @@ - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
if ([_windowMode isEqualToString:kWindowModeString_Map_QuickView] || [_windowMode isEqualToString:kWindowModeString_Map_Diff] || [_windowMode isEqualToString:kWindowModeString_Map_Rewrite] || [_windowMode isEqualToString:kWindowModeString_Map_Config] || [_windowMode isEqualToString:kWindowModeString_Map_Resolve]) {
return NO;
}
[(NSMenuItem*)item setState:([(NSMenuItem*)item tag] == _WindowModeIDFromString(_windowMode) ? NSOnState : NSOffState)];
[(NSMenuItem*)item setState:([(NSMenuItem*)item tag] == (NSInteger)(_WindowModeIDFromString(_windowMode)) ? NSOnState : NSOffState)];
return YES;
}

Expand Down
6 changes: 3 additions & 3 deletions GitUpKit/Components/GICommitListViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
@end

@interface GICommitListViewController : GIViewController
@property(nonatomic, assign) id<GICommitListViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GICommitListViewControllerDelegate> delegate;
@property(nonatomic, copy) NSArray* results; // Can contain GCHistoryCommit, GCHistoryLocalBranch, GCHistoryRemoteBranch or GCHistoryTag
@property(nonatomic, readonly) NSArray* commits; // Converted results to GCHistoryCommits
@property(nonatomic, assign) id selectedResult;
@property(nonatomic, assign) GCHistoryCommit* selectedCommit;
@property(nonatomic, weak) id selectedResult;
@property(nonatomic, weak) GCHistoryCommit* selectedCommit;
@property(nonatomic, copy) NSString* emptyLabel;
@end
2 changes: 1 addition & 1 deletion GitUpKit/Components/GIDiffContentsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern NSString* const GIDiffContentsViewControllerUserDefaultKey_DiffViewMode;
@end

@interface GIDiffContentsViewController : GIViewController
@property(nonatomic, assign) id<GIDiffContentsViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GIDiffContentsViewControllerDelegate> delegate;
@property(nonatomic) BOOL showsUntrackedAsAdded; // Default is NO
@property(nonatomic, copy) NSString* emptyLabel;
@property(nonatomic, strong) NSView* headerView;
Expand Down
4 changes: 2 additions & 2 deletions GitUpKit/Components/GIDiffContentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ @interface GIEmptyDiffCellView : NSTableCellView
@end

@interface GITextDiffCellView : NSTableCellView
@property(nonatomic, assign) GIDiffView* diffView;
@property(nonatomic, weak) GIDiffView* diffView;
@end

@interface GIBinaryDiffCellView : NSTableCellView
Expand All @@ -71,7 +71,7 @@ - (NSTextField*)newSHA1TextField __attribute__((objc_method_family(none))); //
@end

@interface GIContentsTableView : GITableView
@property(nonatomic, assign) GIDiffContentsViewController* controller;
@property(nonatomic, weak) GIDiffContentsViewController* controller;
@end

@interface GIDiffContentsViewController () <NSTableViewDataSource, GIDiffViewDelegate>
Expand Down
6 changes: 3 additions & 3 deletions GitUpKit/Components/GIDiffFilesViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@end

@interface GIDiffFilesViewController : GIViewController
@property(nonatomic, assign) id<GIDiffFilesViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GIDiffFilesViewControllerDelegate> delegate;
@property(nonatomic) BOOL showsUntrackedAsAdded; // Default is NO
@property(nonatomic, copy) NSString* emptyLabel;
@property(nonatomic) BOOL allowsMultipleSelection; // Default is NO
Expand All @@ -40,6 +40,6 @@
@property(nonatomic, readonly) NSDictionary* conflicts;
- (void)setDeltas:(NSArray*)deltas usingConflicts:(NSDictionary*)conflicts;

@property(nonatomic, assign) GCDiffDelta* selectedDelta;
@property(nonatomic, assign) NSArray* selectedDeltas;
@property(nonatomic, weak) GCDiffDelta* selectedDelta;
@property(nonatomic, weak) NSArray* selectedDeltas;
@end
2 changes: 1 addition & 1 deletion GitUpKit/Components/GIDiffFilesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ @interface GIFileCellView : NSTableCellView
@end

@interface GIFilesTableView : GITableView
@property(nonatomic, assign) GIDiffFilesViewController* controller;
@property(nonatomic, weak) GIDiffFilesViewController* controller;
@end

@interface GIDiffFilesViewController () <NSFilePromiseProviderDelegate>
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Components/GISnapshotListViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
@end

@interface GISnapshotListViewController : GIViewController
@property(nonatomic, assign) id<GISnapshotListViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GISnapshotListViewControllerDelegate> delegate;
@property(nonatomic, readonly) GCSnapshot* selectedSnapshot;
@end
2 changes: 1 addition & 1 deletion GitUpKit/Components/GIUnifiedReflogViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
@end

@interface GIUnifiedReflogViewController : GIViewController
@property(nonatomic, assign) id<GIUnifiedReflogViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GIUnifiedReflogViewControllerDelegate> delegate;
@property(nonatomic, readonly) GCReflogEntry* selectedReflogEntry;
@end
2 changes: 1 addition & 1 deletion GitUpKit/Core/GCCommitDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int _CaseInsensitiveUTF8Compare(void* context, int length1, const void* b
} else {
result = 0;
}
return result;
return (int)result;
}

- (BOOL)_initializeDatabase:(NSString*)path error:(NSError**)error {
Expand Down
12 changes: 6 additions & 6 deletions GitUpKit/Core/GCHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ typedef NS_ENUM(NSUInteger, GCHistorySorting) {
@end

@interface GCHistoryTag : GCTag
@property(nonatomic, readonly) GCHistoryCommit* commit; // Cached at time of last history update and DOES NOT automatically update (use -lookupCommitForTag:annotation:error: instead)
@property(nonatomic, weak, readonly) GCHistoryCommit* commit; // Cached at time of last history update and DOES NOT automatically update (use -lookupCommitForTag:annotation:error: instead)
@property(nonatomic, readonly) GCTagAnnotation* annotation; // Cached at time of last history update and DOES NOT automatically update (use -lookupCommitForTag:annotation:error: instead)
@end

@interface GCHistoryLocalBranch : GCLocalBranch
@property(nonatomic, readonly) GCHistoryCommit* tipCommit; // Cached at time of last history update and DOES NOT automatically update (use -lookupTipCommitForBranch:error: instead)
@property(nonatomic, readonly) GCBranch* upstream; // Cached at time of last history update and DOES NOT automatically update (use -lookupUpstreamForLocalBranch:error: instead) - Will be a GCHistoryLocalBranch or GCHistoryRemoteBranch
@property(nonatomic, weak, readonly) GCHistoryCommit* tipCommit; // Cached at time of last history update and DOES NOT automatically update (use -lookupTipCommitForBranch:error: instead)
@property(nonatomic, weak, readonly) GCBranch* upstream; // Cached at time of last history update and DOES NOT automatically update (use -lookupUpstreamForLocalBranch:error: instead) - Will be a GCHistoryLocalBranch or GCHistoryRemoteBranch
@end

@interface GCHistoryRemoteBranch : GCRemoteBranch
@property(nonatomic, readonly) GCHistoryCommit* tipCommit; // Cached at time of last history update and DOES NOT automatically update (use -lookupTipCommitForBranch:error: instead)
@property(nonatomic, weak, readonly) GCHistoryCommit* tipCommit; // Cached at time of last history update and DOES NOT automatically update (use -lookupTipCommitForBranch:error: instead)
@end

@interface GCHistory : NSObject
Expand All @@ -58,8 +58,8 @@ typedef NS_ENUM(NSUInteger, GCHistorySorting) {
@property(nonatomic, readonly) NSArray* allCommits;
@property(nonatomic, readonly) NSArray* rootCommits;
@property(nonatomic, readonly) NSArray* leafCommits;
@property(nonatomic, readonly) GCHistoryCommit* HEADCommit; // nil if HEAD is unborn
@property(nonatomic, readonly) GCHistoryLocalBranch* HEADBranch; // nil if HEAD is detached
@property(nonatomic, weak, readonly) GCHistoryCommit* HEADCommit; // nil if HEAD is unborn
@property(nonatomic, weak, readonly) GCHistoryLocalBranch* HEADBranch; // nil if HEAD is detached
@property(nonatomic, readonly, getter=isHEADDetached) BOOL HEADDetached; // Convenience method
@property(nonatomic, readonly) NSArray* tags; // Always sorted alphabetically
@property(nonatomic, readonly) NSArray* localBranches; // Always sorted alphabetically
Expand Down
12 changes: 6 additions & 6 deletions GitUpKit/Core/GCHistory.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ - (BOOL)hasReferences {
@end

@interface GCHistoryTag ()
@property(nonatomic, assign) GCHistoryCommit* commit;
@property(nonatomic, weak) GCHistoryCommit* commit;
@property(nonatomic, strong) GCTagAnnotation* annotation;
@end

Expand All @@ -186,15 +186,15 @@ - (void)dealloc {
@end

@interface GCHistoryLocalBranch ()
@property(nonatomic, assign) GCHistoryCommit* tipCommit;
@property(nonatomic, assign) GCBranch* upstream;
@property(nonatomic, weak) GCHistoryCommit* tipCommit;
@property(nonatomic, weak) GCBranch* upstream;
@end

@implementation GCHistoryLocalBranch
@end

@interface GCHistoryRemoteBranch ()
@property(nonatomic, assign) GCHistoryCommit* tipCommit;
@property(nonatomic, weak) GCHistoryCommit* tipCommit;
@end

@implementation GCHistoryRemoteBranch
Expand All @@ -211,8 +211,8 @@ @interface GCHistory ()
@property(nonatomic, readonly) NSMutableArray* leaves;
@property(nonatomic, readonly) CFMutableDictionaryRef lookup;
@property(nonatomic, strong) NSSet* tips;
@property(nonatomic, assign) GCHistoryCommit* HEADCommit;
@property(nonatomic, assign) GCHistoryLocalBranch* HEADBranch;
@property(nonatomic, weak) GCHistoryCommit* HEADCommit;
@property(nonatomic, weak) GCHistoryLocalBranch* HEADBranch;
@property(nonatomic, strong) NSData* md5;
@end

Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Core/GCLiveRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extern NSString* const GCLiveRepositoryAmendOperationReason;
#if DEBUG
+ (NSUInteger)allocatedCount; // For debugging only
#endif
@property(nonatomic, assign) id<GCLiveRepositoryDelegate> delegate;
@property(nonatomic, weak) id<GCLiveRepositoryDelegate> delegate;

- (void)notifyRepositoryChanged; // Calling this method is required when manipulating the repository from this process as live-updates don't apply
- (void)notifyWorkingDirectoryChanged; // Calling this method is required when manipulating the working directory from this process as live-updates don't apply
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Core/GCRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef NS_ENUM(NSUInteger, GCFileMode) {
@end

@interface GCRepository : NSObject
@property(nonatomic, assign) id<GCRepositoryDelegate> delegate;
@property(nonatomic, weak) id<GCRepositoryDelegate> delegate;
@property(nonatomic, readonly) NSString* repositoryPath;
@property(nonatomic, readonly) NSString* workingDirectoryPath; // nil for a bare repository
@property(nonatomic, readonly, getter=isReadOnly) BOOL readOnly;
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Interface/GIBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@class GINode, GILine;

@interface GIBranch : NSObject
@property(nonatomic, readonly) GILine* mainLine; // NOT RETAINED
@property(nonatomic, weak, readonly) GILine* mainLine; // NOT RETAINED

// Computed properties
@property(nonatomic, readonly) GINode* tipNode;
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Interface/GIDiffView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- (void)didFinishInitializing; // For subclasses only
- (void)didUpdatePatch; // For subclasses only

@property(nonatomic, assign) id<GIDiffViewDelegate> delegate;
@property(nonatomic, weak) id<GIDiffViewDelegate> delegate;
@property(nonatomic, strong) NSColor* backgroundColor;
@property(nonatomic, strong) GCDiffPatch* patch;
@property(nonatomic, readonly, getter=isEmpty) BOOL empty;
Expand Down
6 changes: 3 additions & 3 deletions GitUpKit/Interface/GIGraphView.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
@end

@interface GIGraphView : NSView <NSUserInterfaceValidations>
@property(nonatomic, assign) id<GIGraphViewDelegate> delegate;
@property(nonatomic, weak) id<GIGraphViewDelegate> delegate;
@property(nonatomic, strong) GIGraph* graph;
@property(nonatomic) BOOL showsTagLabels;
@property(nonatomic) BOOL showsBranchLabels;

@property(nonatomic, assign) GINode* selectedNode; // Setting this property directly does not call the delegate
@property(nonatomic, assign) GCHistoryCommit* selectedCommit; // Convenience method that wraps @selectedNode
@property(nonatomic, weak) GINode* selectedNode; // Setting this property directly does not call the delegate
@property(nonatomic, weak) GCHistoryCommit* selectedCommit; // Convenience method that wraps @selectedNode

@property(nonatomic, readonly) NSSize minSize;

Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Interface/GIPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern void GIComputeHighlightRanges(const char* deletedBytes, NSUInteger delete
@end

@interface GIBranch ()
@property(nonatomic, assign) GILine* mainLine;
@property(nonatomic, weak) GILine* mainLine;
@end

@interface GILayer ()
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Utilities/GIViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@class GIWindowController, GIViewController, GCLiveRepository, GCSnapshot;

@interface GIView : NSView
@property(nonatomic, readonly) GIViewController* viewController;
@property(nonatomic, weak, readonly) GIViewController* viewController;
@end

@interface GIViewController : NSViewController <NSTextFieldDelegate, NSTextViewDelegate, NSTableViewDelegate>
Expand Down
6 changes: 2 additions & 4 deletions GitUpKit/Utilities/GIViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@
#import "XLFacilityMacros.h"

@interface GIView ()
@property(nonatomic, assign) GIViewController* viewController;
@property(nonatomic, weak) GIViewController* viewController;
@end

#define OVERRIDES_METHOD(m) (method_getImplementation(class_getInstanceMethod(self.class, @selector(m))) != method_getImplementation(class_getInstanceMethod([GIViewController class], @selector(m))))

@implementation GIView {
__unsafe_unretained GIViewController* _viewController; // This is required since redeclaring a read-only property as "assign" still makes it strong!
}
@implementation GIView

- (void)resizeSubviewsWithOldSize:(NSSize)oldSize {
[super resizeSubviewsWithOldSize:oldSize];
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Utilities/GIWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef NS_ENUM(NSUInteger, GIOverlayStyle) {
@end

@interface GIWindowController : NSWindowController
@property(nonatomic, assign) id<GIWindowControllerDelegate> delegate;
@property(nonatomic, weak) id<GIWindowControllerDelegate> delegate;
@property(strong) GIWindow* window; // Redeclare superclass property

@property(nonatomic, readonly, getter=isOverlayVisible) BOOL overlayVisible;
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Views/GICommitRewriterViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@end

@interface GICommitRewriterViewController : GICommitViewController
@property(nonatomic, assign) id<GICommitRewriterViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GICommitRewriterViewControllerDelegate> delegate;
- (BOOL)startRewritingCommit:(GCHistoryCommit*)commit error:(NSError**)error;
- (BOOL)finishRewritingCommitWithMessage:(NSString*)message error:(NSError**)error;
- (BOOL)cancelRewritingCommit:(NSError**)error;
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Views/GICommitSplitterViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@end

@interface GICommitSplitterViewController : GICommitViewController
@property(nonatomic, assign) id<GICommitSplitterViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GICommitSplitterViewControllerDelegate> delegate;
- (BOOL)startSplittingCommit:(GCHistoryCommit*)commit error:(NSError**)error;
- (BOOL)finishSplittingCommitWithOldMessage:(NSString*)oldMessage newMessage:(NSString*)newMessage error:(NSError**)error;
- (void)cancelSplittingCommit;
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Views/GICommitViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// Abstract base class
@interface GICommitViewController : GIViewController
@property(nonatomic, assign) id<GICommitViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GICommitViewControllerDelegate> delegate;
@property(nonatomic, weak) IBOutlet NSTextField* infoTextField;
@property(nonatomic, strong) IBOutlet GICommitMessageView* messageTextView; // Does not support weak references
@property(nonatomic, strong) IBOutlet GICommitMessageView* otherMessageTextView; // Does not support weak references
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Views/GIConflictResolverViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@end

@interface GIConflictResolverViewController : GIViewController
@property(nonatomic, assign) id<GIConflictResolverViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GIConflictResolverViewControllerDelegate> delegate;
@property(nonatomic, strong) GCCommit* ourCommit;
@property(nonatomic, strong) GCCommit* theirCommit;
@end
2 changes: 1 addition & 1 deletion GitUpKit/Views/GIMapViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@end

@interface GIMapViewController : GIViewController <NSUserInterfaceValidations>
@property(nonatomic, assign) id<GIMapViewControllerDelegate> delegate;
@property(nonatomic, weak) id<GIMapViewControllerDelegate> delegate;
@property(nonatomic, readonly) GIGraph* graph;
@property(nonatomic, readonly) GCHistoryCommit* selectedCommit; // Nil if no commit is selected
@property(nonatomic, strong) GCHistory* previewHistory;
Expand Down

0 comments on commit bc8d340

Please sign in to comment.