]> git.saurik.com Git - cycript.git/commitdiff
Added bridging for nlist_64, activated memory manager, and setup a remap from singlet...
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 10 Oct 2009 21:00:56 +0000 (21:00 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 10 Oct 2009 21:00:56 +0000 (21:00 +0000)
Bridge.def
Library.mm
sig/parse.cpp
todo.txt

index 68251dad50f35ad25c2610389adccc3778e62321..e6071ef6c5991ec854a0b4808e7944af7907bb40 100644 (file)
@@ -8,6 +8,10 @@ S CGPoint "x"f"y"f
 S CGRect "origin"{CGPoint}"size"{CGSize}
 S CGSize "width"f"height"f
 
+l c
+
+S nlist_64 "_un"(?="n_strx"I)"n_type"C"n_sect"C"n_desc"S"n_value"Q
+
 l objc
 
 F class_addIvar B#*LC*
index 0083fb54551b713e1cb45771bebbd950632fa092..52cf42eff37ba4e4cd61381dd5558fe3d236d176 100644 (file)
@@ -306,6 +306,9 @@ JSObjectRef CYMakeStruct(JSContextRef context, void *data, sig::Type *type, ffi_
 }
 
 void Structor_(apr_pool_t *pool, const char *name, const char *types, sig::Type *type) {
+    if (name == NULL)
+        return;
+
     CYPoolTry {
         if (NSMutableArray *entry = [[Bridge_ objectAtIndex:2] objectForKey:[NSString stringWithUTF8String:name]]) {
             switch ([[entry objectAtIndex:0] intValue]) {
@@ -1068,7 +1071,7 @@ JSValueRef CYCastJSValue(JSContextRef context, const char *value) {
     return CYCastJSValue(context, CYJSString(value));
 }
 
-JSValueRef CYCastJSValue(JSContextRef context, id value, bool transient = true) {
+JSValueRef CYCastJSValue(JSContextRef context, id value, bool transient = false) {
     return value == nil ? CYJSNull(context) : [value cy$JSValueInContext:context transient:transient];
 }
 
index 1c0ec2339494bcfeb2f9be18b1ca476c976e8439..3452e5a3159bd2046cd332904e24b6d1fd967111 100644 (file)
@@ -118,7 +118,10 @@ struct Type *Parse_(apr_pool_t *pool, const char **name, char eos, bool named, C
         case '#': type->primitive = typename_P; break;
 
         case '(':
-            type->primitive = union_P;
+            if (type->data.signature.count < 2)
+                type->primitive = struct_P;
+            else
+                type->primitive = union_P;
             next = ')';
         goto aggregate;
 
index f64e66d2fec62cdab72de2f4583dd180bbd224de..93b78136c7a4e3658e74be741f4d88eee6a4262f 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -4,3 +4,4 @@ functors use both ffiData and ffoData...
 rename "data" variables to "internal"
 unicode identifier support (native and \u)
 object literal compilation should use numerify strings
+support unions (right now 0-1 fields parsed as struct)