From 949b83c99b31a57bc7ed9105a5cff3f69109ae69 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Wed, 7 Mar 2007 18:37:41 +0000 Subject: [PATCH] Reverted change where flags param was removed on PushCellByRef and PushFloatByRef. Instead set the param to a default value of SM_PARAM_COPYBACK. (DS, how dare you!) --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40591 --- core/systems/ForwardSys.cpp | 8 ++++---- core/systems/ForwardSys.h | 4 ++-- core/vm/sp_vm_function.cpp | 8 ++++---- core/vm/sp_vm_function.h | 4 ++-- public/sourcepawn/sp_vm_api.h | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/systems/ForwardSys.cpp b/core/systems/ForwardSys.cpp index 404e2fef..d43c15d9 100644 --- a/core/systems/ForwardSys.cpp +++ b/core/systems/ForwardSys.cpp @@ -434,7 +434,7 @@ int CForward::PushFloat(float number) return SP_ERROR_NONE; } -int CForward::PushCellByRef(cell_t *cell) +int CForward::PushCellByRef(cell_t *cell, int flags) { if (m_curparam < m_numparams) { @@ -452,13 +452,13 @@ int CForward::PushCellByRef(cell_t *cell) m_params[m_curparam].pushedas = Param_CellByRef; } - _Int_PushArray(cell, 1, SM_PARAM_COPYBACK); + _Int_PushArray(cell, 1, flags); m_curparam++; return SP_ERROR_NONE; } -int CForward::PushFloatByRef(float *num) +int CForward::PushFloatByRef(float *num, int flags) { if (m_curparam < m_numparams) { @@ -476,7 +476,7 @@ int CForward::PushFloatByRef(float *num) m_params[m_curparam].pushedas = Param_FloatByRef; } - _Int_PushArray((cell_t *)num, 1, SM_PARAM_COPYBACK); + _Int_PushArray((cell_t *)num, 1, flags); m_curparam++; return SP_ERROR_NONE; diff --git a/core/systems/ForwardSys.h b/core/systems/ForwardSys.h index 287b5eff..e0ce371b 100644 --- a/core/systems/ForwardSys.h +++ b/core/systems/ForwardSys.h @@ -47,9 +47,9 @@ class CForward : public IChangeableForward { public: //ICallable virtual int PushCell(cell_t cell); - virtual int PushCellByRef(cell_t *cell); + virtual int PushCellByRef(cell_t *cell, int flags); virtual int PushFloat(float number); - virtual int PushFloatByRef(float *number); + virtual int PushFloatByRef(float *number, int flags); virtual int PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int flags); virtual int PushString(const char *string); virtual int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags); diff --git a/core/vm/sp_vm_function.cpp b/core/vm/sp_vm_function.cpp index 49f6a483..c7f3b5a6 100644 --- a/core/vm/sp_vm_function.cpp +++ b/core/vm/sp_vm_function.cpp @@ -79,14 +79,14 @@ int CFunction::PushCell(cell_t cell) return SP_ERROR_NONE; } -int CFunction::PushCellByRef(cell_t *cell) +int CFunction::PushCellByRef(cell_t *cell, int flags) { if (m_curparam >= SP_MAX_EXEC_PARAMS) { return SetError(SP_ERROR_PARAMS_MAX); } - return PushArray(cell, 1, NULL, SM_PARAM_COPYBACK); + return PushArray(cell, 1, NULL, flags); } int CFunction::PushFloat(float number) @@ -96,9 +96,9 @@ int CFunction::PushFloat(float number) return PushCell(val); } -int CFunction::PushFloatByRef(float *number) +int CFunction::PushFloatByRef(float *number, int flags) { - return PushCellByRef((cell_t *)number); + return PushCellByRef((cell_t *)number, flags); } int CFunction::PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int copyback) diff --git a/core/vm/sp_vm_function.h b/core/vm/sp_vm_function.h index da8713be..4b13f66d 100644 --- a/core/vm/sp_vm_function.h +++ b/core/vm/sp_vm_function.h @@ -35,9 +35,9 @@ public: CFunction(uint32_t code_addr, IPluginContext *pContext); public: virtual int PushCell(cell_t cell); - virtual int PushCellByRef(cell_t *cell); + virtual int PushCellByRef(cell_t *cell, int flags); virtual int PushFloat(float number); - virtual int PushFloatByRef(float *number); + virtual int PushFloatByRef(float *number, int flags); virtual int PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int copyback); virtual int PushString(const char *string); virtual int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags); diff --git a/public/sourcepawn/sp_vm_api.h b/public/sourcepawn/sp_vm_api.h index 67111d94..7ec0ace2 100644 --- a/public/sourcepawn/sp_vm_api.h +++ b/public/sourcepawn/sp_vm_api.h @@ -70,7 +70,7 @@ namespace SourcePawn * @param flags Copy-back flags. * @return Error code, if any. */ - virtual int PushCellByRef(cell_t *cell) =0; + virtual int PushCellByRef(cell_t *cell, int flags=SM_PARAM_COPYBACK) =0; /** * @brief Pushes a float onto the current call. @@ -91,7 +91,7 @@ namespace SourcePawn & @param flags Copy-back flags. * @return Error code, if any. */ - virtual int PushFloatByRef(float *number) =0; + virtual int PushFloatByRef(float *number, int flags=SM_PARAM_COPYBACK) =0; /** * @brief Pushes an array of cells onto the current call.