From baa03e73a5af66b725f58fa5efd04bf54b7b2eed Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Mon, 27 Oct 2014 11:12:38 +0100 Subject: [PATCH] Update project for OS X 10.10. --- Classes/NJInputController.m | 3 ++- Classes/NJKeyInputField.m | 2 +- Classes/NJMapping.m | 4 +++- Classes/NJOutputKeyPress.m | 2 +- Classes/NJOutputViewController.m | 14 +++++++------- Enjoyable.xcodeproj/project.pbxproj | 26 ++++++++++++++++++-------- Info.plist | 2 +- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Classes/NJInputController.m b/Classes/NJInputController.m index ed0d72d..2200cb0 100644 --- a/Classes/NJInputController.m +++ b/Classes/NJInputController.m @@ -380,7 +380,8 @@ static CVReturn _updateDL(CVDisplayLinkRef displayLink, - (void)removeMappingAtIndex:(NSInteger)idx { NSInteger currentIdx = [self indexOfMapping:_currentMapping]; [_mappings removeObjectAtIndex:idx]; - [self activateMapping:self.mappings[MIN(currentIdx, _mappings.count - 1)]]; + NSInteger activeIdx = MIN(currentIdx, (NSInteger)_mappings.count - 1); + [self activateMapping:self.mappings[activeIdx]]; [self mappingsChanged]; } diff --git a/Classes/NJKeyInputField.m b/Classes/NJKeyInputField.m index 36435f0..3cdbd7c 100644 --- a/Classes/NJKeyInputField.m +++ b/Classes/NJKeyInputField.m @@ -267,7 +267,7 @@ static BOOL isValidKeyCode(long code) { warning.hidden = YES; char *error = NULL; const char *s = field.stringValue.UTF8String; - long code = strtol(s, &error, 16); + short code = (short)strtol(s, &error, 16); if (!*error && isValidKeyCode(code) && field.stringValue.length) { self.keyCode = code; diff --git a/Classes/NJMapping.m b/Classes/NJMapping.m index bcd2a8d..1b05c42 100644 --- a/Classes/NJMapping.m +++ b/Classes/NJMapping.m @@ -102,7 +102,9 @@ NSInputStream *stream = [NSInputStream inputStreamWithURL:url]; [stream open]; NSDictionary *serialization = stream && !*error - ? [NSJSONSerialization JSONObjectWithStream:stream options:0 error:error] + ? [NSJSONSerialization JSONObjectWithStream:stream + options:(NSJSONReadingOptions)0 + error:error] : nil; [stream close]; diff --git a/Classes/NJOutputKeyPress.m b/Classes/NJOutputKeyPress.m index a69d8f3..d685d35 100644 --- a/Classes/NJOutputKeyPress.m +++ b/Classes/NJOutputKeyPress.m @@ -23,7 +23,7 @@ + (NJOutput *)outputWithSerialization:(NSDictionary *)serialization { NJOutputKeyPress *output = [[NJOutputKeyPress alloc] init]; - output.keyCode = [serialization[@"key"] intValue]; + output.keyCode = [serialization[@"key"] shortValue]; return output; } diff --git a/Classes/NJOutputViewController.m b/Classes/NJOutputViewController.m index 9bd723b..8d0f817 100644 --- a/Classes/NJOutputViewController.m +++ b/Classes/NJOutputViewController.m @@ -54,7 +54,7 @@ if (row != 3) { self.mouseDirSelect.selectedSegment = -1; - self.mouseSpeedSlider.floatValue = self.mouseSpeedSlider.minValue; + self.mouseSpeedSlider.doubleValue = self.mouseSpeedSlider.minValue; [self.mouseDirSelect resignIfFirstResponder]; } else { if (self.mouseDirSelect.selectedSegment == -1) @@ -71,7 +71,7 @@ if (row != 5) { self.scrollDirSelect.selectedSegment = -1; - self.scrollSpeedSlider.floatValue = self.scrollSpeedSlider.minValue; + self.scrollSpeedSlider.doubleValue = self.scrollSpeedSlider.minValue; self.smoothCheck.state = NSOffState; [self.scrollDirSelect resignIfFirstResponder]; [self.scrollSpeedSlider resignIfFirstResponder]; @@ -142,12 +142,12 @@ [self.radioButtons selectCellAtRow:5 column:0]; [sender.window makeFirstResponder:sender]; if (sender.state == NSOnState) { - self.scrollSpeedSlider.floatValue = + self.scrollSpeedSlider.doubleValue = self.scrollSpeedSlider.minValue + (self.scrollSpeedSlider.maxValue - self.scrollSpeedSlider.minValue) / 2; self.scrollSpeedSlider.enabled = YES; } else { - self.scrollSpeedSlider.floatValue = self.scrollSpeedSlider.minValue; + self.scrollSpeedSlider.doubleValue = self.scrollSpeedSlider.minValue; self.scrollSpeedSlider.enabled = NO; } [self commit]; @@ -174,18 +174,18 @@ } case 3: { NJOutputMouseMove *mm = [[NJOutputMouseMove alloc] init]; - mm.axis = self.mouseDirSelect.selectedSegment; + mm.axis = (int)self.mouseDirSelect.selectedSegment; mm.speed = self.mouseSpeedSlider.floatValue; return mm; } case 4: { NJOutputMouseButton *mb = [[NJOutputMouseButton alloc] init]; - mb.button = [self.mouseBtnSelect.cell tagForSegment:self.mouseBtnSelect.selectedSegment]; + mb.button = (int)[self.mouseBtnSelect.cell tagForSegment:self.mouseBtnSelect.selectedSegment]; return mb; } case 5: { NJOutputMouseScroll *ms = [[NJOutputMouseScroll alloc] init]; - ms.direction = [self.scrollDirSelect.cell tagForSegment:self.scrollDirSelect.selectedSegment]; + ms.direction = (int)[self.scrollDirSelect.cell tagForSegment:self.scrollDirSelect.selectedSegment]; ms.speed = self.scrollSpeedSlider.floatValue; ms.smooth = self.smoothCheck.state == NSOnState; return ms; diff --git a/Enjoyable.xcodeproj/project.pbxproj b/Enjoyable.xcodeproj/project.pbxproj index c244de0..e12f9dc 100644 --- a/Enjoyable.xcodeproj/project.pbxproj +++ b/Enjoyable.xcodeproj/project.pbxproj @@ -23,7 +23,7 @@ EE8455DD16F0E46B00F32A01 /* NSRunningApplication+LoginItem.m in Sources */ = {isa = PBXBuildFile; fileRef = EE8455DC16F0E46B00F32A01 /* NSRunningApplication+LoginItem.m */; }; EED4CE6E16ED692400C65AA8 /* NJMappingMenuController.m in Sources */ = {isa = PBXBuildFile; fileRef = EED4CE6D16ED692400C65AA8 /* NJMappingMenuController.m */; }; EED4CE7716EE195100C65AA8 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EED4CE7616EE195100C65AA8 /* Sparkle.framework */; }; - EED4CE7816EE195B00C65AA8 /* Sparkle.framework in Copy Sparkle Framework */ = {isa = PBXBuildFile; fileRef = EED4CE7616EE195100C65AA8 /* Sparkle.framework */; }; + EED4CE7816EE195B00C65AA8 /* Sparkle.framework in Copy Sparkle Framework */ = {isa = PBXBuildFile; fileRef = EED4CE7616EE195100C65AA8 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; EEE703DC16F089FE002FDD69 /* NJHIDManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE703DB16F089FE002FDD69 /* NJHIDManager.m */; }; EEE703DE16F0B3F6002FDD69 /* NJInputPathElement.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE703DD16F0B3F6002FDD69 /* NJInputPathElement.m */; }; EEE73B1616EA42E5009D9D99 /* NSRunningApplication+NJPossibleNames.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE73B1516EA42E5009D9D99 /* NSRunningApplication+NJPossibleNames.m */; }; @@ -387,7 +387,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0610; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Enjoyable" */; compatibilityVersion = "Xcode 3.2"; @@ -536,7 +536,7 @@ CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; - CODE_SIGN_IDENTITY = "Joe Wreschnig's Self-Signed OS X Applications"; + CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -566,7 +566,7 @@ CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; - CODE_SIGN_IDENTITY = "Joe Wreschnig's Self-Signed OS X Applications"; + CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( @@ -591,14 +591,19 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_RECEIVER_WEAK = NO; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; @@ -632,14 +637,19 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_RECEIVER_WEAK = NO; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; GCC_C_LANGUAGE_STANDARD = c99; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; diff --git a/Info.plist b/Info.plist index 2dfc0d8..f7e61d5 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 609 + 630 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright -- 2.20.1