Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -568,14 +568,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];
|
||||
|
||||
@@ -588,25 +588,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