From 01ac6dbdada7c8f23c76e33af84217325010c476 Mon Sep 17 00:00:00 2001 From: cochrane Date: Thu, 26 Nov 2020 22:29:49 +0100 Subject: [PATCH] Cleanup and make it build on Big Sur Sorry that this took so long. --- GLLara.xcodeproj/project.pbxproj | 14 +++++++++----- GLLara/GLLModelBone.h | 4 ++-- GLLara/GLLModelBone.m | 4 ++-- GLLara/GLLPoseExporter.h | 4 ++-- GLLara/GLLPoseExporter.m | 4 ++-- GLLara/GLLProgram.m | 2 +- GLLara/GLLRenderWindowController.m | 2 +- GLLara/GLLShader.m | 2 +- GLLara/NSCharacterSet+SetOperations.m | 21 +++++++++------------ 9 files changed, 29 insertions(+), 28 deletions(-) diff --git a/GLLara.xcodeproj/project.pbxproj b/GLLara.xcodeproj/project.pbxproj index 479d40d6..fd1482ab 100644 --- a/GLLara.xcodeproj/project.pbxproj +++ b/GLLara.xcodeproj/project.pbxproj @@ -1669,7 +1669,7 @@ attributes = { CLASSPREFIX = GLL; LastTestingUpgradeCheck = 0620; - LastUpgradeCheck = 1100; + LastUpgradeCheck = 1210; ORGANIZATIONNAME = "Torsten Kammer"; TargetAttributes = { 525ACD4615F0F1A700534E7D = { @@ -2447,6 +2447,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -2504,6 +2505,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -2537,9 +2539,10 @@ 525ACD7D15F0F1A700534E7D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 15; DEVELOPMENT_TEAM = MXAKMKWG34; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "GLLara/GLLara-Info.plist"; @@ -2555,9 +2558,10 @@ 525ACD7E15F0F1A700534E7D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 15; DEVELOPMENT_TEAM = MXAKMKWG34; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "GLLara/GLLara-Info.plist"; diff --git a/GLLara/GLLModelBone.h b/GLLara/GLLModelBone.h index cd0c6d2a..0cb8d16d 100644 --- a/GLLara/GLLModelBone.h +++ b/GLLara/GLLModelBone.h @@ -21,10 +21,10 @@ @interface GLLModelBone : NSObject // Bone without parent, children at position 0, 0, 0. No need to call setupParent afterwards. -- (id)initWithModel:(GLLModel *)model; +- (instancetype)initWithModel:(GLLModel *)model; // Stream must be either a GLLASCIIScanner or a TRInDataStream. -- (id)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error; +- (instancetype)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error; // Export - (NSString *)writeASCII; diff --git a/GLLara/GLLModelBone.m b/GLLara/GLLModelBone.m index 40023c04..2580f70f 100644 --- a/GLLara/GLLModelBone.m +++ b/GLLara/GLLModelBone.m @@ -16,7 +16,7 @@ @implementation GLLModelBone -- (id)initWithModel:(GLLModel *)model; +- (instancetype)initWithModel:(GLLModel *)model; { if (!(self = [super init])) return nil; @@ -38,7 +38,7 @@ - (id)initWithModel:(GLLModel *)model; } -- (id)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error; +- (instancetype)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error; { if (!(self = [super init])) return nil; diff --git a/GLLara/GLLPoseExporter.h b/GLLara/GLLPoseExporter.h index ec20c454..2ea8fde9 100644 --- a/GLLara/GLLPoseExporter.h +++ b/GLLara/GLLPoseExporter.h @@ -17,8 +17,8 @@ */ @interface GLLPoseExporter : NSObject -- (id)initWithBones:(id)bones __attribute__((nonnull(1))); -- (id)initWithItem:(GLLItem *)item __attribute__((nonnull(1))); +- (instancetype)initWithBones:(id)bones __attribute__((nonnull(1))); +- (instancetype)initWithItem:(GLLItem *)item __attribute__((nonnull(1))); @property (nonatomic) BOOL skipUnused; diff --git a/GLLara/GLLPoseExporter.m b/GLLara/GLLPoseExporter.m index b42e477d..053c30bf 100644 --- a/GLLara/GLLPoseExporter.m +++ b/GLLara/GLLPoseExporter.m @@ -20,13 +20,13 @@ @interface GLLPoseExporter () @implementation GLLPoseExporter -- (id)initWithItem:(GLLItem *)item +- (instancetype)initWithItem:(GLLItem *)item { NSParameterAssert(item); return [self initWithBones:item.combinedBones]; } -- (id)initWithBones:(id)bones +- (instancetype)initWithBones:(id)bones { NSParameterAssert(bones); if (!(self = [super init])) return nil; diff --git a/GLLara/GLLProgram.m b/GLLara/GLLProgram.m index ccf6ed1e..65ccb44c 100644 --- a/GLLara/GLLProgram.m +++ b/GLLara/GLLProgram.m @@ -87,7 +87,7 @@ - (id)initWithName:(NSString *)name fragmentShader:(GLLShader *)fragment geometr if (error) *error = [NSError errorWithDomain:@"OpenGL" code:1 userInfo:@{ NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"The shader \"%@\" could not be linked", @"GLLShader error message description"), _name], - NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", log)], + NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", "No shader there wtf?"), log], NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Please inform a developer of this problem.", @"No shader there wtf?") }]; NSLog(@"link error in shader %@: %s", _name, log); diff --git a/GLLara/GLLRenderWindowController.m b/GLLara/GLLRenderWindowController.m index 1c39b3f5..f2eb44f3 100644 --- a/GLLara/GLLRenderWindowController.m +++ b/GLLara/GLLRenderWindowController.m @@ -110,7 +110,7 @@ - (NSManagedObjectContext *)managedObjectContext - (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName { - return [NSString stringWithFormat:NSLocalizedString(@"%@ - Render view %lu", @"render window title format"), displayName, self.camera.index + 1]; + return [NSString stringWithFormat:NSLocalizedString(@"%@ - Render view %lld", @"render window title format"), displayName, self.camera.index + 1]; } #pragma mark - Actions diff --git a/GLLara/GLLShader.m b/GLLara/GLLShader.m index eebf38d7..2aed0b07 100644 --- a/GLLara/GLLShader.m +++ b/GLLara/GLLShader.m @@ -61,7 +61,7 @@ - (id)initWithSource:(NSString *)sourceString name:(NSString *)name additionalDe if (error) *error = [NSError errorWithDomain:@"OpenGL" code:1 userInfo:@{ NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"The shader \"%@\" could not be compiled properly", @"GLLShader error message description"), name], - NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", log)], + NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", "No shade there wtf?"), log], NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Please inform a developer of this problem.", @"No shader there wtf?") }]; NSLog(@"compile error in shader %@: %s", _name, log); diff --git a/GLLara/NSCharacterSet+SetOperations.m b/GLLara/NSCharacterSet+SetOperations.m index 06876e39..6361dc44 100644 --- a/GLLara/NSCharacterSet+SetOperations.m +++ b/GLLara/NSCharacterSet+SetOperations.m @@ -8,9 +8,6 @@ #import "NSCharacterSet+SetOperations.h" -#include -#include - @implementation NSCharacterSet (SetOperations) - (BOOL)hasIntersectionWithSet:(NSCharacterSet *)other; @@ -20,18 +17,18 @@ - (BOOL)hasIntersectionWithSet:(NSCharacterSet *)other; NSAssert(myData.length == 8192 && theirData.length == 8192, @"bitmap representation of character set should always be 8192 bytes"); - const __m128 *mine = (const __m128 *) myData.bytes; - const __m128 *theirs = (const __m128 *) theirData.bytes; - __m128 result = _mm_setzero_ps(); - for (NSUInteger i = 0; i < 512; i += 4) + const uint64_t *mine = (const uint64_t *) myData.bytes; + const uint64_t *theirs = (const uint64_t *) theirData.bytes; + uint64_t result = 0; + for (NSUInteger i = 0; i < (8192/(4*sizeof(mine[0]))) && result == 0; i += 4) { - result = _mm_or_ps(result, _mm_and_ps(mine[i + 0], theirs[i + 0])); - result = _mm_or_ps(result, _mm_and_ps(mine[i + 1], theirs[i + 1])); - result = _mm_or_ps(result, _mm_and_ps(mine[i + 2], theirs[i + 2])); - result = _mm_or_ps(result, _mm_and_ps(mine[i + 3], theirs[i + 3])); + result |= mine[i+0] & theirs[i+0]; + result |= mine[i+1] & theirs[i+1]; + result |= mine[i+2] & theirs[i+2]; + result |= mine[i+3] & theirs[i+3]; } - return _mm_movemask_ps(_mm_cmpneq_ps(result, _mm_setzero_ps())); + return result != 0; } @end