зеркало из https://github.com/mozilla/pjs.git
bug 446320 - fixing -Wformat warnings in debug printf code. r=crowder
This commit is contained in:
Родитель
52458c03ad
Коммит
5ceb3a1b67
|
@ -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));
|
||||
|
|
|
@ -741,6 +741,8 @@ JS_NewRuntime(uint32 maxbytes)
|
|||
JS_INIT_CLIST(&rt->trapList);
|
||||
JS_INIT_CLIST(&rt->watchPointList);
|
||||
|
||||
if (!js_InitDtoa())
|
||||
goto bad;
|
||||
if (!js_InitGC(rt, maxbytes))
|
||||
goto bad;
|
||||
if (!js_InitAtomState(rt))
|
||||
|
|
2841
js/src/jsdtoa.cpp
2841
js/src/jsdtoa.cpp
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -123,7 +123,8 @@ JS_dtobasestr(int base, double d);
|
|||
* Clean up any persistent RAM allocated during the execution of DtoA
|
||||
* routines, and remove any locks that might have been created.
|
||||
*/
|
||||
extern void js_FinishDtoa(void);
|
||||
JS_FRIEND_API(JSBool) js_InitDtoa(void);
|
||||
JS_FRIEND_API(void) js_FinishDtoa(void);
|
||||
|
||||
JS_END_EXTERN_C
|
||||
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1015,18 +1015,10 @@ js_strtod(JSContext *cx, const jschar *s, const jschar *send,
|
|||
} else {
|
||||
int err;
|
||||
d = JS_strtod(cstr, &estr, &err);
|
||||
if (err == JS_DTOA_ENOMEM) {
|
||||
JS_ReportOutOfMemory(cx);
|
||||
if (cstr != cbuf)
|
||||
JS_free(cx, cstr);
|
||||
return JS_FALSE;
|
||||
}
|
||||
if (err == JS_DTOA_ERANGE) {
|
||||
if (d == HUGE_VAL)
|
||||
d = *cx->runtime->jsPositiveInfinity;
|
||||
else if (d == -HUGE_VAL)
|
||||
d = *cx->runtime->jsNegativeInfinity;
|
||||
}
|
||||
if (d == HUGE_VAL)
|
||||
d = *cx->runtime->jsPositiveInfinity;
|
||||
else if (d == -HUGE_VAL)
|
||||
d = *cx->runtime->jsNegativeInfinity;
|
||||
#ifdef HPUX
|
||||
if (d == 0.0 && negative) {
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче