Remove PushNull API from forwards/calls.

This appears to have no users, as it was not really possible to take
advantage of due to language constraints.
This commit is contained in:
David Anderson
2026-05-24 13:25:34 -07:00
parent 483cd9f5a8
commit e87291362b
8 changed files with 13 additions and 83 deletions
+6 -24
View File
@@ -232,12 +232,10 @@ bool CForward::ProcessArguments(const CallArgs& args) {
}
break;
case CallArgs::ARG_ARRAY:
case CallArgs::ARG_NULL_VECTOR:
if (pt != Param_Array)
return !!SetError(SP_ERROR_PARAM);
break;
case CallArgs::ARG_CHAR_ARRAY:
case CallArgs::ARG_NULL_STRING:
if (pt != Param_String)
return !!SetError(SP_ERROR_PARAM);
break;
@@ -377,13 +375,10 @@ int CForward::PushFloatByRef(float *num, int flags)
int CForward::PushArray(cell_t *inarray, unsigned int cells, int flags)
{
if (inarray) {
default_args_.PushArray(inarray, cells, flags);
} else {
if (cells != 3)
return SetError(SP_ERROR_PARAM);
default_args_.PushNullVector();
if (!inarray) {
return SetError(SP_ERROR_PARAM);
}
default_args_.PushArray(inarray, cells, flags);
if (default_args_.error)
return SetError(SP_ERROR_PARAMS_MAX);
return SP_ERROR_NONE;
@@ -391,11 +386,10 @@ int CForward::PushArray(cell_t *inarray, unsigned int cells, int flags)
int CForward::PushString(const char *string)
{
if (string) {
default_args_.PushString(string);
} else {
default_args_.PushNullString();
if (!string) {
return SetError(SP_ERROR_PARAM);
}
default_args_.PushString(string);
if (default_args_.error)
return SetError(SP_ERROR_PARAMS_MAX);
return SP_ERROR_NONE;
@@ -409,18 +403,6 @@ int CForward::PushStringEx(char *buffer, size_t length, int sz_flags, int cp_fla
return SP_ERROR_NONE;
}
int CForward::PushNullString()
{
default_args_.PushNullString();
return SP_ERROR_NONE;
}
int CForward::PushNullVector()
{
default_args_.PushNullVector();
return SP_ERROR_NONE;
}
void CForward::Cancel()
{
default_args_.Reset();
-2
View File
@@ -73,8 +73,6 @@ private:
CForward(ExecType et, const char *name,
const ParamType *types, unsigned num_params);
int PushNullString();
int PushNullVector();
inline int SetError(int err)
{
m_errstate = err;
-32
View File
@@ -532,36 +532,6 @@ static cell_t sm_CallPushStringEx(IPluginContext *pContext, const cell_t *params
return 1;
}
static cell_t sm_CallPushNullVector(IPluginContext *pContext, const cell_t *params)
{
if (!s_CallStarted)
{
return pContext->ThrowNativeError("Cannot push parameters when there is no call in progress");
}
sArgs.PushNullVector();
if (sArgs.error)
return pContext->ThrowNativeErrorEx(SP_ERROR_PARAMS_MAX, nullptr);
return 1;
}
static cell_t sm_CallPushNullString(IPluginContext *pContext, const cell_t *params)
{
if (!s_CallStarted)
{
return pContext->ThrowNativeError("Cannot push parameters when there is no call in progress");
}
sArgs.PushNullString();
if (sArgs.error)
return pContext->ThrowNativeErrorEx(SP_ERROR_PARAMS_MAX, nullptr);
return 1;
}
static cell_t sm_CallFinish(IPluginContext *pContext, const cell_t *params)
{
cell_t *result;
@@ -681,8 +651,6 @@ REGISTER_NATIVES(functionNatives)
{"Call_PushArrayEx", sm_CallPushArrayEx},
{"Call_PushString", sm_CallPushString},
{"Call_PushStringEx", sm_CallPushStringEx},
{"Call_PushNullVector", sm_CallPushNullVector},
{"Call_PushNullString", sm_CallPushNullString},
{"Call_Finish", sm_CallFinish},
{"Call_Cancel", sm_CallCancel},
{"RequestFrame", sm_AddFrameAction},