diff options
-rw-r--r-- | src/3rdparty/squirrel/include/squirrel.h | 4 | ||||
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqapi.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqlexer.cpp | 12 | ||||
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqlexer.h | 8 | ||||
-rw-r--r-- | src/script/squirrel.cpp | 16 |
5 files changed, 21 insertions, 21 deletions
diff --git a/src/3rdparty/squirrel/include/squirrel.h b/src/3rdparty/squirrel/include/squirrel.h index b71de1473..adb2390fc 100644 --- a/src/3rdparty/squirrel/include/squirrel.h +++ b/src/3rdparty/squirrel/include/squirrel.h @@ -31,6 +31,8 @@ to the following restrictions: #ifndef _SQUIRREL_H_ #define _SQUIRREL_H_ +#include "../../../string_type.h" + typedef __int64 SQInteger; typedef unsigned __int64 SQUnsignedInteger; typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/ @@ -178,7 +180,7 @@ typedef void (*SQPRINTFUNCTION)(HSQUIRRELVM,const SQChar * ,...); typedef SQInteger (*SQWRITEFUNC)(SQUserPointer,SQUserPointer,SQInteger); typedef SQInteger (*SQREADFUNC)(SQUserPointer,SQUserPointer,SQInteger); -typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer); +typedef WChar (*SQLEXREADFUNC)(SQUserPointer); typedef struct tagSQRegFunction{ const SQChar *name; diff --git a/src/3rdparty/squirrel/squirrel/sqapi.cpp b/src/3rdparty/squirrel/squirrel/sqapi.cpp index 179df117f..a1c91e567 100644 --- a/src/3rdparty/squirrel/squirrel/sqapi.cpp +++ b/src/3rdparty/squirrel/squirrel/sqapi.cpp @@ -1264,7 +1264,7 @@ struct BufState{ SQInteger size; }; -SQInteger buf_lexfeed(SQUserPointer file) +WChar buf_lexfeed(SQUserPointer file) { BufState *buf=(BufState*)file; if(buf->size<(buf->ptr+1)) diff --git a/src/3rdparty/squirrel/squirrel/sqlexer.cpp b/src/3rdparty/squirrel/squirrel/sqlexer.cpp index 286963db4..902427bbf 100644 --- a/src/3rdparty/squirrel/squirrel/sqlexer.cpp +++ b/src/3rdparty/squirrel/squirrel/sqlexer.cpp @@ -27,11 +27,11 @@ SQLexer::~SQLexer() _keywords->Release(); } -void SQLexer::APPEND_CHAR(LexChar c) +void SQLexer::APPEND_CHAR(WChar c) { char buf[4]; - int chars = Utf8Encode(buf, c); - for (int i = 0; i < chars; i++) { + size_t chars = Utf8Encode(buf, c); + for (size_t i = 0; i < chars; i++) { _longstr.push_back(buf[i]); } } @@ -96,10 +96,10 @@ void SQLexer::Error(const SQChar *err) void SQLexer::Next() { - SQInteger t = _readf(_up); + WChar t = _readf(_up); if(t > MAX_CHAR) Error("Invalid character"); if(t != 0) { - _currdata = (LexChar)t; + _currdata = t; return; } _currdata = SQUIRREL_EOB; @@ -285,7 +285,7 @@ SQInteger SQLexer::GetIDType(SQChar *s) } -SQInteger SQLexer::ReadString(LexChar ndelim,bool verbatim) +SQInteger SQLexer::ReadString(WChar ndelim,bool verbatim) { INIT_TEMP_STRING(); NEXT(); diff --git a/src/3rdparty/squirrel/squirrel/sqlexer.h b/src/3rdparty/squirrel/squirrel/sqlexer.h index 7145dce90..5600b5f0e 100644 --- a/src/3rdparty/squirrel/squirrel/sqlexer.h +++ b/src/3rdparty/squirrel/squirrel/sqlexer.h @@ -2,8 +2,6 @@ #ifndef _SQLEXER_H_ #define _SQLEXER_H_ -typedef unsigned short LexChar; - struct SQLexer { SQLexer(); @@ -14,7 +12,7 @@ struct SQLexer const SQChar *Tok2Str(SQInteger tok); private: SQInteger GetIDType(SQChar *s); - SQInteger ReadString(LexChar ndelim,bool verbatim); + SQInteger ReadString(WChar ndelim,bool verbatim); SQInteger ReadNumber(); void LexBlockComment(); SQInteger ReadID(); @@ -22,7 +20,7 @@ private: SQInteger _curtoken; SQTable *_keywords; void INIT_TEMP_STRING() { _longstr.resize(0); } - void APPEND_CHAR(LexChar c); + void APPEND_CHAR(WChar c); void TERMINATE_BUFFER() { _longstr.push_back('\0'); } public: @@ -35,7 +33,7 @@ public: SQFloat _fvalue; SQLEXREADFUNC _readf; SQUserPointer _up; - LexChar _currdata; + WChar _currdata; SQSharedState *_sharedstate; sqvector<SQChar> _longstr; CompilerErrorFunc _errfunc; diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 7697edd24..ae8b9b03a 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -380,14 +380,14 @@ public: } }; -static SQInteger _io_file_lexfeed_ASCII(SQUserPointer file) +static WChar _io_file_lexfeed_ASCII(SQUserPointer file) { char c; if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) return c; return 0; } -static SQInteger _io_file_lexfeed_UTF8(SQUserPointer file) +static WChar _io_file_lexfeed_UTF8(SQUserPointer file) { static const SQInteger utf8_lengths[16] = { @@ -399,7 +399,7 @@ static SQInteger _io_file_lexfeed_UTF8(SQUserPointer file) }; static unsigned char byte_masks[5] = {0, 0, 0x1F, 0x0F, 0x07}; unsigned char inchar; - SQInteger c = 0; + WChar c = 0; if (((SQFile *)file)->Read(&inchar, sizeof(inchar), 1) != 1) return 0; c = inchar; @@ -419,19 +419,19 @@ static SQInteger _io_file_lexfeed_UTF8(SQUserPointer file) return c; } -static SQInteger _io_file_lexfeed_UCS2_no_swap(SQUserPointer file) +static WChar _io_file_lexfeed_UCS2_no_swap(SQUserPointer file) { - wchar_t c; - if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) return (SQChar)c; + unsigned short c; + if (((SQFile *)file)->Read(&c, sizeof(c), 1) > 0) return (WChar)c; return 0; } -static SQInteger _io_file_lexfeed_UCS2_swap(SQUserPointer file) +static WChar _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 (SQChar)c; + return (WChar)c; } return 0; } |