X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/9a39f7051ad983d4377917e66222727dcbe6c099..fc44232bcff15a35c016ddfc1dc34b6503125020:/sig/copy.cpp diff --git a/sig/copy.cpp b/sig/copy.cpp index b85640c..9300a1d 100644 --- a/sig/copy.cpp +++ b/sig/copy.cpp @@ -34,7 +34,7 @@ namespace sig { -void Copy(CYPool &pool, Element &lhs, Element &rhs) { +void Copy(CYPool &pool, Element &lhs, const Element &rhs) { lhs.name = pool.strdup(rhs.name); if (rhs.type == NULL) lhs.type = NULL; @@ -45,7 +45,7 @@ void Copy(CYPool &pool, Element &lhs, Element &rhs) { lhs.offset = rhs.offset; } -void Copy(CYPool &pool, Signature &lhs, Signature &rhs) { +void Copy(CYPool &pool, Signature &lhs, const Signature &rhs) { size_t count(rhs.count); lhs.count = count; lhs.elements = new(pool) Element[count]; @@ -53,16 +53,16 @@ void Copy(CYPool &pool, Signature &lhs, Signature &rhs) { Copy(pool, lhs.elements[index], rhs.elements[index]); } -void Copy(CYPool &pool, Type &lhs, Type &rhs) { +void Copy(CYPool &pool, Type &lhs, const Type &rhs) { lhs.primitive = rhs.primitive; lhs.name = pool.strdup(rhs.name); lhs.flags = rhs.flags; - if (rhs.primitive == '\0' || sig::IsAggregate(rhs.primitive)) + if (sig::IsFunctional(rhs.primitive) || sig::IsAggregate(rhs.primitive)) Copy(pool, lhs.data.signature, rhs.data.signature); else { sig::Type *&lht(lhs.data.data.type); - sig::Type *&rht(rhs.data.data.type); + sig::Type *const &rht(rhs.data.data.type); if (rht == NULL) lht = NULL;