Skip to content

Commit bc8d340

Browse files
Fixes #597 Xcode 11 warnings (#598)
1 parent f8231e7 commit bc8d340

25 files changed

+45
-51
lines changed

GitUp/Application/Document.m

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)windowController {
387387
}
388388

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

394392
- (BOOL)presentError:(NSError*)error {
395393
if (error == nil) {
@@ -1507,9 +1505,7 @@ - (void)commitListViewControllerDidChangeSelection:(GICommitListViewController*)
15071505

15081506
#pragma mark - GICommitViewControllerDelegate
15091507

1510-
- (void)commitViewController:(GICommitViewController*)controller didCreateCommit:(GCCommit*)commit {
1511-
;
1512-
}
1508+
- (void)commitViewController:(GICommitViewController*)controller didCreateCommit:(GCCommit*)commit {}
15131509

15141510
#pragma mark - GICommitRewriterViewControllerDelegate
15151511

@@ -1629,7 +1625,7 @@ - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
16291625
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]) {
16301626
return NO;
16311627
}
1632-
[(NSMenuItem*)item setState:([(NSMenuItem*)item tag] == _WindowModeIDFromString(_windowMode) ? NSOnState : NSOffState)];
1628+
[(NSMenuItem*)item setState:([(NSMenuItem*)item tag] == (NSInteger)(_WindowModeIDFromString(_windowMode)) ? NSOnState : NSOffState)];
16331629
return YES;
16341630
}
16351631

GitUpKit/Components/GICommitListViewController.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
@end
2424

2525
@interface GICommitListViewController : GIViewController
26-
@property(nonatomic, assign) id<GICommitListViewControllerDelegate> delegate;
26+
@property(nonatomic, weak) id<GICommitListViewControllerDelegate> delegate;
2727
@property(nonatomic, copy) NSArray* results; // Can contain GCHistoryCommit, GCHistoryLocalBranch, GCHistoryRemoteBranch or GCHistoryTag
2828
@property(nonatomic, readonly) NSArray* commits; // Converted results to GCHistoryCommits
29-
@property(nonatomic, assign) id selectedResult;
30-
@property(nonatomic, assign) GCHistoryCommit* selectedCommit;
29+
@property(nonatomic, weak) id selectedResult;
30+
@property(nonatomic, weak) GCHistoryCommit* selectedCommit;
3131
@property(nonatomic, copy) NSString* emptyLabel;
3232
@end

GitUpKit/Components/GIDiffContentsViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern NSString* const GIDiffContentsViewControllerUserDefaultKey_DiffViewMode;
3333
@end
3434

3535
@interface GIDiffContentsViewController : GIViewController
36-
@property(nonatomic, assign) id<GIDiffContentsViewControllerDelegate> delegate;
36+
@property(nonatomic, weak) id<GIDiffContentsViewControllerDelegate> delegate;
3737
@property(nonatomic) BOOL showsUntrackedAsAdded; // Default is NO
3838
@property(nonatomic, copy) NSString* emptyLabel;
3939
@property(nonatomic, strong) NSView* headerView;

GitUpKit/Components/GIDiffContentsViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ @interface GIEmptyDiffCellView : NSTableCellView
4949
@end
5050

5151
@interface GITextDiffCellView : NSTableCellView
52-
@property(nonatomic, assign) GIDiffView* diffView;
52+
@property(nonatomic, weak) GIDiffView* diffView;
5353
@end
5454

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

7373
@interface GIContentsTableView : GITableView
74-
@property(nonatomic, assign) GIDiffContentsViewController* controller;
74+
@property(nonatomic, weak) GIDiffContentsViewController* controller;
7575
@end
7676

7777
@interface GIDiffContentsViewController () <NSTableViewDataSource, GIDiffViewDelegate>

GitUpKit/Components/GIDiffFilesViewController.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@end
3232

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

43-
@property(nonatomic, assign) GCDiffDelta* selectedDelta;
44-
@property(nonatomic, assign) NSArray* selectedDeltas;
43+
@property(nonatomic, weak) GCDiffDelta* selectedDelta;
44+
@property(nonatomic, weak) NSArray* selectedDeltas;
4545
@end

GitUpKit/Components/GIDiffFilesViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ @interface GIFileCellView : NSTableCellView
2929
@end
3030

3131
@interface GIFilesTableView : GITableView
32-
@property(nonatomic, assign) GIDiffFilesViewController* controller;
32+
@property(nonatomic, weak) GIDiffFilesViewController* controller;
3333
@end
3434

3535
@interface GIDiffFilesViewController () <NSFilePromiseProviderDelegate>

GitUpKit/Components/GISnapshotListViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
@end
2525

2626
@interface GISnapshotListViewController : GIViewController
27-
@property(nonatomic, assign) id<GISnapshotListViewControllerDelegate> delegate;
27+
@property(nonatomic, weak) id<GISnapshotListViewControllerDelegate> delegate;
2828
@property(nonatomic, readonly) GCSnapshot* selectedSnapshot;
2929
@end

GitUpKit/Components/GIUnifiedReflogViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
@end
2525

2626
@interface GIUnifiedReflogViewController : GIViewController
27-
@property(nonatomic, assign) id<GIUnifiedReflogViewControllerDelegate> delegate;
27+
@property(nonatomic, weak) id<GIUnifiedReflogViewControllerDelegate> delegate;
2828
@property(nonatomic, readonly) GCReflogEntry* selectedReflogEntry;
2929
@end

GitUpKit/Core/GCCommitDatabase.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static int _CaseInsensitiveUTF8Compare(void* context, int length1, const void* b
161161
} else {
162162
result = 0;
163163
}
164-
return result;
164+
return (int)result;
165165
}
166166

167167
- (BOOL)_initializeDatabase:(NSString*)path error:(NSError**)error {

GitUpKit/Core/GCHistory.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ typedef NS_ENUM(NSUInteger, GCHistorySorting) {
3838
@end
3939

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

4545
@interface GCHistoryLocalBranch : GCLocalBranch
46-
@property(nonatomic, readonly) GCHistoryCommit* tipCommit; // Cached at time of last history update and DOES NOT automatically update (use -lookupTipCommitForBranch:error: instead)
47-
@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
46+
@property(nonatomic, weak, readonly) GCHistoryCommit* tipCommit; // Cached at time of last history update and DOES NOT automatically update (use -lookupTipCommitForBranch:error: instead)
47+
@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
4848
@end
4949

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

5454
@interface GCHistory : NSObject
@@ -58,8 +58,8 @@ typedef NS_ENUM(NSUInteger, GCHistorySorting) {
5858
@property(nonatomic, readonly) NSArray* allCommits;
5959
@property(nonatomic, readonly) NSArray* rootCommits;
6060
@property(nonatomic, readonly) NSArray* leafCommits;
61-
@property(nonatomic, readonly) GCHistoryCommit* HEADCommit; // nil if HEAD is unborn
62-
@property(nonatomic, readonly) GCHistoryLocalBranch* HEADBranch; // nil if HEAD is detached
61+
@property(nonatomic, weak, readonly) GCHistoryCommit* HEADCommit; // nil if HEAD is unborn
62+
@property(nonatomic, weak, readonly) GCHistoryLocalBranch* HEADBranch; // nil if HEAD is detached
6363
@property(nonatomic, readonly, getter=isHEADDetached) BOOL HEADDetached; // Convenience method
6464
@property(nonatomic, readonly) NSArray* tags; // Always sorted alphabetically
6565
@property(nonatomic, readonly) NSArray* localBranches; // Always sorted alphabetically

0 commit comments

Comments
 (0)