Bug 331743 patch 5: Fix -Wformat warnings in leaksoup.cpp related to 32-bit vs. 64-bit sizes. r=khuey
authorL. David Baron <dbaron@dbaron.org>
Wed, 26 Feb 2014 13:36:36 -0800
changeset 171074 cb1eb32b89d86d78b7326f416cf404548c5e0099
parent 171073 343851681bc0c61215315cd863f1949648eed369
child 171075 221426a61d0f5c654f55a6e8e25981309765638c
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerskhuey
bugs331743
milestone30.0a1
Bug 331743 patch 5: Fix -Wformat warnings in leaksoup.cpp related to 32-bit vs. 64-bit sizes. r=khuey
tools/trace-malloc/leaksoup.cpp
--- a/tools/trace-malloc/leaksoup.cpp
+++ b/tools/trace-malloc/leaksoup.cpp
@@ -296,17 +296,17 @@ int main(int argc, char **argv)
                "<head>\n"
                "<title>Leak analysis</title>\n"
                "<style type=\"text/css\">\n"
                "  .root { background: white; color: black; }\n"
                "  .nonroot { background: #ccc; color: black; }\n"
                "</style>\n"
                "</head>\n");
         printf("<body>\n\n"
-               "<p>Generated %d entries (%d in root SCCs) and %d SCCs.</p>\n\n",
+               "<p>Generated %zd entries (%d in root SCCs) and %d SCCs.</p>\n\n",
                count, num_root_nodes, num_sccs);
 
         for (size_t i = 0; i < count; ++i) {
             nodes[i].reached = false;
         }
 
         // Loop over the sorted nodes twice, first printing the roots
         // and then the non-roots.
@@ -337,32 +337,32 @@ int main(int argc, char **argv)
                         sn + 1 == sn_end || (*(sn+1))->index != component;
                     if (!one_object_component)
                         printf("\n\n<h2 id=\"c%d\">Component %d</h2>\n",
                                component, component);
                 }
 
                 if (one_object_component) {
                     printf("\n\n<div id=\"c%d\">\n", component);
-                    printf("<h2 id=\"o%d\">Object %d "
+                    printf("<h2 id=\"o%td\">Object %td "
                            "(single-object component %d)</h2>\n",
                            n-nodes, n-nodes, component);
                 } else {
-                    printf("\n\n<h3 id=\"o%d\">Object %d</h3>\n",
+                    printf("\n\n<h3 id=\"o%td\">Object %td</h3>\n",
                            n-nodes, n-nodes);
                 }
                 printf("<pre>\n");
-                printf("%p &lt;%s&gt; (%d)\n",
+                printf("%p &lt;%s&gt; (%zd)\n",
                        e->address, e->type, e->datasize);
                 for (size_t d = 0; d < e->datasize;
                      d += sizeof(ADLog::Pointer)) {
                     AllocationNode *target = (AllocationNode*)
                         PL_HashTableLookup(memory_map, *(void**)(e->data + d));
                     if (target) {
-                        printf("        <a href=\"#o%d\">",
+                        printf("        <a href=\"#o%td\">",
                                target - nodes);
                         printf(allocation_format,
                                *(size_t*)(e->data + d));
                         printf("</a> &lt;%s&gt;",
                                target->entry->type);
                         if (target->index != n->index) {
                             printf(", component %d", target->index);
                         }
@@ -376,17 +376,17 @@ int main(int argc, char **argv)
                 }
 
                 if (n->pointers_from.Length()) {
                     printf("\nPointers from:\n");
                     for (uint32_t i = 0, i_end = n->pointers_from.Length();
                          i != i_end; ++i) {
                         AllocationNode *t = n->pointers_from[i];
                         const ADLog::Entry *te = t->entry;
-                        printf("    <a href=\"#o%d\">%s</a> (Object %d, ",
+                        printf("    <a href=\"#o%td\">%s</a> (Object %td, ",
                                t - nodes, te->type, t - nodes);
                         if (t->index != n->index) {
                             printf("component %d, ", t->index);
                         }
                         if (t == n) {
                             printf("self)\n");
                         } else {
                             printf("%p)\n", te->address);