Fix build warnings by using character literals. b=183354 r=smontagu sr=bzbarsky

This commit is contained in:
dbaron%dbaron.org 2003-04-09 21:13:23 +00:00
Родитель 70948e2ef5
Коммит 655e594112
1 изменённых файлов: 12 добавлений и 12 удалений

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

@ -125,32 +125,32 @@ void nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen)
if (aLen > 3)
switch (aBuf[0])
{
case 0xEF:
if ((0xBB == aBuf[1]) && (0xBF == aBuf[2]))
case '\xEF':
if (('\xBB' == aBuf[1]) && ('\xBF' == aBuf[2]))
// EF BB BF UTF-8 encoded BOM
mDetectedCharset = "UTF-8";
break;
case 0xFE:
if ((0xFF == aBuf[1]) && (0x00 == aBuf[2]) && (0x00 == aBuf[3]))
case '\xFE':
if (('\xFF' == aBuf[1]) && ('\x00' == aBuf[2]) && ('\x00' == aBuf[3]))
// FE FF 00 00 UCS-4, unusual octet order BOM (3412)
mDetectedCharset = "X-ISO-10646-UCS-4-3412";
else if (0xFF == aBuf[1])
else if ('\xFF' == aBuf[1])
// FE FF UTF-16, big endian BOM
mDetectedCharset = "UTF-16BE";
break;
case 0x00:
if ((0x00 == aBuf[1]) && (0xFE == aBuf[2]) && (0xFF == aBuf[3]))
case '\x00':
if (('\x00' == aBuf[1]) && ('\xFE' == aBuf[2]) && ('\xFF' == aBuf[3]))
// 00 00 FE FF UTF-32, big-endian BOM
mDetectedCharset = "UTF-32BE";
else if ((0x00 == aBuf[1]) && (0xFF == aBuf[2]) && (0xFE == aBuf[3]))
else if (('\x00' == aBuf[1]) && ('\xFF' == aBuf[2]) && ('\xFE' == aBuf[3]))
// 00 00 FF FE UCS-4, unusual octet order BOM (2143)
mDetectedCharset = "X-ISO-10646-UCS-4-2143";
break;
case 0xFF:
if ((0xFE == aBuf[1]) && (0x00 == aBuf[2]) && (0x00 == aBuf[3]))
case '\xFF':
if (('\xFE' == aBuf[1]) && ('\x00' == aBuf[2]) && ('\x00' == aBuf[3]))
// FF FE 00 00 UTF-32, little-endian BOM
mDetectedCharset = "UTF-32LE";
else if (0xFE == aBuf[1])
else if ('\xFE' == aBuf[1])
// FF FE UTF-16, little endian BOM
mDetectedCharset = "UTF-16LE";
break;
@ -167,7 +167,7 @@ void nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen)
for (i = 0; i < aLen; i++)
{
//other than 0xa0, if every othe character is ascii, the page is ascii
if (aBuf[i] & 0x80 && aBuf[i] != (char)0xA0) //Since many Ascii only page contains NBSP
if (aBuf[i] & '\x80' && aBuf[i] != '\xA0') //Since many Ascii only page contains NBSP
{
//we got a non-ascii byte (high-byte)
if (mInputState != eHighbyte)