зеркало из https://github.com/mozilla/pjs.git
Bug 366725: Fixing compilation problems with JS_C_STRINGS_ARE_UTF8 defined.
This commit is contained in:
Родитель
36c53ba745
Коммит
36850b18be
|
@ -707,7 +707,7 @@ static int dosprintf(SprintfState *ss, const char *fmt, va_list ap)
|
|||
char pattern[20];
|
||||
const char *dolPt = NULL; /* in "%4$.2f", dolPt will poiont to . */
|
||||
#ifdef JS_C_STRINGS_ARE_UTF8
|
||||
char utf8buf[6];
|
||||
uint8 utf8buf[6];
|
||||
int utf8len;
|
||||
#endif
|
||||
|
||||
|
@ -950,7 +950,7 @@ static int dosprintf(SprintfState *ss, const char *fmt, va_list ap)
|
|||
#ifdef JS_C_STRINGS_ARE_UTF8
|
||||
u.wch = va_arg(ap, int);
|
||||
utf8len = js_OneUcs4ToUtf8Char (utf8buf, u.wch);
|
||||
rv = (*ss->stuff)(ss, utf8buf, utf8len);
|
||||
rv = (*ss->stuff)(ss, (char *)utf8buf, utf8len);
|
||||
break;
|
||||
#endif
|
||||
case TYPE_INTN:
|
||||
|
|
|
@ -2838,7 +2838,7 @@ js_DeflateString(JSContext *cx, const jschar *chars, size_t length)
|
|||
size_t size;
|
||||
char *bytes;
|
||||
|
||||
size = js_GetDeflatedStringLength(chars, length);
|
||||
size = js_GetDeflatedStringLength(cx, chars, length);
|
||||
if (size == (size_t)-1)
|
||||
return NULL;
|
||||
bytes = (char *) (cx ? JS_malloc(cx, size+1) : malloc(size+1));
|
||||
|
@ -2978,7 +2978,7 @@ js_InflateStringToBuffer(JSContext *cx, const char *src, size_t srclen,
|
|||
if ((src[j] & 0xC0) != 0x80)
|
||||
goto badCharacter;
|
||||
}
|
||||
v = Utf8ToOneUcs4Char(src, n);
|
||||
v = Utf8ToOneUcs4Char((uint8 *)src, n);
|
||||
if (v >= 0x10000) {
|
||||
v -= 0x10000;
|
||||
if (v > 0xFFFFF || dstlen < 2) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче