mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r26842) -Codechange [Squirrel]: other simple cases of non-initialised instance variables
This commit is contained in:
parent
a1d4148be5
commit
3c85109c49
3
src/3rdparty/squirrel/squirrel/sqopcodes.h
vendored
3
src/3rdparty/squirrel/squirrel/sqopcodes.h
vendored
@ -92,8 +92,7 @@ struct SQInstructionDesc {
|
||||
|
||||
struct SQInstruction
|
||||
{
|
||||
SQInstruction(){};
|
||||
SQInstruction(SQOpcode _op,SQInteger a0=0,SQInteger a1=0,SQInteger a2=0,SQInteger a3=0)
|
||||
SQInstruction(SQOpcode _op=_OP_SCOPE_END,SQInteger a0=0,SQInteger a1=0,SQInteger a2=0,SQInteger a3=0)
|
||||
{ op = _op;
|
||||
_arg0 = (unsigned char)a0;_arg1 = (SQInt32)a1;
|
||||
_arg2 = (unsigned char)a2;_arg3 = (unsigned char)a3;
|
||||
|
7
src/3rdparty/squirrel/squirrel/squserdata.h
vendored
7
src/3rdparty/squirrel/squirrel/squserdata.h
vendored
@ -4,7 +4,8 @@
|
||||
|
||||
struct SQUserData : SQDelegable
|
||||
{
|
||||
SQUserData(SQSharedState *ss){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); }
|
||||
SQUserData(SQSharedState *ss, SQInteger size){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); _size = size; _typetag = 0;
|
||||
}
|
||||
~SQUserData()
|
||||
{
|
||||
REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain, this);
|
||||
@ -13,9 +14,7 @@ struct SQUserData : SQDelegable
|
||||
static SQUserData* Create(SQSharedState *ss, SQInteger size)
|
||||
{
|
||||
SQUserData* ud = (SQUserData*)SQ_MALLOC(sizeof(SQUserData)+(size-1));
|
||||
new (ud) SQUserData(ss);
|
||||
ud->_size = size;
|
||||
ud->_typetag = 0;
|
||||
new (ud) SQUserData(ss, size);
|
||||
return ud;
|
||||
}
|
||||
#ifndef NO_GARBAGE_COLLECTOR
|
||||
|
5
src/3rdparty/squirrel/squirrel/sqvm.cpp
vendored
5
src/3rdparty/squirrel/squirrel/sqvm.cpp
vendored
@ -115,6 +115,11 @@ SQVM::SQVM(SQSharedState *ss)
|
||||
_can_suspend = false;
|
||||
_in_stackoverflow = false;
|
||||
_ops_till_suspend = 0;
|
||||
_callsstack = NULL;
|
||||
_callsstacksize = 0;
|
||||
_alloccallsstacksize = 0;
|
||||
_top = 0;
|
||||
_stackbase = 0;
|
||||
ci = NULL;
|
||||
INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user