Adjust to recent ObjFW changes

This commit is contained in:
Jonathan Schleifer 2017-05-08 02:39:06 +02:00
parent 2086b2fa5d
commit a0047e1b54
No known key found for this signature in database
GPG key ID: 28D65178B37F33E3
11 changed files with 38 additions and 37 deletions

View file

@ -24,7 +24,7 @@
@protocol PasswordGenerator @protocol PasswordGenerator
@property size_t length; @property size_t length;
@property (copy) OFString *site; @property (nonatomic, copy) OFString *site;
@property const char *passphrase; @property const char *passphrase;
@property (readonly) unsigned char *output; @property (readonly) unsigned char *output;

View file

@ -23,5 +23,5 @@
@import UIKit; @import UIKit;
@interface AboutController: UIViewController <UIWebViewDelegate> @interface AboutController: UIViewController <UIWebViewDelegate>
@property (retain, nonatomic) IBOutlet UIWebView *webView; @property (nonatomic, retain) IBOutlet UIWebView *webView;
@end @end

View file

@ -80,8 +80,8 @@ static NSString *aboutHTMLTemplate =
[super dealloc]; [super dealloc];
} }
- (BOOL)webView: (UIWebView*)webView - (BOOL)webView: (UIWebView *)webView
shouldStartLoadWithRequest: (NSURLRequest*)request shouldStartLoadWithRequest: (NSURLRequest *)request
navigationType: (UIWebViewNavigationType)navigationType navigationType: (UIWebViewNavigationType)navigationType
{ {
if (navigationType == UIWebViewNavigationTypeLinkClicked) { if (navigationType == UIWebViewNavigationTypeLinkClicked) {

View file

@ -25,9 +25,9 @@
#import "MainViewController.h" #import "MainViewController.h"
@interface AddSiteController: UITableViewController @interface AddSiteController: UITableViewController
@property (retain, nonatomic) IBOutlet UITextField *nameField; @property (nonatomic, retain) IBOutlet UITextField *nameField;
@property (retain, nonatomic) IBOutlet UITextField *lengthField; @property (nonatomic, retain) IBOutlet UITextField *lengthField;
@property (retain, nonatomic) IBOutlet UISwitch *legacySwitch; @property (nonatomic, retain) IBOutlet UISwitch *legacySwitch;
@property (retain) MainViewController *mainViewController; @property (retain) MainViewController *mainViewController;
- (IBAction)done: (id)sender; - (IBAction)done: (id)sender;

View file

@ -23,5 +23,5 @@
@import UIKit; @import UIKit;
@interface AppDelegate: UIResponder <UIApplicationDelegate> @interface AppDelegate: UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window; @property (nonatomic, strong) UIWindow *window;
@end @end

View file

@ -27,5 +27,5 @@
@interface MainViewController: UIViewController <UITableViewDelegate, @interface MainViewController: UIViewController <UITableViewDelegate,
UITableViewDataSource> UITableViewDataSource>
@property (retain) SiteStorage *siteStorage; @property (retain) SiteStorage *siteStorage;
@property (retain, nonatomic) IBOutlet UITableView *tableView; @property (nonatomic, retain) IBOutlet UITableView *tableView;
@end @end

View file

@ -41,14 +41,14 @@
[super dealloc]; [super dealloc];
} }
- (NSInteger)tableView: (UITableView*)tableView - (NSInteger)tableView: (UITableView *)tableView
numberOfRowsInSection: (NSInteger)section numberOfRowsInSection: (NSInteger)section
{ {
return [self.siteStorage sitesCount]; return [self.siteStorage sitesCount];
} }
- (UITableViewCell*)tableView: (UITableView*)tableView - (UITableViewCell *)tableView: (UITableView *)tableView
cellForRowAtIndexPath: (NSIndexPath*)indexPath cellForRowAtIndexPath: (NSIndexPath *)indexPath
{ {
UITableViewCell *cell = [tableView UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier: @"site"]; dequeueReusableCellWithIdentifier: @"site"];
@ -63,14 +63,14 @@
return cell; return cell;
} }
- (void)tableView: (UITableView*)tableView - (void)tableView: (UITableView *)tableView
didSelectRowAtIndexPath: (NSIndexPath*)indexPath didSelectRowAtIndexPath: (NSIndexPath *)indexPath
{ {
[self performSegueWithIdentifier: @"showDetails" [self performSegueWithIdentifier: @"showDetails"
sender: self]; sender: self];
} }
- (void)prepareForSegue: (UIStoryboardSegue*)segue - (void)prepareForSegue: (UIStoryboardSegue *)segue
sender: (id)sender sender: (id)sender
{ {
if ([segue.identifier isEqual: @"addSite"] || if ([segue.identifier isEqual: @"addSite"] ||

View file

@ -31,7 +31,7 @@
#import "LegacyPasswordGenerator.h" #import "LegacyPasswordGenerator.h"
@interface ShowDetailsController () @interface ShowDetailsController ()
- (void)_generateWithCallback: (void(^)(NSMutableString*))block; - (void)_generateWithCallback: (void (^)(NSMutableString *))block;
- (void)_generateAndCopy; - (void)_generateAndCopy;
- (void)_generateAndShow; - (void)_generateAndShow;
@end @end
@ -86,14 +86,14 @@ clearNSMutableString(NSMutableString *string)
[self.passphraseField becomeFirstResponder]; [self.passphraseField becomeFirstResponder];
} }
- (BOOL)textFieldShouldReturn: (UITextField*)textField - (BOOL)textFieldShouldReturn: (UITextField *)textField
{ {
[textField resignFirstResponder]; [textField resignFirstResponder];
return NO; return NO;
} }
- (void)tableView: (UITableView*)tableView - (void)tableView: (UITableView *)tableView
didSelectRowAtIndexPath: (NSIndexPath*)indexPath didSelectRowAtIndexPath: (NSIndexPath *)indexPath
{ {
[self.passphraseField resignFirstResponder]; [self.passphraseField resignFirstResponder];
[tableView deselectRowAtIndexPath: indexPath [tableView deselectRowAtIndexPath: indexPath
@ -161,7 +161,7 @@ clearNSMutableString(NSMutableString *string)
}]; }];
} }
- (void)_generateWithCallback: (void(^)(NSMutableString*))block - (void)_generateWithCallback: (void (^)(NSMutableString *))block
{ {
UIStoryboard *mainStoryboard = UIStoryboard *mainStoryboard =
[UIStoryboard storyboardWithName: @"Main" [UIStoryboard storyboardWithName: @"Main"
@ -195,9 +195,9 @@ clearNSMutableString(NSMutableString *string)
} }
NSMutableString *password = [NSMutableString NSMutableString *password = [NSMutableString
stringWithUTF8String: (char*)generator.output]; stringWithUTF8String: (char *)generator.output];
of_explicit_memset(generator.output, 0, of_explicit_memset(generator.output, 0,
strlen((char*)generator.output)); strlen((char *)generator.output));
activityController.view.hidden = YES; activityController.view.hidden = YES;
block(password); block(password);

View file

@ -25,18 +25,19 @@
@interface SiteStorage: OFObject @interface SiteStorage: OFObject
{ {
OFString *_path; OFString *_path;
OFMutableDictionary <OFString*, OFDictionary <OFNumber*, OFNumber*>*> OFMutableDictionary<OFString *, OFDictionary<OFNumber *, OFNumber *> *>
*_storage; *_storage;
OFArray *_sites; OFArray *_sites;
} }
- (OFArray*)sites; @property (readonly, nonatomic) OFArray<OFString *> *sites;
- (size_t)sitesCount; - (size_t)sitesCount;
- (bool)hasSite: (OFString*)name; - (bool)hasSite: (OFString *)name;
- (size_t)lengthForSite: (OFString*)name; - (size_t)lengthForSite: (OFString *)name;
- (bool)isSiteLegacy: (OFString*)name; - (bool)isSiteLegacy: (OFString *)name;
- (void)setSite: (OFString*)site - (void)setSite: (OFString *)site
length: (size_t)length length: (size_t)length
legacy: (bool)legacy; legacy: (bool)legacy;
- (void)removeSite: (OFString*)name; - (void)removeSite: (OFString *)name;
@end @end

View file

@ -84,7 +84,7 @@ static OFNumber *lengthField, *legacyField;
[super dealloc]; [super dealloc];
} }
- (OFArray*)sites - (OFArray<OFString *> *)sites
{ {
void *pool = objc_autoreleasePoolPush(); void *pool = objc_autoreleasePoolPush();
OFArray *sites = [[_storage allKeys] sortedArray]; OFArray *sites = [[_storage allKeys] sortedArray];
@ -99,12 +99,12 @@ static OFNumber *lengthField, *legacyField;
return [_storage count]; return [_storage count];
} }
- (bool)hasSite: (OFString*)name - (bool)hasSite: (OFString *)name
{ {
return (_storage[name] != nil); return (_storage[name] != nil);
} }
- (size_t)lengthForSite: (OFString*)name - (size_t)lengthForSite: (OFString *)name
{ {
OFDictionary *site = _storage[name]; OFDictionary *site = _storage[name];
@ -114,7 +114,7 @@ static OFNumber *lengthField, *legacyField;
return [site[lengthField] sizeValue]; return [site[lengthField] sizeValue];
} }
- (bool)isSiteLegacy: (OFString*)name - (bool)isSiteLegacy: (OFString *)name
{ {
OFDictionary *site = _storage[name]; OFDictionary *site = _storage[name];
@ -124,7 +124,7 @@ static OFNumber *lengthField, *legacyField;
return [site[legacyField] boolValue]; return [site[legacyField] boolValue];
} }
- (void)setSite: (OFString*)site - (void)setSite: (OFString *)site
length: (size_t)length length: (size_t)length
legacy: (bool)legacy legacy: (bool)legacy
{ {
@ -139,7 +139,7 @@ static OFNumber *lengthField, *legacyField;
objc_autoreleasePoolPop(pool); objc_autoreleasePoolPop(pool);
} }
- (void)removeSite: (OFString*)name - (void)removeSite: (OFString *)name
{ {
[_storage removeObjectForKey: name]; [_storage removeObjectForKey: name];
[self _update]; [self _update];

View file

@ -362,7 +362,7 @@
); );
INFOPLIST_FILE = Info.plist; INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen"; PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen.ios";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = Debug; name = Debug;
@ -380,7 +380,7 @@
); );
INFOPLIST_FILE = Info.plist; INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen"; PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen.ios";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = Release; name = Release;