--- jsdtoa.c 2007-01-18 00:56:12.000000000 +0100 +++ jsdtoa.c 2008-06-19 16:34:02.000000000 +0200 @@ -247,7 +247,8 @@ #define word1(x) JSDOUBLE_LO32(x) #define set_word1(x, y) JSDOUBLE_SET_LO32(x, y) -#define Storeinc(a,b,c) (*(a)++ = (b) << 16 | (c) & 0xffff) +#define Storeinc(a,b,c) (*(a)++ = (b) << 16 | ((c) & 0xffff)) + /* #define P DBL_MANT_DIG */ /* Ten_pmax = floor(P*log(2)/log(5)) */ --- jspubtd.h 2007-06-23 01:13:21.000000000 +0200 +++ jspubtd.h 2008-06-19 16:26:08.000000000 +0200 @@ -616,7 +616,7 @@ typedef JSBool (* JS_DLL_CALLBACK JSArgumentFormatter)(JSContext *cx, const char *format, JSBool fromJS, jsval **vpp, - va_list *app); + va_list app); #endif typedef JSBool --- jsapi.c 2007-10-03 16:36:48.000000000 +0200 +++ jsapi.c 2008-06-19 17:17:52.000000000 +0200 @@ -134,7 +134,7 @@ static JSBool TryArgumentFormatter(JSContext *cx, const char **formatp, JSBool fromJS, - jsval **vpp, va_list *app) + jsval **vpp, va_list app) { const char *format; JSArgumentFormatMap *map; @@ -263,8 +263,7 @@ break; default: format--; - if (!TryArgumentFormatter(cx, &format, JS_TRUE, &sp, - JS_ADDRESSOF_VA_LIST(ap))) { + if (!TryArgumentFormatter(cx, &format, JS_TRUE, &sp, ap)) { return JS_FALSE; } /* NB: the formatter already updated sp, so we continue here. */ @@ -366,8 +365,7 @@ break; default: format--; - if (!TryArgumentFormatter(cx, &format, JS_FALSE, &sp, - JS_ADDRESSOF_VA_LIST(ap))) { + if (!TryArgumentFormatter(cx, &format, JS_FALSE, &sp, ap)) { goto bad; } /* NB: the formatter already updated sp, so we continue here. */ --- js.c 2007-04-20 20:45:18.000000000 +0200 +++ js.c 2008-06-19 18:17:29.000000000 +0200 @@ -978,7 +978,7 @@ } } } - fprintf(gOutFile, "%3u: %5u [%4u] %-8s", + fprintf(gOutFile, "%3tu: %5u [%4u] %-8s", PTRDIFF(sn, notes, jssrcnote), offset, delta, name); switch (type) { case SRC_SETLINE: --- jscntxt.h 2007-04-06 22:53:21.000000000 +0200 +++ jscntxt.h 2008-06-19 18:36:28.000000000 +0200 @@ -598,7 +598,7 @@ #define JS_PUSH_TEMP_ROOT(cx,cnt,arr,tvr) \ JS_BEGIN_MACRO \ - JS_ASSERT((ptrdiff_t)(cnt) >= 0); \ + JS_ASSERT((int)(cnt) >= 0); \ (tvr)->count = (ptrdiff_t)(cnt); \ (tvr)->u.array = (arr); \ JS_PUSH_TEMP_ROOT_COMMON(cx, tvr); \ --- jsxml.c 2007-04-19 04:18:25.000000000 +0200 +++ jsxml.c 2008-06-19 18:49:44.000000000 +0200 @@ -1058,7 +1058,10 @@ free(array->vector); vector = NULL; } else { - if ((size_t)capacity > ~(size_t)0 / sizeof(void *) || + if ( +#if JS_BITS_PER_WORD == 32 + (size_t)capacity > ~(size_t)0 / sizeof(void *) || +#endif !(vector = (void **) realloc(array->vector, capacity * sizeof(void *)))) { if (cx) @@ -1153,7 +1156,10 @@ JS_CEILING_LOG2(log2, capacity); capacity = JS_BIT(log2); } - if ((size_t)capacity > ~(size_t)0 / sizeof(void *) || + if ( +#if JS_BITS_PER_WORD == 32 + (size_t)capacity > ~(size_t)0 / sizeof(void *) || +#endif !(vector = (void **) realloc(array->vector, capacity * sizeof(void *)))) { JS_ReportOutOfMemory(cx); --- jsarray.c 2007-09-29 01:29:52.000000000 +0200 +++ jsarray.c 2008-06-19 19:12:02.000000000 +0200 @@ -1051,10 +1051,12 @@ * Check that its size does not overflow size_t, which would allow for * indexing beyond the end of the malloc'd vector. */ - if (len > ((size_t) -1) / sizeof(jsval)) { +#if JS_BITS_PER_WORD == 32 + if ((size_t)len > ~(size_t)0 / sizeof(jsval)) { JS_ReportOutOfMemory(cx); return JS_FALSE; } +#endif vec = (jsval *) JS_malloc(cx, ((size_t) len) * sizeof(jsval)); if (!vec)