Changeset - r27972:6274f9a95a32
[Not reviewed]
master
0 7 0
Peter Nelson - 14 months ago 2023-09-25 12:02:51
peter1138@openttd.org
Codechange: Add missing override specifiers to squirrel.
7 files changed with 22 insertions and 22 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/sqclass.h
Show inline comments
 
@@ -52,19 +52,19 @@ public:
 
		}
 
		return false;
 
	}
 
	bool SetAttributes(const SQObjectPtr &key,const SQObjectPtr &val);
 
	bool GetAttributes(const SQObjectPtr &key,SQObjectPtr &outval);
 
	void Lock() { _locked = true; if(_base) _base->Lock(); }
 
	void Release() {
 
	void Release() override {
 
		if (_hook) { _hook(_typetag,0);}
 
		sq_delete(this, SQClass);
 
	}
 
	void Finalize();
 
	void Finalize() override;
 
#ifndef NO_GARBAGE_COLLECTOR
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
 
#endif
 
	SQInteger Next(const SQObjectPtr &refpos, SQObjectPtr &outkey, SQObjectPtr &outval);
 
	SQInstance *CreateInstance();
 
	SQTable *_members;
 
	SQClass *_base;
 
	SQClassMemberVec _defaultvalues;
src/3rdparty/squirrel/squirrel/sqclosure.h
Show inline comments
 
@@ -11,13 +11,13 @@ private:
 
public:
 
	static SQClosure *Create(SQSharedState *ss,SQFunctionProto *func){
 
		SQClosure *nc=(SQClosure*)SQ_MALLOC(sizeof(SQClosure));
 
		new (nc) SQClosure(ss,func);
 
		return nc;
 
	}
 
	void Release(){
 
	void Release() override {
 
		sq_delete(this,SQClosure);
 
	}
 
	SQClosure *Clone()
 
	{
 
		SQClosure * ret = SQClosure::Create(_opt_ss(this),_funcproto(_function));
 
		ret->_env = _env;
 
@@ -29,14 +29,14 @@ public:
 
	{
 
		REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain,this);
 
	}
 
	bool Save(SQVM *v,SQUserPointer up,SQWRITEFUNC write);
 
	static bool Load(SQVM *v,SQUserPointer up,SQREADFUNC read,SQObjectPtr &ret);
 
#ifndef NO_GARBAGE_COLLECTOR
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
 
	void Finalize(){_outervalues.resize(0); }
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
 
	void Finalize() override {_outervalues.resize(0); }
 
#endif
 
	SQObjectPtr _env;
 
	SQObjectPtr _function;
 
	SQObjectPtrVec _outervalues;
 
	SQObjectPtrVec _defaultparams;
 
};
 
@@ -57,20 +57,20 @@ public:
 
		REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain,this);
 
	}
 
    void Kill(){
 
		_state=eDead;
 
		_stack.resize(0);
 
		_closure=_null_;}
 
	void Release(){
 
	void Release() override {
 
		sq_delete(this,SQGenerator);
 
	}
 
	bool Yield(SQVM *v);
 
	bool Resume(SQVM *v,SQInteger target);
 
#ifndef NO_GARBAGE_COLLECTOR
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
 
	void Finalize(){_stack.resize(0);_closure=_null_;}
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
 
	void Finalize() override {_stack.resize(0);_closure=_null_;}
 
#endif
 
	SQObjectPtr _closure;
 
	SQObjectPtrVec _stack;
 
	SQObjectPtrVec _vargsstack;
 
	SQVM::CallInfo _ci;
 
	ExceptionsTraps _etraps;
 
@@ -99,18 +99,18 @@ public:
 
		return ret;
 
	}
 
	~SQNativeClosure()
 
	{
 
		REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain,this);
 
	}
 
	void Release(){
 
	void Release() override {
 
		sq_delete(this,SQNativeClosure);
 
	}
 
#ifndef NO_GARBAGE_COLLECTOR
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
 
	void Finalize(){_outervalues.resize(0);}
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
 
	void Finalize() override {_outervalues.resize(0);}
 
#endif
 
	SQInteger _nparamscheck;
 
	SQIntVec _typecheck;
 
	SQObjectPtrVec _outervalues;
 
	SQObjectPtr _env;
 
	SQFUNCTION _function;
src/3rdparty/squirrel/squirrel/sqfuncproto.h
Show inline comments
 
@@ -100,13 +100,13 @@ public:
 
		SQFunctionProto *f;
 
		//I compact the whole class and members in a single memory allocation
 
		f = (SQFunctionProto *)sq_vm_malloc(_FUNC_SIZE(ninstructions,nliterals,nparameters,nfunctions,noutervalues,nlineinfos,nlocalvarinfos,ndefaultparams));
 
		new (f) SQFunctionProto(ninstructions, nliterals, nparameters, nfunctions, noutervalues, nlineinfos, nlocalvarinfos, ndefaultparams);
 
		return f;
 
	}
 
	void Release(){
 
	void Release() override {
 
		_DESTRUCT_VECTOR(SQObjectPtr,_nliterals,_literals);
 
		_DESTRUCT_VECTOR(SQObjectPtr,_nparameters,_parameters);
 
		_DESTRUCT_VECTOR(SQObjectPtr,_nfunctions,_functions);
 
		_DESTRUCT_VECTOR(SQOuterVar,_noutervalues,_outervalues);
 
		//_DESTRUCT_VECTOR(SQLineInfo,_nlineinfos,_lineinfos); //not required are 2 integers
 
		_DESTRUCT_VECTOR(SQLocalVarInfo,_nlocalvarinfos,_localvarinfos);
src/3rdparty/squirrel/squirrel/sqobject.h
Show inline comments
 
@@ -81,13 +81,13 @@ struct SQRefCounted
 
private:
 
	size_t size;
 
};
 

	
 
struct SQWeakRef : SQRefCounted
 
{
 
	void Release();
 
	void Release() override;
 
	SQObject _obj;
 
};
 

	
 
#define _realval(o) (type((o)) != OT_WEAKREF?(SQObject)o:_weakref(o)->_obj)
 

	
 
struct SQObjectPtr;
 
@@ -359,13 +359,13 @@ inline void _Swap(SQObject &a,SQObject &
 
#ifndef NO_GARBAGE_COLLECTOR
 
#define MARK_FLAG 0x80000000
 
struct SQCollectable : public SQRefCounted {
 
	SQCollectable *_next;
 
	SQCollectable *_prev;
 
	SQSharedState *_sharedstate;
 
	virtual void Release()=0;
 
	void Release() override=0;
 
	virtual void EnqueueMarkObjectForChildren(class SQGCMarkerQueue &queue)=0;
 
	void UnMark();
 
	virtual void Finalize()=0;
 
	static void AddToChain(SQCollectable **chain,SQCollectable *c);
 
	static void RemoveFromChain(SQCollectable **chain,SQCollectable *c);
 

	
src/3rdparty/squirrel/squirrel/sqstring.h
Show inline comments
 
@@ -16,13 +16,13 @@ struct SQString : public SQRefCounted
 
	SQString(const SQChar *news, SQInteger len);
 
	~SQString(){}
 
public:
 
	static SQString *Create(SQSharedState *ss, const SQChar *, SQInteger len = -1 );
 
	static SQString *Create(SQSharedState *ss, const std::string &str) { return Create(ss, str.data(), str.size()); }
 
	SQInteger Next(const SQObjectPtr &refpos, SQObjectPtr &outkey, SQObjectPtr &outval);
 
	void Release();
 
	void Release() override;
 
	SQSharedState *_sharedstate;
 
	SQString *_next; //chain for the string table
 
	SQInteger _len;
 
	SQHash _hash;
 
	SQChar _val[1];
 
};
src/3rdparty/squirrel/squirrel/squserdata.h
Show inline comments
 
@@ -15,16 +15,16 @@ struct SQUserData : SQDelegable
 
	{
 
		SQUserData* ud = (SQUserData*)SQ_MALLOC(sizeof(SQUserData)+(size-1));
 
		new (ud) SQUserData(ss, size);
 
		return ud;
 
	}
 
#ifndef NO_GARBAGE_COLLECTOR
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
 
	void Finalize(){SetDelegate(nullptr);}
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
 
	void Finalize() override {SetDelegate(nullptr);}
 
#endif
 
	void Release() {
 
	void Release() override {
 
		if (_hook) _hook(_val,_size);
 
		SQInteger tsize = _size - 1;
 
		this->~SQUserData();
 
		SQ_FREE(this, sizeof(SQUserData) + tsize);
 
	}
 

	
src/3rdparty/squirrel/squirrel/sqvm.h
Show inline comments
 
@@ -109,22 +109,22 @@ public:
 
	void ClearStack(SQInteger last_top);
 
#ifdef _DEBUG_DUMP
 
	void dumpstack(SQInteger stackbase=-1, bool dumpall = false);
 
#endif
 

	
 
#ifndef NO_GARBAGE_COLLECTOR
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
 
	void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
 
#endif
 
	void Finalize();
 
	void Finalize() override;
 
	void GrowCallStack() {
 
		SQInteger newsize = _alloccallsstacksize*2;
 
		_callstackdata.resize(newsize);
 
		_callsstack = &_callstackdata[0];
 
		_alloccallsstacksize = newsize;
 
	}
 
	void Release(){ sq_delete(this,SQVM); } //does nothing
 
	void Release() override { sq_delete(this,SQVM); } //does nothing
 
////////////////////////////////////////////////////////////////////////////
 
	//stack functions for the api
 
	void Remove(SQInteger n);
 

	
 
	bool IsFalse(SQObjectPtr &o);
 

	
0 comments (0 inline, 0 general)