From f23950d0c5bcfa04818b2007fc25db062364b409 Mon Sep 17 00:00:00 2001 From: "jwalden%mit.edu" Date: Wed, 5 Sep 2007 22:14:17 +0000 Subject: [PATCH] Bug 348748 - Remove cast macros from trace-malloc. r=bsmedberg on the script, a=NPOTDB+no-functionality-change --- tools/trace-malloc/leaksoup.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/trace-malloc/leaksoup.cpp b/tools/trace-malloc/leaksoup.cpp index 07be42f972f..4a3ea6d2cab 100644 --- a/tools/trace-malloc/leaksoup.cpp +++ b/tools/trace-malloc/leaksoup.cpp @@ -78,15 +78,15 @@ static PLHashNumber hash_pointer(const void *key) static int sort_by_index(const void* e1, const void* e2, void*) { - const AllocationNode *n1 = *NS_STATIC_CAST(const AllocationNode*const*, e1); - const AllocationNode *n2 = *NS_STATIC_CAST(const AllocationNode*const*, e2); + const AllocationNode *n1 = *static_cast(e1); + const AllocationNode *n2 = *static_cast(e2); return n1->index - n2->index; } static int sort_by_reverse_index(const void* e1, const void* e2, void*) { - const AllocationNode *n1 = *NS_STATIC_CAST(const AllocationNode*const*, e1); - const AllocationNode *n2 = *NS_STATIC_CAST(const AllocationNode*const*, e2); + const AllocationNode *n1 = *static_cast(e1); + const AllocationNode *n2 = *static_cast(e2); return n2->index - n1->index; } @@ -206,7 +206,7 @@ int main(int argc, char **argv) do { PRUint32 pos = stack.Count() - 1; AllocationNode *n = - NS_STATIC_CAST(AllocationNode*, stack[pos]); + static_cast(stack[pos]); if (n->reached) { n->index = dfs_index++; stack.RemoveElementAt(pos); @@ -217,7 +217,7 @@ int main(int argc, char **argv) // careful not to put reached nodes into the stack. nsVoidArray &pt = n->pointers_to; for (PRInt32 i = pt.Count() - 1; i >= 0; --i) { - if (!NS_STATIC_CAST(AllocationNode*, pt[i])->reached) { + if (!static_cast(pt[i])->reached) { stack.AppendElement(pt[i]); } } @@ -260,7 +260,7 @@ int main(int argc, char **argv) do { PRUint32 pos = stack.Count() - 1; AllocationNode *n = - NS_STATIC_CAST(AllocationNode*, stack[pos]); + static_cast(stack[pos]); stack.RemoveElementAt(pos); if (!n->reached) { @@ -291,7 +291,7 @@ int main(int argc, char **argv) // different SCC to stack: for (int i = n->pointers_to.Count() - 1; i >= 0; --i) { AllocationNode *target = - NS_STATIC_CAST(AllocationNode*, n->pointers_to[i]); + static_cast(n->pointers_to[i]); if (n->index != target->index) { stack.AppendElement(target); } @@ -300,7 +300,7 @@ int main(int argc, char **argv) while (stack.Count() > 0) { PRUint32 pos = stack.Count() - 1; AllocationNode *n = - NS_STATIC_CAST(AllocationNode*, stack[pos]); + static_cast(stack[pos]); stack.RemoveElementAt(pos); if (n->is_root) { @@ -402,8 +402,8 @@ int main(int argc, char **argv) printf("\nPointers from:\n"); for (PRUint32 i = 0, i_end = n->pointers_from.Count(); i != i_end; ++i) { - AllocationNode *t = NS_STATIC_CAST(AllocationNode*, - n->pointers_from[i]); + AllocationNode *t = static_cast + (n->pointers_from[i]); const ADLog::Entry *te = t->entry; printf(" %s (Object %d, ", t - nodes, te->type, t - nodes);