Skip to content

Commit

Permalink
Merge pull request #23 from balanced/arm64
Browse files Browse the repository at this point in the history
arm64
  • Loading branch information
remear committed Mar 18, 2014
2 parents 19d7caf + 48c89ad commit 88446f6
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ DerivedData
balanced.a
include
*.xccheckout
*.zip
*.zip
build*
12 changes: 11 additions & 1 deletion Balanced.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "rm -rf \"${PROJECT_DIR}/balanced.a\"\nrm -rf \"${PROJECT_DIR}/include\"\n\necho \"${BUILT_PRODUCTS_DIR}\"\n\nxcodebuild -project Balanced.xcodeproj -scheme balanced-iphonesimulator -sdk iphonesimulator7.0 \"ARCHS=i386\" \"VALID_ARCHS=i386\" build > /dev/null\n\nxcodebuild -project Balanced.xcodeproj -scheme balanced-iphoneos -sdk iphoneos7.0 \"ARCHS=armv6 armv7 armv7s\" build > /dev/null\n\nlipo -create \"${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-iphonesimulator/libbalanced-iphonesimulator.a\" \\\n\"${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-iphoneos/libbalanced-iphoneos.a\" -output \\\n\"${PROJECT_DIR}/balanced.a\"\n\ncp -R \"${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-iphoneos/include\" \"${PROJECT_DIR}/include\"\n\nmv \"${PROJECT_DIR}/include/balanced-iphoneos\" \"${PROJECT_DIR}/include/balanced\"";
shellScript = "rm -rf \"${PROJECT_DIR}/balanced.a\"\nrm -rf \"${PROJECT_DIR}/include\"\n\nxcodebuild -project \"Balanced.xcodeproj\" -configuration \"Release\" -sdk \"iphoneos7.1\" clean build ARCHS=\"armv7 armv7s arm64\" IPHONEOS_DEPLOYMENT_TARGET=\"6.0\" TARGET_BUILD_DIR=\"${PROJECT_DIR}/build-arm\" BUILT_PRODUCTS_DIR=\"${PROJECT_DIR}/build-arm\"\nxcodebuild -project \"Balanced.xcodeproj\" -configuration \"Release\" -sdk \"iphonesimulator7.1\" clean build ARCHS=\"i386 x86_64\" VALID_ARCHS=\"i386 x86_64\" IPHONEOS_DEPLOYMENT_TARGET=\"6.0\" TARGET_BUILD_DIR=\"${PROJECT_DIR}/build-intel\" BUILT_PRODUCTS_DIR=\"${PROJECT_DIR}/build-intel\"\nlipo -create \"${PROJECT_DIR}/build-arm/libbalanced-iphoneos.a\" \"${PROJECT_DIR}/build-intel/libbalanced-iphoneos.a\" -output \"${PROJECT_DIR}/balanced.a\"\n\nmv \"${PROJECT_DIR}/build-arm/include/balanced-iphoneos\" \"${PROJECT_DIR}/include\"\n\nrm -rf \"${PROJECT_DIR}/build-intel\"\nrm -rf \"${PROJECT_DIR}/build-arm\"";
};
87BD3190174678240099FF6C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -903,6 +903,10 @@
87BD30E51745C18B0099FF6C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
armv7s,
armv7,
);
FRAMEWORK_SEARCH_PATHS = (
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
Expand All @@ -911,13 +915,18 @@
GCC_PREFIX_HEADER = "Balanced/Balanced-Prefix.pch";
INFOPLIST_FILE = "BalancedTests/BalancedTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = "armv7 armv7s";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
87BD30E61745C18B0099FF6C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
armv7s,
armv7,
);
FRAMEWORK_SEARCH_PATHS = (
"\"$(SDKROOT)/Developer/Library/Frameworks\"",
"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
Expand All @@ -926,6 +935,7 @@
GCC_PREFIX_HEADER = "Balanced/Balanced-Prefix.pch";
INFOPLIST_FILE = "BalancedTests/BalancedTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = "armv7 armv7s";
WRAPPER_EXTENSION = octest;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Balanced/BPCard.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (BOOL)getNumberValid {
BOOL odd = true;
int total = 0;

for (int i = self.number.length - 1; i >= 0; i--) {
for (int i = (int)self.number.length - 1; i >= 0; i--) {
int value = [[self.number substringWithRange:NSMakeRange(i, 1)] intValue];
total += (odd = !odd) ? 2 * value - (value > 4 ? 9 : 0) : value;
}
Expand Down Expand Up @@ -104,7 +104,7 @@ - (BOOL)getValid {

- (BPCardType)getType
{
int digits = [[self.number substringWithRange:NSMakeRange(0, 2)] integerValue];
int digits = [[self.number substringWithRange:NSMakeRange(0, 2)] intValue];

if (digits >= 40 && digits <= 49) {
return BPCardTypeVisa;
Expand Down
4 changes: 2 additions & 2 deletions Balanced/BPUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ + (NSDictionary *)capabilities {
}

+ (NSString *)userAgentString {
return [NSString stringWithFormat:@"Balanced iOS %@",
return [NSString stringWithFormat:@"balanced-ios/%@",
BALANCED_IOS_VERSION];
}

+ (int)getTimezoneOffset {
return [[NSTimeZone systemTimeZone] secondsFromGMTForDate:[NSDate date]] / 3600;
return (int)[[NSTimeZone systemTimeZone] secondsFromGMTForDate:[NSDate date]] / 3600;
}

+ (NSString *)getMACAddress {
Expand Down
4 changes: 2 additions & 2 deletions Balanced/Balanced-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1.0.1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Balanced/Balanced-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#import <UIKit/UIKit.h>
#endif

#define BALANCED_IOS_VERSION @"1.0"
#define BALANCED_IOS_VERSION @"1.0.1"
6 changes: 3 additions & 3 deletions Balanced/Balanced.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ - (void)createCardWithNumber:(NSString *)number
if (card.valid) {
NSMutableDictionary *payload = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
card.number, @"number",
[NSString stringWithFormat:@"%i",card.expirationMonth], @"expiration_month",
[NSString stringWithFormat:@"%i",card.expirationYear], @"expiration_year",
[NSString stringWithFormat:@"%i",(int)card.expirationMonth], @"expiration_month",
[NSString stringWithFormat:@"%i", (int)card.expirationYear], @"expiration_year",
[BPUtilities capabilities], @"meta",
nil];

Expand Down Expand Up @@ -161,7 +161,7 @@ - (void)createFundingInstrument:(NSDictionary *)payload
responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&tokenizeError];
if (tokenizeError == nil) {
NSMutableDictionary *tokenResponse = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&tokenizeError];
[tokenResponse setObject:[NSString stringWithFormat:@"%d", [response statusCode]] forKey:@"status"];
[tokenResponse setObject:[NSString stringWithFormat:@"%i", (int)[response statusCode]] forKey:@"status"];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
if (tokenizeError == nil) {
successBlock(tokenResponse);
Expand Down
8 changes: 0 additions & 8 deletions BalancedTests/BPUtilitiesTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ - (void)testGetTimezoneOffset {
STAssertTrue([BPUtilities getTimezoneOffset] >= -12 && [BPUtilities getTimezoneOffset] <= 14, @"Timezone offset should be within acceptable range");
}

- (void)testGetMACAddress {
STAssertNotNil([BPUtilities getMACAddress], @"MAC address should not be nil");
}

- (void)testGetIPAddress {
STAssertNotNil([BPUtilities getIPAddress], @"IP address should not be nil");
}

- (void)testUserAgentString {
STAssertNotNil([BPUtilities userAgentString], @"User-Agent should not be nil");
}
Expand Down

0 comments on commit 88446f6

Please sign in to comment.