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:
2
src/3rdparty/squirrel/include/squirrel.h
vendored
2
src/3rdparty/squirrel/include/squirrel.h
vendored
@@ -179,7 +179,7 @@ typedef void (*SQPRINTFUNCTION)(HSQUIRRELVM,const std::string &);
|
||||
typedef SQInteger (*SQWRITEFUNC)(SQUserPointer,SQUserPointer,SQInteger);
|
||||
typedef SQInteger (*SQREADFUNC)(SQUserPointer,SQUserPointer,SQInteger);
|
||||
|
||||
typedef WChar (*SQLEXREADFUNC)(SQUserPointer);
|
||||
typedef char32_t (*SQLEXREADFUNC)(SQUserPointer);
|
||||
|
||||
typedef struct tagSQRegFunction{
|
||||
const SQChar *name;
|
||||
|
6
src/3rdparty/squirrel/squirrel/sqapi.cpp
vendored
6
src/3rdparty/squirrel/squirrel/sqapi.cpp
vendored
@@ -1259,9 +1259,9 @@ struct BufState{
|
||||
SQInteger size;
|
||||
};
|
||||
|
||||
WChar buf_lexfeed(SQUserPointer file)
|
||||
char32_t buf_lexfeed(SQUserPointer file)
|
||||
{
|
||||
/* Convert an UTF-8 character into a WChar */
|
||||
/* Convert an UTF-8 character into a char32_t */
|
||||
BufState *buf = (BufState *)file;
|
||||
const char *p = &buf->buf[buf->ptr];
|
||||
|
||||
@@ -1279,7 +1279,7 @@ WChar buf_lexfeed(SQUserPointer file)
|
||||
buf->ptr += len;
|
||||
|
||||
/* Convert the character, and when definitely invalid, bail out as well. */
|
||||
WChar c;
|
||||
char32_t c;
|
||||
if (Utf8Decode(&c, p) != len) return -1;
|
||||
|
||||
return c;
|
||||
|
6
src/3rdparty/squirrel/squirrel/sqlexer.cpp
vendored
6
src/3rdparty/squirrel/squirrel/sqlexer.cpp
vendored
@@ -26,7 +26,7 @@ SQLexer::~SQLexer()
|
||||
_keywords->Release();
|
||||
}
|
||||
|
||||
void SQLexer::APPEND_CHAR(WChar c)
|
||||
void SQLexer::APPEND_CHAR(char32_t c)
|
||||
{
|
||||
char buf[4];
|
||||
size_t chars = Utf8Encode(buf, c);
|
||||
@@ -101,7 +101,7 @@ NORETURN void SQLexer::Error(const SQChar *err)
|
||||
|
||||
void SQLexer::Next()
|
||||
{
|
||||
WChar t = _readf(_up);
|
||||
char32_t t = _readf(_up);
|
||||
if(t > MAX_CHAR) Error("Invalid character");
|
||||
if(t != 0) {
|
||||
_currdata = t;
|
||||
@@ -287,7 +287,7 @@ SQInteger SQLexer::GetIDType(SQChar *s)
|
||||
}
|
||||
|
||||
|
||||
SQInteger SQLexer::ReadString(WChar ndelim,bool verbatim)
|
||||
SQInteger SQLexer::ReadString(char32_t ndelim,bool verbatim)
|
||||
{
|
||||
INIT_TEMP_STRING();
|
||||
NEXT();
|
||||
|
6
src/3rdparty/squirrel/squirrel/sqlexer.h
vendored
6
src/3rdparty/squirrel/squirrel/sqlexer.h
vendored
@@ -11,7 +11,7 @@ struct SQLexer
|
||||
const SQChar *Tok2Str(SQInteger tok);
|
||||
private:
|
||||
SQInteger GetIDType(SQChar *s);
|
||||
SQInteger ReadString(WChar ndelim,bool verbatim);
|
||||
SQInteger ReadString(char32_t ndelim,bool verbatim);
|
||||
SQInteger ReadNumber();
|
||||
void LexBlockComment();
|
||||
SQInteger ReadID();
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
SQInteger _curtoken;
|
||||
SQTable *_keywords;
|
||||
void INIT_TEMP_STRING() { _longstr.resize(0); }
|
||||
void APPEND_CHAR(WChar c);
|
||||
void APPEND_CHAR(char32_t c);
|
||||
void TERMINATE_BUFFER() { _longstr.push_back('\0'); }
|
||||
|
||||
public:
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
SQFloat _fvalue;
|
||||
SQLEXREADFUNC _readf;
|
||||
SQUserPointer _up;
|
||||
WChar _currdata;
|
||||
char32_t _currdata;
|
||||
SQSharedState *_sharedstate;
|
||||
sqvector<SQChar> _longstr;
|
||||
CompilerErrorFunc _errfunc;
|
||||
|
Reference in New Issue
Block a user