Remove sp_context_t.
This commit is contained in:
parent
c09c65e4c7
commit
33588b65ce
@ -26,7 +26,6 @@ CContextTrace::CContextTrace(PluginRuntime *pRuntime, int err, const char *errst
|
||||
m_StartRp(start_rp),
|
||||
m_Level(0)
|
||||
{
|
||||
m_ctx = pRuntime->m_pCtx->GetCtx();
|
||||
m_pDebug = m_pRuntime->GetDebugInfo();
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ class CContextTrace : public IContextTrace
|
||||
private:
|
||||
PluginRuntime *m_pRuntime;
|
||||
PluginContext *context_;
|
||||
sp_context_t *m_ctx;
|
||||
int m_Error;
|
||||
const char *m_pMsg;
|
||||
cell_t m_StartRp;
|
||||
|
@ -45,7 +45,7 @@ Write(const sp_plugin_t *plugin, cell_t offset, cell_t value)
|
||||
}
|
||||
|
||||
static inline cell_t *
|
||||
Jump(const sp_plugin_t *plugin, sp_context_t *ctx, cell_t target)
|
||||
Jump(const sp_plugin_t *plugin, cell_t target)
|
||||
{
|
||||
if (!IsValidOffset(target) || uint32_t(target) >= plugin->pcode_size)
|
||||
return NULL;
|
||||
@ -53,7 +53,7 @@ Jump(const sp_plugin_t *plugin, sp_context_t *ctx, cell_t target)
|
||||
}
|
||||
|
||||
static inline cell_t *
|
||||
JumpTarget(const sp_plugin_t *plugin, sp_context_t *ctx, cell_t *cip, bool cond, int *errp)
|
||||
JumpTarget(const sp_plugin_t *plugin, cell_t *cip, bool cond, int *errp)
|
||||
{
|
||||
if (!cond)
|
||||
return cip + 1;
|
||||
@ -84,7 +84,6 @@ Interpret(PluginRuntime *rt, uint32_t aCodeStart, cell_t *rval)
|
||||
return SP_ERROR_INVALID_INSTRUCTION;
|
||||
|
||||
PluginContext *cx = rt->GetBaseContext();
|
||||
sp_context_t *ctx = cx->GetCtx();
|
||||
|
||||
int err = SP_ERROR_NONE;
|
||||
|
||||
@ -675,41 +674,41 @@ Interpret(PluginRuntime *rt, uint32_t aCodeStart, cell_t *rval)
|
||||
}
|
||||
|
||||
case OP_JUMP:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, true, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, true, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
|
||||
case OP_JZER:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri == 0, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri == 0, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
case OP_JNZ:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri != 0, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri != 0, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
|
||||
case OP_JEQ:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri == alt, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri == alt, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
case OP_JNEQ:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri != alt, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri != alt, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
case OP_JSLESS:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri < alt, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri < alt, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
case OP_JSLEQ:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri <= alt, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri <= alt, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
case OP_JSGRTR:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri > alt, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri > alt, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
case OP_JSGEQ:
|
||||
if ((cip = JumpTarget(plugin, ctx, cip, pri >= alt, &err)) == NULL)
|
||||
if ((cip = JumpTarget(plugin, cip, pri >= alt, &err)) == NULL)
|
||||
goto error;
|
||||
break;
|
||||
|
||||
@ -831,7 +830,7 @@ Interpret(PluginRuntime *rt, uint32_t aCodeStart, cell_t *rval)
|
||||
}
|
||||
}
|
||||
|
||||
if ((cip = Jump(plugin, ctx, target)) == NULL) {
|
||||
if ((cip = Jump(plugin, target)) == NULL) {
|
||||
err = SP_ERROR_INVALID_INSTRUCTION;
|
||||
goto error;
|
||||
}
|
||||
|
@ -70,10 +70,6 @@ namespace SourcePawn
|
||||
|
||||
class PluginContext;
|
||||
|
||||
typedef struct sp_context_s
|
||||
{
|
||||
} sp_context_t;
|
||||
|
||||
//#define SPFLAG_PLUGIN_DEBUG (1<<0)
|
||||
#define SPFLAG_PLUGIN_PAUSED (1<<1)
|
||||
|
||||
|
@ -80,12 +80,6 @@ PluginContext::GetContext()
|
||||
return reinterpret_cast<sp_context_t *>((IPluginContext * )this);
|
||||
}
|
||||
|
||||
sp_context_t *
|
||||
PluginContext::GetCtx()
|
||||
{
|
||||
return &m_ctx;
|
||||
}
|
||||
|
||||
bool
|
||||
PluginContext::IsDebugging()
|
||||
{
|
||||
|
@ -39,7 +39,6 @@ class PluginContext : public IPluginContext
|
||||
public: //IPluginContext
|
||||
IVirtualMachine *GetVirtualMachine();
|
||||
sp_context_t *GetContext();
|
||||
sp_context_t *GetCtx();
|
||||
bool IsDebugging();
|
||||
int SetDebugBreak(void *newpfn, void *oldpfn);
|
||||
IPluginDebugInfo *GetDebugInfo();
|
||||
@ -187,7 +186,6 @@ class PluginContext : public IPluginContext
|
||||
bool m_CustomMsg;
|
||||
bool m_InExec;
|
||||
PluginRuntime *m_pRuntime;
|
||||
sp_context_t m_ctx;
|
||||
void *m_keys[4];
|
||||
bool m_keys_set[4];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user