Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Gravity.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = GDI;
LastUpgradeCheck = 0500;
LastUpgradeCheck = 0610;
ORGANIZATIONNAME = "Grant Davis Interactive, LLC";
TargetAttributes = {
77DAEC6215790DE80035EFC5 = {
Expand Down Expand Up @@ -653,8 +653,10 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -724,8 +726,10 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -757,8 +761,10 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
<string>Gravity</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>B54EFC69-7B97-441E-8547-FF4643B0EBB4</key>
<string>ssh://github.com/gdavis/Gravity.git</string>
<key>1109C243DE63CF4106F76093EDB23CBFBCB6B992</key>
<string>https://github.com/dwieringa/Gravity.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>Gravity/Gravity.xcodeproj/project.xcworkspace</string>
<string>Gravity.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>B54EFC69-7B97-441E-8547-FF4643B0EBB4</key>
<string>../../..</string>
<key>1109C243DE63CF4106F76093EDB23CBFBCB6B992</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/gdavis/Gravity.git</string>
<string>https://github.com/dwieringa/Gravity.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>B54EFC69-7B97-441E-8547-FF4643B0EBB4</string>
<string>1109C243DE63CF4106F76093EDB23CBFBCB6B992</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>B54EFC69-7B97-441E-8547-FF4643B0EBB4</string>
<string>1109C243DE63CF4106F76093EDB23CBFBCB6B992</string>
<key>IDESourceControlWCCName</key>
<string>Gravity</string>
</dict>
Expand Down
11 changes: 10 additions & 1 deletion Gravity.xcodeproj/xcshareddata/xcschemes/Gravity.xcscheme
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 = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -49,6 +49,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "77DAEC5215790DE80035EFC5"
BuildableName = "libGravity.a"
BlueprintName = "Gravity"
ReferencedContainer = "container:Gravity.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
Expand Down
6 changes: 3 additions & 3 deletions Gravity/GDIPhoneNumberFormatting.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ + (NSString*)formatNumber:(NSString*)mobileNumber
mobileNumber = [mobileNumber stringByReplacingOccurrencesOfString:@"-" withString:@""];
mobileNumber = [mobileNumber stringByReplacingOccurrencesOfString:@"+" withString:@""];

int length = [mobileNumber length];
NSUInteger length = [mobileNumber length];
if(length > 10) {
mobileNumber = [mobileNumber substringFromIndex: length-10];
}
return mobileNumber;
}


//TODO: Why doesn't getLength return a NSUInteger?
+ (int)getLength:(NSString*)mobileNumber
{
mobileNumber = [mobileNumber stringByReplacingOccurrencesOfString:@"(" withString:@""];
Expand All @@ -109,7 +109,7 @@ + (int)getLength:(NSString*)mobileNumber
mobileNumber = [mobileNumber stringByReplacingOccurrencesOfString:@"-" withString:@""];
mobileNumber = [mobileNumber stringByReplacingOccurrencesOfString:@"+" withString:@""];

int length = [mobileNumber length];
int length = (int)[mobileNumber length];
return length;
}

Expand Down
15 changes: 8 additions & 7 deletions Gravity/NSData+GDIAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ - (NSString *)MD5
unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];

// Create 16 byte MD5 hash value, store in buffer
CC_MD5(self.bytes, self.length, md5Buffer);
CC_MD5(self.bytes, (CC_LONG)self.length, md5Buffer);

// Convert unsigned char buffer to NSString of hex values
NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
Expand All @@ -32,16 +32,17 @@ - (NSData *)gzipInflate
{
if ([self length] == 0) return self;

unsigned full_length = [self length];
unsigned half_length = [self length] / 2;
NSUInteger full_length = [self length];
NSUInteger half_length = [self length] / 2;

NSMutableData *decompressed = [NSMutableData dataWithLength: full_length + half_length];
BOOL done = NO;
int status;

z_stream strm;
strm.next_in = (Bytef *)[self bytes];
strm.avail_in = [self length];
//TODO: rather than blindly cast length down to smaller size, consider throwing error if too large?
strm.avail_in = (uInt)[self length];
strm.total_out = 0;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
Expand All @@ -53,7 +54,7 @@ - (NSData *)gzipInflate
if (strm.total_out >= [decompressed length])
[decompressed increaseLengthBy: half_length];
strm.next_out = [decompressed mutableBytes] + strm.total_out;
strm.avail_out = [decompressed length] - strm.total_out;
strm.avail_out = (uInt)([decompressed length] - strm.total_out);

// Inflate another chunk.
status = inflate (&strm, Z_SYNC_FLUSH);
Expand Down Expand Up @@ -82,7 +83,7 @@ - (NSData *)gzipDeflate
strm.opaque = Z_NULL;
strm.total_out = 0;
strm.next_in=(Bytef *)[self bytes];
strm.avail_in = [self length];
strm.avail_in = (uInt)[self length];

// Compresssion Levels:
// Z_NO_COMPRESSION
Expand All @@ -100,7 +101,7 @@ - (NSData *)gzipDeflate
[compressed increaseLengthBy: 16384];

strm.next_out = [compressed mutableBytes] + strm.total_out;
strm.avail_out = [compressed length] - strm.total_out;
strm.avail_out = (uInt)([compressed length] - strm.total_out);

deflate(&strm, Z_FINISH);

Expand Down
2 changes: 1 addition & 1 deletion Gravity/NSString+GDIAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (NSString*)MD5
unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];

// Create 16 byte MD5 hash value, store in buffer
CC_MD5(ptr, strlen(ptr), md5Buffer);
CC_MD5(ptr, (CC_LONG)strlen(ptr), md5Buffer);

// Convert MD5 value in the buffer to NSString of hex values
NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
Expand Down
2 changes: 1 addition & 1 deletion Gravity/UIFont+GDIAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ + (void)logInstalledFonts
NSArray *fonts = [UIFont familyNames];
for (NSString *familyName in fonts) {
NSArray *fontNamesInFamily = [UIFont fontNamesForFamilyName:familyName];
NSLog(@"%@ Family (%i)", familyName, fontNamesInFamily.count);
NSLog(@"%@ Family (%lu)", familyName, (unsigned long)fontNamesInFamily.count);
for (NSString *fontName in fontNamesInFamily) {
NSLog(@"\t - %@", fontName);
}
Expand Down