From 9696bbbcbb30b88a5d5d3c09813543be265439ba Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 28 May 2022 11:07:19 +0300 Subject: [PATCH 1/6] kit: interface line mrc has been removed. --- GitUpKit/Interface/GILine.m | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/GitUpKit/Interface/GILine.m b/GitUpKit/Interface/GILine.m index 8e50f66d..102d64a0 100644 --- a/GitUpKit/Interface/GILine.m +++ b/GitUpKit/Interface/GILine.m @@ -13,10 +13,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#if __has_feature(objc_arc) -#error This file requires MRC -#endif - #import "GIPrivate.h" @implementation GILine { @@ -34,16 +30,11 @@ - (instancetype)initWithBranch:(GIBranch*)branch { } - (void)dealloc { -#if __GI_HAS_APPKIT__ - [_color release]; -#endif CFRelease(_nodes); - - [super dealloc]; } - (NSArray*)nodes { - return (NSArray*)_nodes; + return (__bridge NSArray*)_nodes; } - (void)addNode:(GINode*)node { From 6147a6b4cb17062bd557d7125971e833e7ec9c08 Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 28 May 2022 11:07:36 +0300 Subject: [PATCH 2/6] kit: interface layer mrc has been removed. --- GitUpKit/Interface/GILayer.m | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/GitUpKit/Interface/GILayer.m b/GitUpKit/Interface/GILayer.m index 47f9e48e..196b3466 100644 --- a/GitUpKit/Interface/GILayer.m +++ b/GitUpKit/Interface/GILayer.m @@ -13,10 +13,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#if __has_feature(objc_arc) -#error This file requires MRC -#endif - #import "GIPrivate.h" @implementation GILayer { @@ -37,16 +33,14 @@ - (instancetype)initWithIndex:(NSUInteger)index { - (void)dealloc { CFRelease(_lines); CFRelease(_nodes); - - [super dealloc]; } - (NSArray*)nodes { - return (NSArray*)_nodes; + return (__bridge NSArray*)_nodes; } - (NSArray*)lines { - return (NSArray*)_lines; + return (__bridge NSArray*)_lines; } - (void)addNode:(GINode*)node { From c14ab45999f1b666a456eca21633f8220fc0864d Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 28 May 2022 11:07:48 +0300 Subject: [PATCH 3/6] kit: interface branch mrc has been removed. --- GitUpKit/Interface/GIBranch.m | 4 ---- 1 file changed, 4 deletions(-) diff --git a/GitUpKit/Interface/GIBranch.m b/GitUpKit/Interface/GIBranch.m index dc80361c..9a3ab74c 100644 --- a/GitUpKit/Interface/GIBranch.m +++ b/GitUpKit/Interface/GIBranch.m @@ -13,10 +13,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#if __has_feature(objc_arc) -#error This file requires MRC -#endif - #import "GIPrivate.h" @implementation GIBranch From 29baa6de8428a75624d25543c6ff18dda45e47ff Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 28 May 2022 11:11:36 +0300 Subject: [PATCH 4/6] kit: interface remote mrc has been removed. --- GitUpKit/Core/GCMacros.h | 10 +++++----- GitUpKit/Core/GCRemote.m | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GitUpKit/Core/GCMacros.h b/GitUpKit/Core/GCMacros.h index ab3d7be1..7d118d59 100644 --- a/GitUpKit/Core/GCMacros.h +++ b/GitUpKit/Core/GCMacros.h @@ -177,13 +177,13 @@ static inline BOOL __GCPointerListContains(GCPointerList* list, void* pointer) { #define GC_POINTER_LIST_CONTAINS(name, pointer) __GCPointerListContains(&name, pointer) -#define GC_POINTER_LIST_FOR_LOOP_VARIABLE(name, variable) \ - variable = GC_POINTER_LIST_GET(name, 0); \ - for (size_t __##variable = 0; (__##variable < name.count) && (variable = GC_POINTER_LIST_GET(name, __##variable), 1); ++__##variable) +#define GC_POINTER_LIST_FOR_LOOP_NO_BRIDGE(name, type, variable) \ + type variable = (type)GC_POINTER_LIST_GET(name, 0); \ + for (size_t __##variable = 0; (__##variable < name.count) && (variable = (type)GC_POINTER_LIST_GET(name, __##variable), 1); ++__##variable) #define GC_POINTER_LIST_FOR_LOOP(name, type, variable) \ - type variable; \ - GC_POINTER_LIST_FOR_LOOP_VARIABLE(name, variable) + type variable = (__bridge type)GC_POINTER_LIST_GET(name, 0); \ + for (size_t __##variable = 0; (__##variable < name.count) && (variable = (__bridge type)GC_POINTER_LIST_GET(name, __##variable), 1); ++__##variable) #define GC_POINTER_LIST_REVERSE_FOR_LOOP(name, type, variable) \ type variable = name.count ? GC_POINTER_LIST_GET(name, name.count - 1) : NULL; \ diff --git a/GitUpKit/Core/GCRemote.m b/GitUpKit/Core/GCRemote.m index fe4d1b57..42f46a0d 100644 --- a/GitUpKit/Core/GCRemote.m +++ b/GitUpKit/Core/GCRemote.m @@ -523,7 +523,7 @@ - (BOOL)_pushAllReferencesToRemote:(git_remote*)remote branches:(BOOL)branches t if (success) { success = [self _pushToRemote:remote refspecs:(const char**)GC_POINTER_LIST_ROOT(buffers) count:GC_POINTER_LIST_COUNT(buffers) error:error]; } - GC_POINTER_LIST_FOR_LOOP(buffers, char*, buffer) { + GC_POINTER_LIST_FOR_LOOP_NO_BRIDGE(buffers, char*, buffer) { free(buffer); } GC_POINTER_LIST_FREE(buffers); From 51b7b7d1766c4f9f68d3f28cb86d43d67ef4a42b Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 28 May 2022 11:12:17 +0300 Subject: [PATCH 5/6] kit: core commit database mrc has been removed. --- GitUpKit/Core/GCCommitDatabase.m | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/GitUpKit/Core/GCCommitDatabase.m b/GitUpKit/Core/GCCommitDatabase.m index c3561575..2e224b6c 100644 --- a/GitUpKit/Core/GCCommitDatabase.m +++ b/GitUpKit/Core/GCCommitDatabase.m @@ -13,10 +13,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#if __has_feature(objc_arc) -#error This file requires MRC -#endif - #import #import "GCPrivate.h" @@ -368,7 +364,6 @@ - (instancetype)initWithRepository:(GCRepository*)repository databasePath:(NSStr _options = options; if (![self _initializeDatabase:path error:error]) { - [self release]; return nil; } @@ -377,32 +372,27 @@ - (instancetype)initWithRepository:(GCRepository*)repository databasePath:(NSStr NSInteger currentVersion = [self _readVersion]; if (currentVersion == version) { if (![self _checkReady:error]) { - [self release]; return nil; } } else { if (_options & kGCCommitDatabaseOptions_QueryOnly) { GC_SET_GENERIC_ERROR(@"Database is query-only"); - [self release]; return nil; } sqlite3_close(_database); _database = NULL; XLOG_WARNING(@"Commit database for \"%@\" has an incompatible version (%li) and must be regenerated", _repository.repositoryPath, (long)currentVersion); if (![[NSFileManager defaultManager] removeItemAtPath:path error:error] || ![self _initializeDatabase:path error:error] || ![self _initializeSchema:version error:error]) { - [self release]; return nil; } } } else { if (![self _initializeSchema:version error:error]) { - [self release]; return nil; } } if (![self _initializeStatements:error]) { - [self release]; return nil; } } @@ -417,10 +407,6 @@ - (void)dealloc { free(_statements); } sqlite3_close(_database); - - [_databasePath release]; - - [super dealloc]; } #if DEBUG @@ -903,10 +889,6 @@ - (BOOL)_addCommitsForTip:(const git_oid*)tipOID handler:(BOOL (^)())handler err success = YES; cleanup: - [deletedWords release]; - [addedWords release]; - [deletedLines release]; - [addedLines release]; git_commit_free(mainParent); GC_LIST_FOR_LOOP_POINTER(newRow, itemPtr) { git_commit_free(itemPtr->commit); @@ -1190,7 +1172,6 @@ - (NSArray*)findCommitsUsingHistory:(GCHistory*)history matching:(NSString*)matc CHECK_LIBGIT2_FUNCTION_CALL(goto cleanup, status, == GIT_OK); GCCommit* commit = [[GCCommit alloc] initWithRepository:_repository commit:rawCommit]; [results addObject:commit]; - [commit release]; } } CALL_SQLITE_FUNCTION_GOTO(cleanup, sqlite3_reset, statements[kStatement_SearchCommits]); From 9dacad6e3e8d3f5733c83b92164c30ab56325a59 Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 28 May 2022 11:42:14 +0300 Subject: [PATCH 6/6] kit: macos target has been updated. --- GitUpKit/GitUpKit.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GitUpKit/GitUpKit.xcodeproj/project.pbxproj b/GitUpKit/GitUpKit.xcodeproj/project.pbxproj index f87ae5de..9af25816 100644 --- a/GitUpKit/GitUpKit.xcodeproj/project.pbxproj +++ b/GitUpKit/GitUpKit.xcodeproj/project.pbxproj @@ -181,7 +181,7 @@ E267E1D01B84D80500BAB377 /* GCRepository+Status.h in Headers */ = {isa = PBXBuildFile; fileRef = E20EB08D19FC76160031A075 /* GCRepository+Status.h */; settings = {ATTRIBUTES = (Public, ); }; }; E267E1D11B84D83100BAB377 /* GCBranch.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C338DC19F85C8600063D95 /* GCBranch.m */; }; E267E1D21B84D83100BAB377 /* GCCommit.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C338DE19F85C8600063D95 /* GCCommit.m */; }; - E267E1D31B84D83100BAB377 /* GCCommitDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = E2FEED451AEAA6AD00CBED80 /* GCCommitDatabase.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + E267E1D31B84D83100BAB377 /* GCCommitDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = E2FEED451AEAA6AD00CBED80 /* GCCommitDatabase.m */; }; E267E1D41B84D83100BAB377 /* GCDiff.m in Sources */ = {isa = PBXBuildFile; fileRef = E2B14B5D1A8A764400003E64 /* GCDiff.m */; }; E267E1D51B84D83100BAB377 /* GCFoundation.m in Sources */ = {isa = PBXBuildFile; fileRef = E2790D411ACB1B1100965A98 /* GCFoundation.m */; }; E267E1D61B84D83100BAB377 /* GCFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = E21739F21A4FE39E00EC6777 /* GCFunctions.m */; }; @@ -224,13 +224,13 @@ E267E2121B84DB4200BAB377 /* GINode.h in Headers */ = {isa = PBXBuildFile; fileRef = E2D4DEA61A4D57AA00B6AF66 /* GINode.h */; settings = {ATTRIBUTES = (Public, ); }; }; E267E2131B84DB4200BAB377 /* GISplitDiffView.h in Headers */ = {isa = PBXBuildFile; fileRef = E2891AB11AE15BB600E58C77 /* GISplitDiffView.h */; settings = {ATTRIBUTES = (Public, ); }; }; E267E2141B84DB4200BAB377 /* GIUnifiedDiffView.h in Headers */ = {isa = PBXBuildFile; fileRef = E2C9FF861AA510170051B2AE /* GIUnifiedDiffView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E267E2151B84DB6E00BAB377 /* GIBranch.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEAE1A4D592000B6AF66 /* GIBranch.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + E267E2151B84DB6E00BAB377 /* GIBranch.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEAE1A4D592000B6AF66 /* GIBranch.m */; }; E267E2161B84DB6E00BAB377 /* GIDiffView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2891AB51AE1684A00E58C77 /* GIDiffView.m */; }; E267E2171B84DB6E00BAB377 /* GIFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = E2B1BF321A85923800A999DF /* GIFunctions.m */; }; E267E2181B84DB6E00BAB377 /* GIGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEA11A4D562300B6AF66 /* GIGraph.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; E267E2191B84DB6E00BAB377 /* GIGraphView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEA31A4D562300B6AF66 /* GIGraphView.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - E267E21A1B84DB6E00BAB377 /* GILayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEB11A4D599200B6AF66 /* GILayer.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - E267E21B1B84DB6E00BAB377 /* GILine.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEAB1A4D587800B6AF66 /* GILine.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + E267E21A1B84DB6E00BAB377 /* GILayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEB11A4D599200B6AF66 /* GILayer.m */; }; + E267E21B1B84DB6E00BAB377 /* GILine.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEAB1A4D587800B6AF66 /* GILine.m */; }; E267E21C1B84DB6E00BAB377 /* GINode.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D4DEA71A4D57AA00B6AF66 /* GINode.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; E267E21D1B84DB6E00BAB377 /* GIPrivate.m in Sources */ = {isa = PBXBuildFile; fileRef = E21A88F21A9471B300255AC3 /* GIPrivate.m */; }; E267E21E1B84DB6E00BAB377 /* GISplitDiffView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2891AB21AE15BB600E58C77 /* GISplitDiffView.m */; };