Bug 384244 - Updating dtoa from David M. Gay's latest code, and refactoring to

accept patches from this upstream source more easily. r=mrbkap, r=igor
This commit is contained in:
Brian Crowder 2008-07-24 12:43:41 -07:00
Родитель 2355faa1e9
Коммит 9088022ac6
5 изменённых файлов: 3459 добавлений и 2733 удалений

3332
js/src/dtoa.c Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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))

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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

Просмотреть файл

@ -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) {
/*