Skip to content

Commit 8f7474f

Browse files
mdamjanic7toto
authored andcommitted
Removed a couple of Xcode warnings related to implicitly using OSStatus in NSAssert, and building only for active architecture while in Debug mode.
1 parent bb9e288 commit 8f7474f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

OAuth2Client.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@
492492
GCC_WARN_ABOUT_RETURN_TYPE = YES;
493493
GCC_WARN_UNUSED_VARIABLE = YES;
494494
MACOSX_DEPLOYMENT_TARGET = 10.7;
495+
ONLY_ACTIVE_ARCH = YES;
495496
OTHER_LDFLAGS = "-ObjC";
496497
};
497498
name = Debug;

Sources/OAuth2Client/NXOAuth2AccessToken.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ + (id)tokenFromDefaultKeychainWithServiceProviderName:(NSString *)provider;
238238
result = (__bridge_transfer NSDictionary *)cfResult;
239239

240240
if (status != noErr) {
241-
NSAssert1(status == errSecItemNotFound, @"unexpected error while fetching token from keychain: %ld", status);
241+
NSAssert1(status == errSecItemNotFound, @"unexpected error while fetching token from keychain: %d", (int)status);
242242
return nil;
243243
}
244244

@@ -257,7 +257,7 @@ - (void)storeInDefaultKeychainWithServiceProviderName:(NSString *)provider;
257257
nil];
258258
[self removeFromDefaultKeychainWithServiceProviderName:provider];
259259
OSStatus __attribute__((unused)) err = SecItemAdd((__bridge CFDictionaryRef)query, NULL);
260-
NSAssert1(err == noErr, @"error while adding token to keychain: %ld", err);
260+
NSAssert1(err == noErr, @"error while adding token to keychain: %d", (int)err);
261261
}
262262

263263
- (void)removeFromDefaultKeychainWithServiceProviderName:(NSString *)provider;
@@ -268,7 +268,7 @@ - (void)removeFromDefaultKeychainWithServiceProviderName:(NSString *)provider;
268268
serviceName, kSecAttrService,
269269
nil];
270270
OSStatus __attribute__((unused)) err = SecItemDelete((__bridge CFDictionaryRef)query);
271-
NSAssert1((err == noErr || err == errSecItemNotFound), @"error while deleting token from keychain: %ld", err);
271+
NSAssert1((err == noErr || err == errSecItemNotFound), @"error while deleting token from keychain: %d", (int)err);
272272
}
273273

274274
#else

Sources/OAuth2Client/NXOAuth2AccountStore.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ + (NSDictionary *)accountsFromDefaultKeychain;
604604
result = (__bridge_transfer NSDictionary *)cfResult;
605605

606606
if (status != noErr) {
607-
NSAssert1(status == errSecItemNotFound, @"Unexpected error while fetching accounts from keychain: %ld", status);
607+
NSAssert1(status == errSecItemNotFound, @"Unexpected error while fetching accounts from keychain: %d", (int)status);
608608
return nil;
609609
}
610610

@@ -625,7 +625,7 @@ + (void)storeAccountsInDefaultKeychain:(NSDictionary *)accounts;
625625
data, kSecAttrGeneric,
626626
nil];
627627
OSStatus __attribute__((unused)) err = SecItemAdd((__bridge CFDictionaryRef)query, NULL);
628-
NSAssert1(err == noErr, @"Error while adding token to keychain: %ld", err);
628+
NSAssert1(err == noErr, @"Error while adding token to keychain: %d", (int)err);
629629
}
630630

631631
+ (void)removeFromDefaultKeychain;
@@ -636,7 +636,7 @@ + (void)removeFromDefaultKeychain;
636636
serviceName, kSecAttrService,
637637
nil];
638638
OSStatus __attribute__((unused)) err = SecItemDelete((__bridge CFDictionaryRef)query);
639-
NSAssert1((err == noErr || err == errSecItemNotFound), @"Error while deleting token from keychain: %ld", err);
639+
NSAssert1((err == noErr || err == errSecItemNotFound), @"Error while deleting token from keychain: ld", (int)err);
640640

641641
}
642642

0 commit comments

Comments
 (0)