Skip to content

Commit

Permalink
Set minimum OS to 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kainjow committed Jan 1, 2018
1 parent 8ba1c6c commit b5be95a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 73 deletions.
10 changes: 5 additions & 5 deletions HexFiend_2.xcodeproj/project.pbxproj
Expand Up @@ -2156,7 +2156,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx;
VALID_ARCHS = "armv6 armv7 i386 x86_64";
WARNING_CFLAGS = (
Expand Down Expand Up @@ -2296,7 +2296,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VALID_ARCHS = "armv6 armv7 i386 x86_64";
Expand Down Expand Up @@ -2435,7 +2435,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx;
VALID_ARCHS = "armv6 armv7 i386 x86_64";
WARNING_CFLAGS = (
Expand Down Expand Up @@ -2595,7 +2595,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VALID_ARCHS = "armv6 armv7 i386 x86_64";
Expand Down Expand Up @@ -2737,7 +2737,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VALID_ARCHS = "armv6 armv7 i386 x86_64";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@

A fast and clever open source hex editor for macOS.

Download the latest version for macOS 10.7 or greater from the [releases](https://github.com/ridiculousfish/HexFiend/releases) page.
Download the latest version for macOS 10.8 or greater from the [releases](https://github.com/ridiculousfish/HexFiend/releases) page.

## Features

Expand Down
21 changes: 4 additions & 17 deletions app/sources/DataInspectorRepresenter.m
Expand Up @@ -850,26 +850,13 @@ - (void)saveDefaultInspectors {
- (NSView *)createView {
BOOL loaded = NO;
NSMutableArray *topLevelObjects = [NSMutableArray array];
if ([[NSBundle mainBundle] respondsToSelector:@selector(loadNibNamed:owner:topLevelObjects:)]) {
/* for Mac OS X 10.8 or higher */
// unlike -loadNibNamed:owner: which is deprecated in 10.8, this method does
// not retain top level objects automatically, so objects must be set retain
loaded = [[NSBundle mainBundle] loadNibNamed:@"DataInspectorView" owner:self topLevelObjects:&topLevelObjects];
if (! loaded || ! outletView) {
[NSException raise:NSInternalInconsistencyException format:@"Unable to load nib named DataInspectorView"];
}
} else {
/* for Mac OS X 10.7 or lower */
loaded = [NSBundle loadNibNamed:@"DataInspectorView" owner:self];
if (! loaded || ! outletView) {
[NSException raise:NSInternalInconsistencyException format:@"Unable to load nib named DataInspectorView"];
}
loaded = [[NSBundle mainBundle] loadNibNamed:@"DataInspectorView" owner:self topLevelObjects:&topLevelObjects];
if (! loaded || ! outletView) {
[NSException raise:NSInternalInconsistencyException format:@"Unable to load nib named DataInspectorView"];
}
NSView *resultView = outletView; //want to inherit its retain here
outletView = nil;
if ([table respondsToSelector:@selector(setSelectionHighlightStyle:)]) {
[table setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone];
}
[table setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone];
[table setBackgroundColor:[NSColor colorWithCalibratedWhite:(CGFloat).91 alpha:1]];
[table setRefusesFirstResponder:YES];
[table setTarget:self];
Expand Down
15 changes: 2 additions & 13 deletions app/sources/HFDocumentOperationView.m
Expand Up @@ -29,18 +29,8 @@ + (HFDocumentOperationView *)viewWithNibNamed:(NSString *)name owner:(id)owner {
if (! path) [NSException raise:NSInvalidArgumentException format:@"Unable to find nib named %@", name];
sNibName = [name copy];
NSMutableArray *topLevelObjects = [NSMutableArray array];
if ([[NSBundle mainBundle] respondsToSelector:@selector(loadNibNamed:owner:topLevelObjects:)]) {
/* for Mac OS X 10.8 or higher */
// unlike -loadNibFile:externalNameTable:withZone: which is deprecated in 10.8, this method does
// not retain top level objects automatically, so objects must be set retain
if (! [[NSBundle mainBundle] loadNibNamed:name owner:owner topLevelObjects:&topLevelObjects]) {
[NSException raise:NSInvalidArgumentException format:@"Unable to load nib at path %@", path];
}
} else {
/* for Mac OS X 10.7 or lower */
if (! [NSBundle loadNibFile:path externalNameTable:@{@"NSTopLevelObjects": topLevelObjects, @"NSOwner": owner} withZone:NULL]) {
[NSException raise:NSInvalidArgumentException format:@"Unable to load nib at path %@", path];
}
if (! [[NSBundle mainBundle] loadNibNamed:name owner:owner topLevelObjects:&topLevelObjects]) {
[NSException raise:NSInvalidArgumentException format:@"Unable to load nib at path %@", path];
}
sNibName = nil;
HFDocumentOperationView *resultObject = nil;
Expand Down Expand Up @@ -159,7 +149,6 @@ - (void)spinUntilFinished {
completionHandler = nil;
tracker = nil;
[self willChangeValueForKey:@"operationIsRunning"];
dispatch_release(waitGroup);
waitGroup = NULL;
[self didChangeValueForKey:@"operationIsRunning"];
[cancelButton setHidden: ! [self operationIsRunning]];
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Expand Up @@ -205,7 +205,7 @@
<td class="right"><span class="pixelfont section-title">System<br>Requirements</span></td>
<td class="left">
<ul>
<li>Mac OS X 10.7 or later.</li>
<li>macOS 10.8 or later.</li>
<li>Intel Macs only.</li>
<li>Support for Tiger and PowerPC is available with version 2.0 (below).</li>
</ul>
Expand Down
3 changes: 1 addition & 2 deletions framework/sources/HFByteArrayEditScript.m
Expand Up @@ -1323,11 +1323,10 @@ - (BOOL)computeDifferenceViaMiddleSnakes {

/* Wait until we're done */
dispatch_group_wait(dispatchGroup, DISPATCH_TIME_FOREVER);
dispatch_release(dispatchGroup);
dispatchGroup = NULL;

/* Make sure our insnQueue is done by submitting a no-op to it, then clear it */
dispatch_sync(insnQueue, ^{});
dispatch_release(insnQueue);
insnQueue = NULL;

if (! *cancelRequested) {
Expand Down
8 changes: 1 addition & 7 deletions framework/sources/HFByteArray_FileWriting.m
Expand Up @@ -178,13 +178,7 @@ static void computeDependencies(HFByteArray *self, HFObjectGraph *graph, NSArray
HFObjectGraph *acyclicGraph = [[HFObjectGraph alloc] init];
NSUInteger i, max = [stronglyConnectedComponents count];
/* Construct a dictionary mapping each operation to its contained chain */
NSMapTable *operationToContainingChain;
// weakToWeakObjectsMapTable requires 10.8+
if ([NSMapTable respondsToSelector:@selector(weakToWeakObjectsMapTable)]) {
operationToContainingChain = [NSMapTable weakToWeakObjectsMapTable];
} else {
operationToContainingChain = [NSMapTable mapTableWithWeakToWeakObjects];
}
NSMapTable *operationToContainingChain = [NSMapTable weakToWeakObjectsMapTable];

for (i=0; i < max; i++) {
HFByteSliceFileOperation *chain = chains[i];
Expand Down
9 changes: 1 addition & 8 deletions framework/sources/HFByteRangeAttributeArray.m
Expand Up @@ -682,14 +682,7 @@ - (void)transferAttributesFromAttributeArray:(HFAnnotatedTreeByteRangeAttributeA
- (void)byteRange:(HFRange)dyingRange wasReplacedByBytesOfLength:(unsigned long long)replacementLength {
@autoreleasepool {

NSMapTable *nodesToReplace;
// strongToStrongObjectsMapTable requires 10.8+
if ([NSMapTable respondsToSelector:@selector(strongToStrongObjectsMapTable)]) {
nodesToReplace = [NSMapTable strongToStrongObjectsMapTable];
} else {
nodesToReplace = [NSMapTable mapTableWithStrongToStrongObjects];
}

NSMapTable *nodesToReplace = [NSMapTable strongToStrongObjectsMapTable];
const id null = [NSNull null];

HFRange extendedRange = HFRangeMake(dyingRange.location, ULLONG_MAX - dyingRange.location);
Expand Down
2 changes: 1 addition & 1 deletion framework/sources/HFObjectGraph.m
Expand Up @@ -174,7 +174,7 @@ - (BOOL)naivePathFrom:(id)obj1 to:(id)obj2 {
- (NSArray *)naiveStronglyConnectedComponentsForObjects:(NSArray *)objects {
NSMutableArray *result = [NSMutableArray array];
/* A super-lame naive algorithm for finding all the strongly connected components of a graph. */
NSMapTable<id, NSMutableArray*> *components = [NSMapTable mapTableWithWeakToStrongObjects];
NSMapTable<id, NSMutableArray*> *components = [NSMapTable weakToStrongObjectsMapTable];
for(id obj1 in objects) {
NSMutableArray *loop = [components objectForKey:obj1];
if (! loop) {
Expand Down
21 changes: 3 additions & 18 deletions framework/sources/HFPasteboardOwner.m
Expand Up @@ -22,12 +22,7 @@ + (void)initialize {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(prepareCommonPasteboardsForChangeInFileNotification:) name:HFPrepareForChangeInFileNotification object:nil];

HFASSERT_MAIN_THREAD(); // byteArrayMap is not thread safe
// strongToWeakObjectsMapTable requires 10.8+
if ([NSMapTable respondsToSelector:@selector(strongToWeakObjectsMapTable)]) {
byteArrayMap = [NSMapTable strongToWeakObjectsMapTable];
} else {
byteArrayMap = [NSMapTable mapTableWithStrongToWeakObjects];
}
byteArrayMap = [NSMapTable strongToWeakObjectsMapTable];
}
}

Expand Down Expand Up @@ -206,18 +201,8 @@ - (BOOL)moveDataWithProgressReportingToPasteboard:(NSPasteboard *)pboard forType
progressTracker = [[HFProgressTracker alloc] init];

NSMutableArray *topLevelObjects = [NSMutableArray array];
if ([[NSBundle mainBundle] respondsToSelector:@selector(loadNibNamed:owner:topLevelObjects:)]) {
/* for Mac OS X 10.8 or higher */
// unlike -loadNibNamed:owner: which is deprecated in 10.8, this method does
// not retain top level objects automatically, so objects must be set retain
if (![[NSBundle bundleForClass:[self class]] loadNibNamed:@"HFModalProgress" owner:self topLevelObjects:&topLevelObjects] || !progressTrackingWindow) {
NSLog(@"Unable to load nib named HFModalProgress!");
}
} else {
/* for Mac OS X 10.7 or lower */
if(![NSBundle loadNibNamed:@"HFModalProgress" owner:self] || !progressTrackingWindow) {
NSLog(@"Unable to load nib named HFModalProgress!");
}
if (![[NSBundle bundleForClass:[self class]] loadNibNamed:@"HFModalProgress" owner:self topLevelObjects:&topLevelObjects] || !progressTrackingWindow) {
NSLog(@"Unable to load nib named HFModalProgress!");
}
backgroundCopyOperationFinished = NO;
didStartModalSessionForBackgroundCopyOperation = NO;
Expand Down

0 comments on commit b5be95a

Please sign in to comment.