Don't expose mutable sp_native_t.

This commit is contained in:
David Anderson
2015-02-24 23:10:18 -08:00
parent 33588b65ce
commit fcaa5361c8
11 changed files with 85 additions and 70 deletions
+1 -5
View File
@@ -457,7 +457,6 @@ static cell_t MarkNativeAsOptional(IPluginContext *pContext, const cell_t *param
{
char *name;
uint32_t idx;
sp_native_t *native;
pContext->LocalToString(params[1], &name);
if (pContext->FindNativeByName(name, &idx) != SP_ERROR_NONE)
@@ -466,10 +465,7 @@ static cell_t MarkNativeAsOptional(IPluginContext *pContext, const cell_t *param
return 0;
}
pContext->GetNativeByIndex(idx, &native);
native->flags |= SP_NTVFLAG_OPTIONAL;
pContext->GetRuntime()->UpdateNativeBinding(idx, nullptr, SP_NTVFLAG_OPTIONAL, nullptr);
return 1;
}