Skip to content

Commit

Permalink
Updated for 32/64 bit architecture. Note that direct obj-c isa access…
Browse files Browse the repository at this point in the history
… is deprecated in the modern runtime. These warnings have not yet been resolved as there may be performance penalties on all arithmetic. However, the change may be necessary.
  • Loading branch information
Jonathan Mitchell committed Nov 25, 2012
1 parent dbe71da commit 6bfb258
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 79 deletions.
291 changes: 226 additions & 65 deletions F-Script/DemoAssistant.xib

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions F-Script/FSNewlyAllocatedObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* This software is open source. See the license. */

#import "FSNewlyAllocatedObject.h"

#import <objc/objc-runtime.h>

@implementation FSNewlyAllocatedObject

Expand All @@ -13,7 +13,7 @@ + (id)newlyAllocatedObjectWithTarget:(id)theTarget

- (NSString *)description
{
return [[@"Proxy for a newly allocated " stringByAppendingString:NSStringFromClass(target->isa)] stringByAppendingString:@". Don't forget to initialize it and to use the object returned by the init... method instead of this proxy." ];
return [[@"Proxy for a newly allocated " stringByAppendingString:NSStringFromClass(object_getClass(target))] stringByAppendingString:@". Don't forget to initialize it and to use the object returned by the init... method instead of this proxy." ];
}

- (void)forwardInvocation:(NSInvocation *)anInvocation
Expand Down
11 changes: 4 additions & 7 deletions FScript.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3627,7 +3627,7 @@
8F2881E908F9C040005B3C5A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = "$(value) NO";
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down Expand Up @@ -3666,6 +3666,7 @@
8F2881EA08F9C040005B3C5A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down Expand Up @@ -3868,7 +3869,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
Expand Down Expand Up @@ -3902,10 +3903,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
x86_64,
i386,
);
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
Expand All @@ -3920,7 +3918,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.6;
OTHER_LDFLAGS = "";
SDKROOT = macosx;
VALID_ARCHS = "i386 x86_64";
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion FScriptFramework/CompiledCodeNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ - (NSString *)description
break;
}

[r appendFormat:@", \n subnodeList ( %ld elements)", [subnodes count]];
[r appendFormat:@", \n subnodeList ( %ld elements)", (long)[subnodes count]];

for (i = 0; i < [subnodes count]; i++)
[r appendString:[[subnodes objectAtIndex:i] description]];
Expand Down
4 changes: 2 additions & 2 deletions FScriptFramework/FSNewlyAllocatedObjectHolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* This software is open source. See the license. */

#import "FSNewlyAllocatedObjectHolder.h"

#import <objc/objc-runtime.h>

@implementation FSNewlyAllocatedObjectHolder

Expand All @@ -25,7 +25,7 @@ - (id)object {return object;}

- (NSString *)printString
{
return [[@"Holder for a newly allocated " stringByAppendingString:NSStringFromClass(object->isa)] stringByAppendingString:@". Don't forget to initialize it (use an init... method) and to use the object returned by the init... method instead of this holder." ];
return [[@"Holder for a newly allocated " stringByAppendingString:NSStringFromClass(object_getClass(object))] stringByAppendingString:@". Don't forget to initialize it (use an init... method) and to use the object returned by the init... method instead of this holder." ];
}

@end
4 changes: 2 additions & 2 deletions FScriptFramework/TestFS.m
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ + (NSInteger *)pointer
{ NSLog(@"TestFS return %p", &p); return &p;}

+ (NSInteger *)pointerWith:object with:(NSInteger)i
{ NSLog(@"object received: %@, int received:%ld . TestFS return %p",object, i, &p); return &p;}
{ NSLog(@"object received: %@, int received:%ld . TestFS return %p",object, (long)i, &p); return &p;}

+ (void) setPValue:(NSInteger)new
{ p = new; }
Expand All @@ -375,7 +375,7 @@ + (NSInteger)pValue {return p;}
+ (void)setPointer:(NSInteger *)p
{
NSLog(@"setPointer: received pointer to %p", p);
NSLog(@"%ld",*p);
NSLog(@"%ld", (long)*p);
}

+ (FSPointer *)fsPointer
Expand Down

0 comments on commit 6bfb258

Please sign in to comment.