diff --git a/AMBuildScript b/AMBuildScript index 3a1819eb..ffd305eb 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -246,7 +246,6 @@ class SMConfig(object): '-Wno-array-bounds', '-Wno-unknown-pragmas', '-Wno-dangling-else', - '-Wno-uninitialized-const-pointer', '-fvisibility=hidden', ] if cxx.target.arch in ['x86', 'x86_64']: @@ -304,6 +303,9 @@ class SMConfig(object): '-Wno-tautological-overlap-compare', ] + if cxx.version >= 'clang-21.0': + cxx.cflags += ['-Wno-uninitialized-const-pointer'] + if have_gcc: cxx.cflags += ['-mfpmath=sse'] cxx.cflags += ['-Wno-maybe-uninitialized'] diff --git a/core/logic/ForwardSys.cpp b/core/logic/ForwardSys.cpp index a8e6790d..c6153008 100644 --- a/core/logic/ForwardSys.cpp +++ b/core/logic/ForwardSys.cpp @@ -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(); diff --git a/core/logic/ForwardSys.h b/core/logic/ForwardSys.h index f0bc15a0..1ff8a443 100644 --- a/core/logic/ForwardSys.h +++ b/core/logic/ForwardSys.h @@ -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; diff --git a/core/logic/smn_functions.cpp b/core/logic/smn_functions.cpp index ffc908fa..5036a918 100644 --- a/core/logic/smn_functions.cpp +++ b/core/logic/smn_functions.cpp @@ -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}, diff --git a/hl2sdk-manifests b/hl2sdk-manifests index 0019b272..c018a994 160000 --- a/hl2sdk-manifests +++ b/hl2sdk-manifests @@ -1 +1 @@ -Subproject commit 0019b272444b2753bbc6e27fcafddf0ea193b878 +Subproject commit c018a994478d6c31f70ded7adec7aa9e2c40bb1a diff --git a/plugins/include/functions.inc b/plugins/include/functions.inc index 8e3a787c..2f8e0181 100644 --- a/plugins/include/functions.inc +++ b/plugins/include/functions.inc @@ -357,16 +357,6 @@ native void Call_PushArray(const any[] value, int size); */ native void Call_PushArrayEx(any[] value, int size, int cpflags); -/** - * Pushes the NULL_VECTOR onto the current call. - * @see IsNullVector - * - * @note Cannot be used before a call has been started. - * - * @error Called before a call has been started. - */ -native void Call_PushNullVector(); - /** * Pushes a string onto the current call. * @@ -394,15 +384,6 @@ native void Call_PushString(const char[] value); */ native void Call_PushStringEx(char[] value, int length, int szflags, int cpflags); -/** - * Pushes the NULL_STRING onto the current call. - * @see IsNullString - * - * @note Cannot be used before a call has been started. - * - * @error Called before a call has been started. - */ -native void Call_PushNullString(); /** * Completes a call to a function or forward's call list. diff --git a/public/IForwardSys.h b/public/IForwardSys.h index d4e08895..5ce29364 100644 --- a/public/IForwardSys.h +++ b/public/IForwardSys.h @@ -181,8 +181,7 @@ namespace SourceMod * @brief Pushes an array of cells onto the current call. Different rules than ICallable. * NOTE: On Execute, the pointer passed will be modified according to the copyback rule. * - * @param inarray Array to copy. If NULL and cells is 3 pushes a reference to the NULL_VECTOR pubvar to each callee. - * Pushing other number of cells is not allowed, unlike ICallable's version. + * @param inarray Array to copy. Must not be NULL. * @param cells Number of cells to allocate and optionally read from the input array. * @param flags Whether or not changes should be copied back to the input array. * @return Error code, if any. @@ -192,7 +191,7 @@ namespace SourceMod /** * @brief Pushes a string onto the current call. * - * @param string String to push. If NULL pushes a reference to the NULL_STRING pubvar to each callee. + * @param string String to push. Must not be NULL. * @return Error code, if any. */ virtual int PushString(const char *string) = 0; diff --git a/sourcepawn b/sourcepawn index de31220f..c6358600 160000 --- a/sourcepawn +++ b/sourcepawn @@ -1 +1 @@ -Subproject commit de31220fc98fd73d20b0f4ada57bc83b951d8904 +Subproject commit c6358600f23e80a5dd8ae22df803a654a3697c65