Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23415] Remove static-GUID support, resolve Xcode warnings #32

Merged
merged 3 commits into from
May 26, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion iphone/src/define.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

#ifdef USE_JSCORE_FRAMEWORK
BOOL isIOS9OrGreater() {
return [NSClassFromString(@"UIImage") instancesRespondToSelector:@selector(flipsForRightToLeftLayoutDirection)];;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
return [NSClassFromString(@"UIImage") instancesRespondToSelector:@selector(flipsForRightToLeftLayoutDirection)];
#pragma clang diagnostic pop
}

BOOL HLValueIsArray(JSContextRef js_context_ref, JSValueRef js_value_ref) {
Expand Down
6 changes: 3 additions & 3 deletions iphone/src/pointer.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ -(id)valueAtIndex:(NSUInteger)index {
SEL sel = NSSelectorFromString(obj);
return [HyperloopPointer pointer:sel encoding:@encode(SEL)];
} else {
NSLog(@"not sure what type of object SEL is at %lu", index);
NSLog(@"[ERROR] Not sure what type of object SEL is at %lu", (unsigned long)index);
}
break;
}
Expand Down Expand Up @@ -205,7 +205,7 @@ -(void)valueAtIndex:(NSUInteger)index pointer:(void *)ptr {
if ([obj isKindOfClass:[NSString class]]) {
*(SEL *)ptr = NSSelectorFromString(obj);
} else {
NSLog(@"not sure what type of object SEL is at %lu", index);
NSLog(@"[ERROR] Not sure what type of object SEL is at %lu", (unsigned long)index);
}
break;
}
Expand Down Expand Up @@ -1130,7 +1130,7 @@ -(void)setArgument:(NSInvocation *)invocation atIndex:(NSUInteger)index {
break;
}
default: {
NSLog(@"[ERROR] don't know how to encode argument at index %lu with type %c", index, ch);
NSLog(@"[ERROR] Don't know how to encode argument at index %lu with type %c", (unsigned long)index, ch);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion iphone/src/utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ +(id)unmarshalObject:(NSInvocation *)invocation arg:(id)arg index:(NSUInteger)in
}
else {
if (invocation) {
NSLog(@"[ERROR] not sure the type of %@ (%@) at %zu", arg, [arg class], index);
NSLog(@"[ERROR] Not sure the type of %@ (%@) at %lu", arg, [arg class], (unsigned long)index);
[invocation setArgument:&arg atIndex:index];
}
}
Expand Down
41 changes: 18 additions & 23 deletions iphone/titanium/HyperloopModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -989,18 +989,18 @@ static TiValueRef String (TiContextRef ctx, TiObjectRef function, TiObjectRef th
* The GUID format is a generated random UUID v4 but where the following is changed:
*
* 9cba353d-81aa-4593-9111-2e83c0136c14
* ^
* +---- always 9
* ^
* +---- always 9
*
* 9cba353d-81aa-4593-9111-2e83c0136c14
* ^^^
* +---- the following 3 characters will be the same and will be
* one of 0-9a-f
* ^^^
* +---- the following 3 characters will be the same and will be
* one of 0-9a-f
*
* 9cba353d-81aa-4593-9111-2e83c0136c14
* ^
* +----- the last remaining string is a SHA1 encoding of
* the org_id + app id (first 12 characters of the SHA1)
* ^
* +----- the last remaining string is a SHA1 encoding of
* the org_id + app id (first 12 characters of the SHA1)
*
*/
static BOOL isPlatformGUID (NSString *guid) {
Expand Down Expand Up @@ -1040,21 +1040,16 @@ +(void)willStartNewContext:(KrollContext *)kroll bridge:(KrollBridge *)krollbrid

// if not a valid platform GUID, we aren't going to enable Hyperloop
if (isPlatformGUID(TI_APPLICATION_GUID) == NO) {
// allow demo apps with demo GUID to run only in development mode
if ([TI_APPLICATION_GUID isEqual:@"11111111-1111-1111-1111-111111111111"] && [TI_APPLICATION_DEPLOYTYPE isEqual:@"development"]) {
NSLog(@"[WARN] Hyperloop is running in DEMO mode. This application will not run in production. To register this application with the Appcelerator Platform, run the command: appc new --import");
} else {
NSLog(@"[ERROR] Hyperloop is not currently supported because this application has not been registered. To register this application with the Appcelerator Platform, run the command: appc new --import");
#if TARGET_OS_SIMULATOR
UIAlertView *theAlert = [[UIAlertView alloc] initWithTitle:@"Hyperloop"
message:@"Hyperloop is not currently supported because this application has not been registered. To register this application with the Appcelerator Platform, run the command: appc new --import"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[theAlert show];
#endif
return;
}
NSLog(@"[ERROR] Hyperloop is not currently supported because this application has not been registered. To register this application with the Appcelerator Platform, run the command: appc new --import");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

#if TARGET_OS_SIMULATOR
UIAlertView *theAlert = [[UIAlertView alloc] initWithTitle:@"Hyperloop"
message:@"Hyperloop is not currently supported because this application has not been registered. To register this application with the Appcelerator Platform, run the command: appc new --import"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[theAlert show];
#endif
return;
}

context = kroll;
Expand Down