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
@property size_t length;
@property (copy) OFString *site;
@property (nonatomic, copy) OFString *site;
@property const char *passphrase;
@property (readonly) unsigned char *output;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -362,7 +362,7 @@
);
INFOPLIST_FILE = Info.plist;
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)";
};
name = Debug;
@ -380,7 +380,7 @@
);
INFOPLIST_FILE = Info.plist;
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)";
};
name = Release;