Bug 553032 - use PRIuSIZE rather than %z in js; r?evilpie draft
authorTom Tromey <tom@tromey.com>
Fri, 14 Oct 2016 07:59:03 -0600
changeset 428053 aa8662aaddf0d7cd3e4f94e0608bdfbd6c65a0b9
parent 428052 8b9d0291f8119c708219cf42681bf43dc66ededc
child 534647 715bf10fb51e12fb33995c8633ce15a7506048db
push id33217
push userbmo:ttromey@mozilla.com
push dateFri, 21 Oct 2016 14:02:14 +0000
reviewersevilpie
bugs553032
milestone52.0a1
Bug 553032 - use PRIuSIZE rather than %z in js; r?evilpie MozReview-Commit-ID: JqiWVZZOY7h
js/src/asmjs/WasmBinary.cpp
js/src/gc/Verifier.cpp
js/src/vm/String.cpp
--- a/js/src/asmjs/WasmBinary.cpp
+++ b/js/src/asmjs/WasmBinary.cpp
@@ -36,17 +36,18 @@ Decoder::fail(const char* msg, ...) {
         return false;
 
     return fail(Move(str));
 }
 
 bool
 Decoder::fail(UniqueChars msg) {
     MOZ_ASSERT(error_);
-    UniqueChars strWithOffset(JS_smprintf("at offset %zu: %s", currentOffset(), msg.get()));
+    UniqueChars strWithOffset(JS_smprintf("at offset %" PRIuSIZE ": %s",
+                                          currentOffset(), msg.get()));
     if (!strWithOffset)
         return false;
 
     *error_ = Move(strWithOffset);
     return false;
 }
 
 bool
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -530,17 +530,17 @@ CheckHeapTracer::check(AutoLockForExclus
             stack.back().processed = true;
         }
     }
 
     if (oom)
         return;
 
     if (failures) {
-        fprintf(stderr, "Heap check: %zu failure(s) out of %" PRIu32 " pointers checked\n",
+        fprintf(stderr, "Heap check: %" PRIuSIZE " failure(s) out of %" PRIu32 " pointers checked\n",
                 failures, visited.count());
     }
     MOZ_RELEASE_ASSERT(failures == 0);
 }
 
 void
 js::gc::CheckHeapAfterGC(JSRuntime* rt)
 {
--- a/js/src/vm/String.cpp
+++ b/js/src/vm/String.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "vm/String-inl.h"
 
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/RangedPtr.h"
+#include "mozilla/SizePrintfMacros.h"
 #include "mozilla/TypeTraits.h"
 #include "mozilla/Unused.h"
 
 #include "gc/Marking.h"
 #include "js/UbiNode.h"
 #include "vm/SPSProfiler.h"
 
 #include "jscntxtinlines.h"
@@ -182,17 +183,17 @@ JSString::dumpRepresentation(FILE* fp, i
 }
 
 void
 JSString::dumpRepresentationHeader(FILE* fp, int indent, const char* subclass) const
 {
     uint32_t flags = d.u1.flags;
     // Print the string's address as an actual C++ expression, to facilitate
     // copy-and-paste into a debugger.
-    fprintf(fp, "((%s*) %p) length: %zu  flags: 0x%x", subclass, this, length(), flags);
+    fprintf(fp, "((%s*) %p) length: %" PRIuSIZE "  flags: 0x%x", subclass, this, length(), flags);
     if (flags & FLAT_BIT)               fputs(" FLAT", fp);
     if (flags & HAS_BASE_BIT)           fputs(" HAS_BASE", fp);
     if (flags & INLINE_CHARS_BIT)       fputs(" INLINE_CHARS", fp);
     if (flags & ATOM_BIT)               fputs(" ATOM", fp);
     if (isPermanentAtom())              fputs(" PERMANENT", fp);
     if (flags & LATIN1_CHARS_BIT)       fputs(" LATIN1", fp);
     fputc('\n', fp);
 }
@@ -698,17 +699,17 @@ JSDependentString::undepend(ExclusiveCon
 
 #ifdef DEBUG
 void
 JSDependentString::dumpRepresentation(FILE* fp, int indent) const
 {
     dumpRepresentationHeader(fp, indent, "JSDependentString");
     indent += 2;
 
-    fprintf(fp, "%*soffset: %zu\n", indent, "", baseOffset());
+    fprintf(fp, "%*soffset: %" PRIuSIZE "\n", indent, "", baseOffset());
     fprintf(fp, "%*sbase: ", indent, "");
     base()->dumpRepresentation(fp, indent);
 }
 #endif
 
 template <typename CharT>
 /* static */ bool
 JSFlatString::isIndexSlow(const CharT* s, size_t length, uint32_t* indexp)
@@ -1358,17 +1359,17 @@ NewStringCopyUTF8N<CanGC>(JSContext* cx,
 
 #ifdef DEBUG
 void
 JSExtensibleString::dumpRepresentation(FILE* fp, int indent) const
 {
     dumpRepresentationHeader(fp, indent, "JSExtensibleString");
     indent += 2;
 
-    fprintf(fp, "%*scapacity: %zu\n", indent, "", capacity());
+    fprintf(fp, "%*scapacity: %" PRIuSIZE "\n", indent, "", capacity());
     dumpRepresentationChars(fp, indent);
 }
 
 void
 JSInlineString::dumpRepresentation(FILE* fp, int indent) const
 {
     dumpRepresentationHeader(fp, indent,
                              isFatInline() ? "JSFatInlineString" : "JSThinInlineString");