bug 446320 - fixing -Wformat warnings in debug printouts. r=crowder

This commit is contained in:
Igor Bukanov 2008-07-29 16:11:36 +02:00
parent 46b8af8b1f
commit 0e9a6fa3da
3 changed files with 8 additions and 8 deletions

View File

@ -1236,7 +1236,7 @@ SrcNotes(JSContext *cx, JSScript *script)
}
}
fprintf(gOutFile, "%3u: %5u [%4u] %-8s",
PTRDIFF(sn, notes, jssrcnote), offset, delta, name);
(uintN) PTRDIFF(sn, notes, jssrcnote), offset, delta, name);
switch (type) {
case SRC_SETLINE:
fprintf(gOutFile, " lineno %u", (uintN) js_GetSrcNoteOffset(sn, 0));

View File

@ -2120,7 +2120,7 @@ js_TraceOpcode(JSContext *cx, jsint len)
JS_free(cx, bytes);
}
}
fprintf(tracefp, " @ %d\n", regs->sp - StackBase(fp));
fprintf(tracefp, " @ %u\n", (uintN) (regs->sp - StackBase(fp)));
}
fprintf(tracefp, " stack: ");
for (siter = StackBase(fp); siter < regs->sp; siter++) {
@ -2151,7 +2151,7 @@ js_TraceOpcode(JSContext *cx, jsint len)
JS_free(cx, bytes);
}
}
fprintf(tracefp, " @ %d\n", regs->sp - StackBase(fp));
fprintf(tracefp, " @ %u\n", (uintN) (regs->sp - StackBase(fp)));
}
}

View File

@ -297,7 +297,7 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
case JOF_JUMP:
case JOF_JUMPX:
off = GetJumpOffset(pc, pc);
fprintf(fp, " %u (%d)", loc + off, off);
fprintf(fp, " %u (%d)", loc + (intN) off, (intN) off);
break;
case JOF_ATOM:
@ -344,10 +344,10 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
pc2 += JUMP_OFFSET_LEN;
high = GET_JUMP_OFFSET(pc2);
pc2 += JUMP_OFFSET_LEN;
fprintf(fp, " defaultOffset %d low %d high %d", off, low, high);
fprintf(fp, " defaultOffset %d low %d high %d", (intN) off, low, high);
for (i = low; i <= high; i++) {
off = GetJumpOffset(pc, pc2);
fprintf(fp, "\n\t%d: %d", i, off);
fprintf(fp, "\n\t%d: %d", i, (intN) off);
pc2 += jmplen;
}
len = 1 + pc2 - pc;
@ -367,7 +367,7 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
pc2 += jmplen;
npairs = GET_UINT16(pc2);
pc2 += UINT16_LEN;
fprintf(fp, " offset %d npairs %u", off, (uintN) npairs);
fprintf(fp, " offset %d npairs %u", (intN) off, (uintN) npairs);
while (npairs) {
JS_GET_SCRIPT_ATOM(script, GET_INDEX(pc2), atom);
pc2 += INDEX_LEN;
@ -377,7 +377,7 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
bytes = ToDisassemblySource(cx, ATOM_KEY(atom));
if (!bytes)
return 0;
fprintf(fp, "\n\t%s: %d", bytes, off);
fprintf(fp, "\n\t%s: %d", bytes, (intN) off);
npairs--;
}
len = 1 + pc2 - pc;