1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 07:07:13 +02:00

Massive code reduction in the binding utility by using variadic templates.

Extensive code refactoring surrounding the StackStrF helper to facilitate the new changes.
Various other miscellaneous changes and code refactoring to facilitate the new changes.
This commit is contained in:
Sandu Liviu Catalin
2018-07-30 00:58:27 +03:00
parent 199e9ac502
commit f300e7ff4a
20 changed files with 724 additions and 9507 deletions

View File

@ -2008,9 +2008,9 @@ SQInteger CPlayer::Msg(HSQUIRRELVM vm)
}
// Attempt to generate the string value
StackStrF val(vm, msgidx, true);
StackStrF val(vm, msgidx);
// Have we failed to retrieve the string?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error!
}
@ -2089,9 +2089,9 @@ SQInteger CPlayer::MsgP(HSQUIRRELVM vm)
}
// Attempt to generate the string value
StackStrF val(vm, 3, true);
StackStrF val(vm, 3);
// Have we failed to retrieve the string?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error!
}
@ -2195,9 +2195,9 @@ SQInteger CPlayer::MsgEx(HSQUIRRELVM vm)
}
// Attempt to generate the string value
StackStrF val(vm, msgidx, true);
StackStrF val(vm, msgidx);
// Have we failed to retrieve the string?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error!
}
@ -2260,9 +2260,9 @@ SQInteger CPlayer::Message(HSQUIRRELVM vm)
}
// Attempt to generate the string value
StackStrF val(vm, 2, true);
StackStrF val(vm, 2);
// Have we failed to retrieve the string?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error!
}
@ -2317,9 +2317,9 @@ SQInteger CPlayer::Announce(HSQUIRRELVM vm)
}
// Attempt to generate the string value
StackStrF val(vm, 2, true);
StackStrF val(vm, 2);
// Have we failed to retrieve the string?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error!
}
@ -2387,9 +2387,9 @@ SQInteger CPlayer::AnnounceEx(HSQUIRRELVM vm)
}
// Attempt to generate the string value
StackStrF val(vm, 3, true);
StackStrF val(vm, 3);
// Have we failed to retrieve the string?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error!
}
@ -2472,9 +2472,9 @@ SQInteger Player_FindAuto(HSQUIRRELVM vm)
case OT_STRING:
default: {
// Attempt to convert the obtained value to a string
StackStrF val(vm, 2, true);
StackStrF val(vm, 2);
// Did the conversion failed?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error
}
@ -2558,9 +2558,9 @@ SQInteger Player_ExistsAuto(HSQUIRRELVM vm)
case OT_STRING:
default: {
// Attempt to convert the obtained value to a string
StackStrF val(vm, 2, true);
StackStrF val(vm, 2);
// Did the conversion failed?
if (SQ_FAILED(val.mRes))
if (SQ_FAILED(val.Proc(true)))
{
return val.mRes; // Propagate the error
}