Breakage alert :\
authorScott Ehlert <ds@alliedmods.net>
Wed Mar 07 18:24:09 2007 +0000 (2007-03-07)
changeset 5841b10d3504e9e
parent 583 9fab8343cc15
child 585 6d3a0ec864fe
Breakage alert :\
ThrowNativeErrorEx now returns 0 for convenience
PushCellByRef and PushFloatByRef no longer have a flags parameter because it was almost pointless
core/systems/ForwardSys.cpp
core/systems/ForwardSys.h
core/vm/sp_vm_basecontext.cpp
core/vm/sp_vm_basecontext.h
core/vm/sp_vm_function.cpp
core/vm/sp_vm_function.h
public/sourcepawn/sp_vm_api.h
     1.1 --- a/core/systems/ForwardSys.cpp	Wed Mar 07 16:41:12 2007 +0000
     1.2 +++ b/core/systems/ForwardSys.cpp	Wed Mar 07 18:24:09 2007 +0000
     1.3 @@ -297,7 +297,7 @@
     1.4  				{
     1.5  					func->PushStringEx((char *)param->byref.orig_addr, param->byref.cells, param->byref.sz_flags, param->byref.flags);
     1.6  				} else if (type == Param_Float || type == Param_Cell) {
     1.7 -					func->PushCellByRef(&param->val, 0); 
     1.8 +					func->PushCellByRef(&param->val); 
     1.9  				} else {
    1.10  					func->PushArray(param->byref.orig_addr, param->byref.cells, NULL, param->byref.flags);
    1.11  					assert(type == Param_Array || type == Param_FloatByRef || type == Param_CellByRef);
    1.12 @@ -434,7 +434,7 @@
    1.13  	return SP_ERROR_NONE;
    1.14  }
    1.15  
    1.16 -int CForward::PushCellByRef(cell_t *cell, int flags)
    1.17 +int CForward::PushCellByRef(cell_t *cell)
    1.18  {
    1.19  	if (m_curparam < m_numparams)
    1.20  	{
    1.21 @@ -452,13 +452,13 @@
    1.22  		m_params[m_curparam].pushedas = Param_CellByRef;
    1.23  	}
    1.24  
    1.25 -	_Int_PushArray(cell, 1, flags);
    1.26 +	_Int_PushArray(cell, 1, SM_PARAM_COPYBACK);
    1.27  	m_curparam++;
    1.28  
    1.29  	return SP_ERROR_NONE;
    1.30  }
    1.31  
    1.32 -int CForward::PushFloatByRef(float *num, int flags)
    1.33 +int CForward::PushFloatByRef(float *num)
    1.34  {
    1.35  	if (m_curparam < m_numparams)
    1.36  	{
    1.37 @@ -476,7 +476,7 @@
    1.38  		m_params[m_curparam].pushedas = Param_FloatByRef;
    1.39  	}
    1.40  
    1.41 -	_Int_PushArray((cell_t *)num, 1, flags);
    1.42 +	_Int_PushArray((cell_t *)num, 1, SM_PARAM_COPYBACK);
    1.43  	m_curparam++;
    1.44  
    1.45  	return SP_ERROR_NONE;
     2.1 --- a/core/systems/ForwardSys.h	Wed Mar 07 16:41:12 2007 +0000
     2.2 +++ b/core/systems/ForwardSys.h	Wed Mar 07 18:24:09 2007 +0000
     2.3 @@ -47,9 +47,9 @@
     2.4  {
     2.5  public: //ICallable
     2.6  	virtual int PushCell(cell_t cell);
     2.7 -	virtual int PushCellByRef(cell_t *cell, int flags);
     2.8 +	virtual int PushCellByRef(cell_t *cell);
     2.9  	virtual int PushFloat(float number);
    2.10 -	virtual int PushFloatByRef(float *number, int flags);
    2.11 +	virtual int PushFloatByRef(float *number);
    2.12  	virtual int PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int flags);
    2.13  	virtual int PushString(const char *string);
    2.14  	virtual int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags);
     3.1 --- a/core/vm/sp_vm_basecontext.cpp	Wed Mar 07 16:41:12 2007 +0000
     3.2 +++ b/core/vm/sp_vm_basecontext.cpp	Wed Mar 07 18:24:09 2007 +0000
     3.3 @@ -212,11 +212,11 @@
     3.4  	vsnprintf(m_MsgCache, sizeof(m_MsgCache), msg, ap);
     3.5  }
     3.6  
     3.7 -void BaseContext::ThrowNativeErrorEx(int error, const char *msg, ...)
     3.8 +cell_t BaseContext::ThrowNativeErrorEx(int error, const char *msg, ...)
     3.9  {
    3.10  	if (!m_InExec)
    3.11  	{
    3.12 -		return;
    3.13 +		return 0;
    3.14  	}
    3.15  
    3.16  	ctx->n_err = error;
    3.17 @@ -228,6 +228,8 @@
    3.18  		SetErrorMessage(msg, ap);
    3.19  		va_end(ap);
    3.20  	}
    3.21 +
    3.22 +	return 0;
    3.23  }
    3.24  
    3.25  cell_t BaseContext::ThrowNativeError(const char *msg, ...)
     4.1 --- a/core/vm/sp_vm_basecontext.h	Wed Mar 07 16:41:12 2007 +0000
     4.2 +++ b/core/vm/sp_vm_basecontext.h	Wed Mar 07 18:24:09 2007 +0000
     4.3 @@ -61,7 +61,7 @@
     4.4  		virtual int BindNative(const sp_nativeinfo_t *native);
     4.5  		virtual int BindNativeToAny(SPVM_NATIVE_FUNC native);
     4.6  		virtual int Execute(uint32_t code_addr, cell_t *result);
     4.7 -		virtual void ThrowNativeErrorEx(int error, const char *msg, ...);
     4.8 +		virtual cell_t ThrowNativeErrorEx(int error, const char *msg, ...);
     4.9  		virtual cell_t ThrowNativeError(const char *msg, ...);
    4.10  		virtual IPluginFunction *GetFunctionByName(const char *public_name);
    4.11  		virtual IPluginFunction *GetFunctionById(funcid_t func_id);
     5.1 --- a/core/vm/sp_vm_function.cpp	Wed Mar 07 16:41:12 2007 +0000
     5.2 +++ b/core/vm/sp_vm_function.cpp	Wed Mar 07 18:24:09 2007 +0000
     5.3 @@ -79,14 +79,14 @@
     5.4  	return SP_ERROR_NONE;
     5.5  }
     5.6  
     5.7 -int CFunction::PushCellByRef(cell_t *cell, int flags)
     5.8 +int CFunction::PushCellByRef(cell_t *cell)
     5.9  {
    5.10  	if (m_curparam >= SP_MAX_EXEC_PARAMS)
    5.11  	{
    5.12  		return SetError(SP_ERROR_PARAMS_MAX);
    5.13  	}
    5.14  
    5.15 -	return PushArray(cell, 1, NULL, flags);
    5.16 +	return PushArray(cell, 1, NULL, SM_PARAM_COPYBACK);
    5.17  }
    5.18  
    5.19  int CFunction::PushFloat(float number)
    5.20 @@ -96,9 +96,9 @@
    5.21  	return PushCell(val);
    5.22  }
    5.23  
    5.24 -int CFunction::PushFloatByRef(float *number, int flags)
    5.25 +int CFunction::PushFloatByRef(float *number)
    5.26  {
    5.27 -	return PushCellByRef((cell_t *)number, flags);
    5.28 +	return PushCellByRef((cell_t *)number);
    5.29  }
    5.30  
    5.31  int CFunction::PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int copyback)
     6.1 --- a/core/vm/sp_vm_function.h	Wed Mar 07 16:41:12 2007 +0000
     6.2 +++ b/core/vm/sp_vm_function.h	Wed Mar 07 18:24:09 2007 +0000
     6.3 @@ -35,9 +35,9 @@
     6.4  	CFunction(uint32_t code_addr, IPluginContext *pContext);
     6.5  public:
     6.6  	virtual int PushCell(cell_t cell);
     6.7 -	virtual int PushCellByRef(cell_t *cell, int flags);
     6.8 +	virtual int PushCellByRef(cell_t *cell);
     6.9  	virtual int PushFloat(float number);
    6.10 -	virtual int PushFloatByRef(float *number, int flags);
    6.11 +	virtual int PushFloatByRef(float *number);
    6.12  	virtual int PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int copyback);
    6.13  	virtual int PushString(const char *string);
    6.14  	virtual int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags);
     7.1 --- a/public/sourcepawn/sp_vm_api.h	Wed Mar 07 16:41:12 2007 +0000
     7.2 +++ b/public/sourcepawn/sp_vm_api.h	Wed Mar 07 18:24:09 2007 +0000
     7.3 @@ -70,7 +70,7 @@
     7.4  		 * @param flags		Copy-back flags.
     7.5  		 * @return			Error code, if any.
     7.6  		 */
     7.7 -		virtual int PushCellByRef(cell_t *cell, int flags) =0;
     7.8 +		virtual int PushCellByRef(cell_t *cell) =0;
     7.9  
    7.10  		/**
    7.11  		 * @brief Pushes a float onto the current call.
    7.12 @@ -91,7 +91,7 @@
    7.13  		 & @param flags		Copy-back flags.
    7.14  		 * @return			Error code, if any.
    7.15  		 */
    7.16 -		virtual int PushFloatByRef(float *number, int flags) =0;
    7.17 +		virtual int PushFloatByRef(float *number) =0;
    7.18  
    7.19  		/**
    7.20  		 * @brief Pushes an array of cells onto the current call.  
    7.21 @@ -505,8 +505,9 @@
    7.22  		 * @param error		The error number to set.
    7.23  		 * @param msg		Custom error message format.  NULL to use default.
    7.24  		 * @param ...		Message format arguments, if any.
    7.25 +		 * @return			0 for convenience.
    7.26  		 */
    7.27 -		virtual void ThrowNativeErrorEx(int error, const char *msg, ...) =0;
    7.28 +		virtual cell_t ThrowNativeErrorEx(int error, const char *msg, ...) =0;
    7.29  
    7.30  		/**
    7.31  		 * @brief Throws a generic native error and halts any current execution.