[TIMOB-8769] Add __IPHONE_5_x macros, fix bad cast #2040

Merged
merged 2 commits into from Apr 26, 2012
Jump to file or symbol
Failed to load files and symbols.
+19 −7
Diff settings

Always

Just for now

@@ -194,7 +194,7 @@ -(void)contextWasShutdown:(KrollBridge*)bridge
{
for (KrollCallback *callback in [NSArray arrayWithArray:singleHeading])
{
- KrollContext *ctx = (id<TiEvaluator>)[callback context];
+ KrollContext *ctx = (KrollContext*)[callback context];
if ([bridge krollContext] == ctx)
{
[singleHeading removeObject:callback];
@@ -210,7 +210,7 @@ -(void)contextWasShutdown:(KrollBridge*)bridge
{
for (KrollCallback *callback in [NSArray arrayWithArray:singleLocation])
{
- KrollContext *ctx = (id<TiEvaluator>)[callback context];
+ KrollContext *ctx = (KrollContext*)[callback context];
if ([bridge krollContext] == ctx)
{
[singleLocation removeObject:callback];
@@ -50,7 +50,7 @@ -(id)registerBackgroundService:(id)args
NSString* urlString = [[TiUtils toURL:[a objectForKey:@"url"] proxy:self]absoluteString];
if ([urlString length] == 0) {
- return;
+ return nil;
}
if (backgroundServices == nil) {
View
@@ -26,6 +26,18 @@ extern "C" {
#define __IPHONE_4_2 40200
#endif
+#ifndef __IPHONE_4_3
+#define __IPHONE_4_3 40300
+#endif
+
+#ifndef __IPHONE_5_0
+#define __IPHONE_5_0 50000
+#endif
+
+#ifndef __IPHONE_5_1
+#define __IPHONE_5_1 50100
+#endif
+
#ifdef DEBUG
// Kroll memory debugging
#define KROLLBRIDGE_MEMORY_DEBUG MEMORY_DEBUG
@@ -494,7 +494,7 @@ -(id)removeAttributeNode:(id)args
if(nodeToRemove == nil)
{
[self throwException:@"no node found to remove" subreason:nil location:CODELOCATION];
- return;
+ return nil;
}
else
{
@@ -510,7 +510,7 @@ -(id)removeAttributeNode:(id)args
else
{
[self throwException:@"no node found to remove" subreason:nil location:CODELOCATION];
- return;
+ return nil;
}
}
@@ -527,7 +527,7 @@ -(id)insertBefore:(id)args
xmlNodePtr refNodePtr = [[refChild node]XMLNode];
xmlNodePtr newNodePtr = [[newChild node]XMLNode];
if (newNodePtr == refNodePtr)
- return;
+ return newChild;
TiDOMNodeListProxy* nodeList = [self childNodes];
@@ -585,7 +585,7 @@ -(id)replaceChild:(id)args
xmlNodePtr refNodePtr = [[refChild node]XMLNode];
xmlNodePtr newNodePtr = [[newChild node]XMLNode];
if (newNodePtr == refNodePtr)
- return;
+ return refChild;
TiDOMNodeListProxy* nodeList = [self childNodes];