1
0
Fork 0

Codechange: Remove useless SQConstruct parameters

pull/12088/merge
glx22 2025-06-08 22:34:04 +02:00 committed by Loïc Guilloux
parent 4b677e8256
commit 90e21bc713
1 changed files with 4 additions and 4 deletions

View File

@ -187,9 +187,9 @@ namespace SQConvert {
return SQCall(instance, func, vm, std::index_sequence_for<Targs...>{}); return SQCall(instance, func, vm, std::index_sequence_for<Targs...>{});
} }
static Tcls *SQConstruct(Tcls *instance, Tretval(Tcls:: *func)(Targs...), HSQUIRRELVM vm) static Tcls *SQConstruct(HSQUIRRELVM vm)
{ {
return SQConstruct(instance, func, vm, std::index_sequence_for<Targs...>{}); return SQConstruct(vm, std::index_sequence_for<Targs...>{});
} }
private: private:
@ -210,7 +210,7 @@ namespace SQConvert {
} }
template <size_t... i> template <size_t... i>
static Tcls *SQConstruct(Tcls *, Tretval(Tcls:: *)(Targs...), [[maybe_unused]] HSQUIRRELVM vm, std::index_sequence<i...>) static Tcls *SQConstruct([[maybe_unused]] HSQUIRRELVM vm, std::index_sequence<i...>)
{ {
Tcls *inst = new Tcls( Tcls *inst = new Tcls(
Param<Targs>::Get(vm, 2 + i)... Param<Targs>::Get(vm, 2 + i)...
@ -384,7 +384,7 @@ namespace SQConvert {
int nparam = sq_gettop(vm); int nparam = sq_gettop(vm);
/* Create the real instance */ /* Create the real instance */
Tcls *instance = HelperT<Tmethod>::SQConstruct((Tcls *)nullptr, (Tmethod)nullptr, vm); Tcls *instance = HelperT<Tmethod>::SQConstruct(vm);
sq_setinstanceup(vm, -nparam, instance); sq_setinstanceup(vm, -nparam, instance);
sq_setreleasehook(vm, -nparam, DefSQDestructorCallback<Tcls>); sq_setreleasehook(vm, -nparam, DefSQDestructorCallback<Tcls>);
instance->AddRef(); instance->AddRef();