Index: LegacyPasswordGenerator.m ================================================================== --- LegacyPasswordGenerator.m +++ LegacyPasswordGenerator.m @@ -29,11 +29,11 @@ + (instancetype)generator { return [[[self alloc] init] autorelease]; } -- init +- (instancetype)init { self = [super init]; _length = 16; @@ -57,12 +57,12 @@ { OFSHA256Hash *siteHash = [OFSHA256Hash cryptoHash]; size_t passphraseLength, combinedPassphraseLength; char *combinedPassphrase; - [siteHash updateWithBuffer: [_site UTF8String] - length: [_site UTF8StringLength]]; + [siteHash updateWithBuffer: _site.UTF8String + length: _site.UTF8StringLength]; if (_output != NULL) { of_explicit_memset(_output, 0, _length); [self freeMemory: _output]; } @@ -69,14 +69,14 @@ _output = [self allocMemoryWithSize: _length + 1]; passphraseLength = combinedPassphraseLength = strlen(_passphrase); if (_keyfile != nil) { - if (SIZE_MAX - combinedPassphraseLength < [_keyfile count]) + if (SIZE_MAX - combinedPassphraseLength < _keyfile.count) @throw [OFOutOfRangeException exception]; - combinedPassphraseLength += [_keyfile count]; + combinedPassphraseLength += _keyfile.count; } if ((combinedPassphrase = malloc(combinedPassphraseLength)) == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: combinedPassphraseLength]; @@ -83,14 +83,14 @@ @try { memcpy(combinedPassphrase, _passphrase, passphraseLength); if (_keyfile != nil) memcpy(combinedPassphrase + passphraseLength, - [_keyfile items], [_keyfile count]); + _keyfile.items, _keyfile.count); - of_scrypt(8, 524288, 2, [siteHash digest], - [[siteHash class] digestSize], combinedPassphrase, + of_scrypt(8, 524288, 2, siteHash.digest, + [siteHash.class digestSize], combinedPassphrase, combinedPassphraseLength, _output, _length); } @finally { of_explicit_memset(combinedPassphrase, 0, combinedPassphraseLength); free(combinedPassphrase); Index: NewPasswordGenerator.m ================================================================== --- NewPasswordGenerator.m +++ NewPasswordGenerator.m @@ -29,11 +29,11 @@ + (instancetype)generator { return [[[self alloc] init] autorelease]; } -- init +- (instancetype)init { self = [super init]; _length = 16; @@ -44,12 +44,12 @@ { OFSHA384Hash *siteHash = [OFSHA384Hash cryptoHash]; size_t passphraseLength, combinedPassphraseLength; char *combinedPassphrase; - [siteHash updateWithBuffer: [_site UTF8String] - length: [_site UTF8StringLength]]; + [siteHash updateWithBuffer: _site.UTF8String + length: _site.UTF8StringLength]; if (_output != NULL) { of_explicit_memset(_output, 0, _length); [self freeMemory: _output]; } @@ -56,14 +56,14 @@ _output = [self allocMemoryWithSize: _length + 1]; passphraseLength = combinedPassphraseLength = strlen(_passphrase); if (_keyfile != nil) { - if (SIZE_MAX - combinedPassphraseLength < [_keyfile count]) + if (SIZE_MAX - combinedPassphraseLength < _keyfile.count) @throw [OFOutOfRangeException exception]; - combinedPassphraseLength += [_keyfile count]; + combinedPassphraseLength += _keyfile.count; } if ((combinedPassphrase = malloc(combinedPassphraseLength)) == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: combinedPassphraseLength]; @@ -70,14 +70,14 @@ @try { memcpy(combinedPassphrase, _passphrase, passphraseLength); if (_keyfile != nil) memcpy(combinedPassphrase + passphraseLength, - [_keyfile items], [_keyfile count]); + _keyfile.items, _keyfile.count); - of_scrypt(8, 524288, 2, [siteHash digest], - [[siteHash class] digestSize], combinedPassphrase, + of_scrypt(8, 524288, 2, siteHash.digest, + [siteHash.class digestSize], combinedPassphrase, combinedPassphraseLength, _output, _length); } @finally { of_explicit_memset(combinedPassphrase, 0, combinedPassphraseLength); free(combinedPassphrase); Index: ScryptPWGen.m ================================================================== --- ScryptPWGen.m +++ ScryptPWGen.m @@ -103,26 +103,26 @@ [OFApplication terminateWithStatus: 1]; break; } } - if ([[optionsParser remainingArguments] count] != 1) { + if (optionsParser.remainingArguments.count != 1) { showHelp(of_stderr, false); [OFApplication terminateWithStatus: 1]; } id generator = (_legacy ? [LegacyPasswordGenerator generator] : [NewPasswordGenerator generator]); - generator.site = [[optionsParser remainingArguments] firstObject]; + generator.site = optionsParser.remainingArguments.firstObject; if (lengthString != nil) { bool invalid = false; @try { - generator.length = (size_t)[lengthString decimalValue]; + generator.length = (size_t)lengthString.decimalValue; } @catch (OFInvalidFormatException *e) { invalid = true; } @catch (OFOutOfRangeException *e) { invalid = true; } @@ -188,11 +188,11 @@ } } @finally { of_explicit_memset(passphrase, 0, strlen(passphrase)); if (keyfile != nil) - of_explicit_memset([keyfile items], 0, [keyfile count]); + of_explicit_memset(keyfile.items, 0, keyfile.count); } [OFApplication terminate]; } @end Index: iOS/AboutController.m ================================================================== --- iOS/AboutController.m +++ iOS/AboutController.m @@ -64,11 +64,11 @@ { [super viewDidLoad]; self.automaticallyAdjustsScrollViewInsets = NO; - NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; + NSDictionary *infoDictionary = NSBundle.mainBundle.infoDictionary; NSString *version = infoDictionary[@"CFBundleShortVersionString"]; NSString *aboutHTML = [aboutHTMLTemplate stringByReplacingOccurrencesOfString: @"{version}" withString: version]; [self.webView loadHTMLString: aboutHTML @@ -85,15 +85,15 @@ - (BOOL)webView: (UIWebView *)webView shouldStartLoadWithRequest: (NSURLRequest *)request navigationType: (UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { - [[UIApplication sharedApplication] openURL: request.URL - options: @{} - completionHandler: ^ (BOOL success) { + [UIApplication.sharedApplication openURL: request.URL + options: @{} + completionHandler: ^ (BOOL success) { }]; return NO; } return YES; } @end Index: iOS/AddSiteController.m ================================================================== --- iOS/AddSiteController.m +++ iOS/AddSiteController.m @@ -52,22 +52,22 @@ [super dealloc]; } - (IBAction)done: (id)sender { - OFString *name = [self.nameField.text OFObject]; - OFString *lengthStr = [self.lengthField.text OFObject]; + OFString *name = self.nameField.text.OFObject; + OFString *lengthString = self.lengthField.text.OFObject; bool lengthValid = true; size_t length; - if ([name length] == 0) { + if (name.length == 0) { showAlert(self, @"Name missing", @"Please enter a name."); return; } @try { - length = (size_t)[lengthStr decimalValue]; + length = (size_t)lengthString.decimalValue; if (length < 3 || length > 64) lengthValid = false; } @catch (OFInvalidFormatException *e) { lengthValid = false; Index: iOS/MainViewController.m ================================================================== --- iOS/MainViewController.m +++ iOS/MainViewController.m @@ -72,19 +72,19 @@ if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: @"site"] autorelease]; - cell.textLabel.text = [self.sites[indexPath.row] NSObject]; + cell.textLabel.text = self.sites[indexPath.row].NSObject; return cell; } - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { - self.sites = [_siteStorage sitesWithFilter: [_searchBar.text OFObject]]; + self.sites = [_siteStorage sitesWithFilter: _searchBar.text.OFObject]; [_tableView reloadData]; } - (void)tableView: (UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath Index: iOS/ShowDetailsController.m ================================================================== --- iOS/ShowDetailsController.m +++ iOS/ShowDetailsController.m @@ -75,11 +75,11 @@ [_name release]; _name = [self.mainViewController.sites[indexPath.row] retain]; _length = [siteStorage lengthForSite: _name]; _legacy = [siteStorage isSiteLegacy: _name]; - self.nameField.text = [_name NSObject]; + self.nameField.text = _name.NSObject; self.lengthField.text = [NSString stringWithFormat: @"%zu", _length]; self.legacySwitch.on = _legacy; [self.mainViewController.tableView deselectRowAtIndexPath: indexPath animated: YES]; @@ -180,11 +180,11 @@ generator = [NewPasswordGenerator generator]; generator.site = _name; generator.length = _length; - passphrase = of_strdup([self.passphraseField.text UTF8String]); + passphrase = of_strdup(self.passphraseField.text.UTF8String); generator.passphrase = passphrase; mainStoryboard = [UIStoryboard storyboardWithName: @"Main" bundle: nil]; activityController = [mainStoryboard Index: iOS/scrypt-pwgen.xcodeproj/project.pbxproj ================================================================== --- iOS/scrypt-pwgen.xcodeproj/project.pbxproj +++ iOS/scrypt-pwgen.xcodeproj/project.pbxproj @@ -177,11 +177,11 @@ /* Begin PBXProject section */ 4B2E52D41DA942840040D091 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0910; ORGANIZATIONNAME = "Jonathan Schleifer"; TargetAttributes = { 4B2E52DB1DA942840040D091 = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = MXKNFCKFL6; @@ -265,19 +265,25 @@ ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -299,10 +305,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 4B2E52F21DA942840040D091 /* Release */ = { @@ -311,19 +318,25 @@ ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";