@@ -598,14 +598,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static WChar _io_file_lexfeed_ASCII(SQUserPointer file)
|
||||
static char32_t _io_file_lexfeed_ASCII(SQUserPointer file)
|
||||
{
|
||||
unsigned char c;
|
||||
if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) return c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static WChar _io_file_lexfeed_UTF8(SQUserPointer file)
|
||||
static char32_t _io_file_lexfeed_UTF8(SQUserPointer file)
|
||||
{
|
||||
char buffer[5];
|
||||
|
||||
@@ -618,25 +618,25 @@ static WChar _io_file_lexfeed_UTF8(SQUserPointer file)
|
||||
if (len > 1 && ((SQFile *)file)->Read(buffer + 1, sizeof(buffer[0]), len - 1) != len - 1) return 0;
|
||||
|
||||
/* Convert the character, and when definitely invalid, bail out as well. */
|
||||
WChar c;
|
||||
char32_t c;
|
||||
if (Utf8Decode(&c, buffer) != len) return -1;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
static WChar _io_file_lexfeed_UCS2_no_swap(SQUserPointer file)
|
||||
static char32_t _io_file_lexfeed_UCS2_no_swap(SQUserPointer file)
|
||||
{
|
||||
unsigned short c;
|
||||
if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) return (WChar)c;
|
||||
if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) return (char32_t)c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static WChar _io_file_lexfeed_UCS2_swap(SQUserPointer file)
|
||||
static char32_t _io_file_lexfeed_UCS2_swap(SQUserPointer file)
|
||||
{
|
||||
unsigned short c;
|
||||
if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) {
|
||||
c = ((c >> 8) & 0x00FF)| ((c << 8) & 0xFF00);
|
||||
return (WChar)c;
|
||||
return (char32_t)c;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user