Bug 414963 - "C++ warnings in jsnum.c, jsutil.c (with g++ -Wconversion)" [p=jorendorff@mozilla.com (Jason Orendorff) r+a1.9=brendan]

This commit is contained in:
reed@reedloden.com 2008-02-06 13:34:51 -08:00
parent 002c33c141
commit 7bdc6558bd
2 changed files with 3 additions and 3 deletions

View File

@ -778,7 +778,7 @@ js_DoubleToECMAInt32(jsdouble d)
d = fmod(d, two32);
d = (d >= 0) ? floor(d) : ceil(d) + two32;
return (int32) (d >= two31) ? (d - two32) : d;
return (int32) (d >= two31 ? d - two32 : d);
}
JSBool
@ -807,7 +807,7 @@ js_DoubleToECMAUint32(jsdouble d)
d = fmod(d, two32);
return (uint32) (d >= 0) ? d : d + two32;
return (uint32) (d >= 0 ? d : d + two32);
}
JSBool

View File

@ -198,7 +198,7 @@ JS_DumpHistogram(JSBasicStats *bs, FILE *fp)
fprintf(fp, "%s %8u ", (bin == 10) ? "+" : ":", cnt);
if (cnt != 0) {
if (max > 1e6 && mean > 1e3)
cnt = ceil(log10(cnt));
cnt = (uint32) ceil(log10(cnt));
else if (max > 16 && mean > 8)
cnt = JS_CeilingLog2(cnt);
for (i = 0; i < cnt; i++)