]> git.saurik.com Git - cycript.git/commitdiff
Directly use primitives to construct class types.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 13 Oct 2014 11:16:16 +0000 (04:16 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 13 Oct 2014 11:16:16 +0000 (04:16 -0700)
Internal.hpp
ObjectiveC/Library.mm

index e0f732af6cc9270db0dacd8f60d4347527bf75c0..72b2986ecfe3ee0aeb9366e30c936b63afd0edb2 100644 (file)
@@ -60,6 +60,15 @@ struct Type_privateData :
         type_ = signature.elements[0].type;
     }
 
+    Type_privateData(sig::Primitive primitive) :
+        ffi_(NULL)
+    {
+        sig::Type type;
+        memset(&type, 0, sizeof(type));
+        type.primitive = primitive;
+        Set(&type);
+    }
+
     Type_privateData(sig::Type *type) :
         ffi_(NULL)
     {
index 32426a5ae974d7fdf4b495a5c051d3985690d35e..cb955092bf4872ebf5014e7b76f677aac5d5f376 100644 (file)
@@ -2840,8 +2840,8 @@ void CYObjectiveC_Initialize() { /*XXX*/ JSContextRef context(NULL); CYPoolTry {
 
     CYPool &pool(CYGetGlobalPool());
 
-    Object_type = new(pool) Type_privateData("@");
-    Selector_type = new(pool) Type_privateData(":");
+    Object_type = new(pool) Type_privateData(sig::object_P);
+    Selector_type = new(pool) Type_privateData(sig::selector_P);
 
     NSArray_ = objc_getClass("NSArray");
     NSBlock_ = objc_getClass("NSBlock");