зеркало из 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];
|
char pattern[20];
|
||||||
const char *dolPt = NULL; /* in "%4$.2f", dolPt will poiont to . */
|
const char *dolPt = NULL; /* in "%4$.2f", dolPt will poiont to . */
|
||||||
#ifdef JS_C_STRINGS_ARE_UTF8
|
#ifdef JS_C_STRINGS_ARE_UTF8
|
||||||
char utf8buf[6];
|
uint8 utf8buf[6];
|
||||||
int utf8len;
|
int utf8len;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ static int dosprintf(SprintfState *ss, const char *fmt, va_list ap)
|
||||||
#ifdef JS_C_STRINGS_ARE_UTF8
|
#ifdef JS_C_STRINGS_ARE_UTF8
|
||||||
u.wch = va_arg(ap, int);
|
u.wch = va_arg(ap, int);
|
||||||
utf8len = js_OneUcs4ToUtf8Char (utf8buf, u.wch);
|
utf8len = js_OneUcs4ToUtf8Char (utf8buf, u.wch);
|
||||||
rv = (*ss->stuff)(ss, utf8buf, utf8len);
|
rv = (*ss->stuff)(ss, (char *)utf8buf, utf8len);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case TYPE_INTN:
|
case TYPE_INTN:
|
||||||
|
|
|
@ -2838,7 +2838,7 @@ js_DeflateString(JSContext *cx, const jschar *chars, size_t length)
|
||||||
size_t size;
|
size_t size;
|
||||||
char *bytes;
|
char *bytes;
|
||||||
|
|
||||||
size = js_GetDeflatedStringLength(chars, length);
|
size = js_GetDeflatedStringLength(cx, chars, length);
|
||||||
if (size == (size_t)-1)
|
if (size == (size_t)-1)
|
||||||
return NULL;
|
return NULL;
|
||||||
bytes = (char *) (cx ? JS_malloc(cx, size+1) : malloc(size+1));
|
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)
|
if ((src[j] & 0xC0) != 0x80)
|
||||||
goto badCharacter;
|
goto badCharacter;
|
||||||
}
|
}
|
||||||
v = Utf8ToOneUcs4Char(src, n);
|
v = Utf8ToOneUcs4Char((uint8 *)src, n);
|
||||||
if (v >= 0x10000) {
|
if (v >= 0x10000) {
|
||||||
v -= 0x10000;
|
v -= 0x10000;
|
||||||
if (v > 0xFFFFF || dstlen < 2) {
|
if (v > 0xFFFFF || dstlen < 2) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче