]> git.saurik.com Git - cycript.git/blobdiff - sig/parse.cpp
Added a level of indirection so we don't keep repackaging stale packages.
[cycript.git] / sig / parse.cpp
index 05b321373a762960cc500abb8592fac9e18dacb5..24de0bc045a28af5971d7ce067b75db1892d3c4c 100644 (file)
@@ -1,4 +1,4 @@
-/* Cycript - Remove Execution Server and Disassembler
+/* Cycript - Inlining/Optimizing JavaScript Compiler
  * Copyright (C) 2009  Jay Freeman (saurik)
 */
 
@@ -201,17 +201,8 @@ struct Type *Parse_(apr_pool_t *pool, const char **name, char eos, bool named, C
 
             // XXX: this types thing is a throwback to JocStrap
 
-            char *types;
-            if (next != '=') {
-                types = NULL;
-            } else {
-                const char *temp(*name);
+            if (next == '=')
                 Parse_(pool, &type->data.signature, name, end, callback);
-                types = (char *) apr_pstrmemdup(pool, temp, *name - temp - 1);
-            }
-
-            if (callback != NULL)
-                (*callback)(pool, type->name, types, type);
         } break;
 
         case 'N': type->flags |= JOC_TYPE_INOUT; goto next;
@@ -232,6 +223,9 @@ struct Type *Parse_(apr_pool_t *pool, const char **name, char eos, bool named, C
             _assert(false);
     }
 
+    if (callback != NULL)
+        (*callback)(pool, type);
+
     return type;
 }
 
@@ -271,11 +265,11 @@ const char *Unparse(apr_pool_t *pool, struct Type *type) {
 
         case array_P: {
             const char *value = Unparse(pool, type->data.data.type);
-            return apr_psprintf(pool, "[%lu%s]", type->data.data.size, value);
+            return apr_psprintf(pool, "[%"APR_SIZE_T_FMT"%s]", type->data.data.size, value);
         } break;
 
         case pointer_P: return apr_psprintf(pool, "^%s", type->data.data.type == NULL ? "v" : Unparse(pool, type->data.data.type));
-        case bit_P: return apr_psprintf(pool, "b%zu", type->data.data.size);
+        case bit_P: return apr_psprintf(pool, "b%"APR_SIZE_T_FMT"", type->data.data.size);
         case char_P: return "c";
         case double_P: return "d";
         case float_P: return "f";