Fix sizeof usage for Variant pointers in alloca
Coverity report this as a non portable usage of sizeof
This commit is contained in:
parent
56a2b143a2
commit
5b6f641e99
2 changed files with 3 additions and 3 deletions
|
@ -133,7 +133,7 @@ void CallableCustomBind::get_bound_arguments(Vector<Variant> &r_arguments, int &
|
|||
}
|
||||
|
||||
void CallableCustomBind::call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const {
|
||||
const Variant **args = (const Variant **)alloca(sizeof(const Variant **) * (binds.size() + p_argcount));
|
||||
const Variant **args = (const Variant **)alloca(sizeof(Variant *) * (binds.size() + p_argcount));
|
||||
for (int i = 0; i < p_argcount; i++) {
|
||||
args[i] = (const Variant *)p_arguments[i];
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ void CallableCustomBind::call(const Variant **p_arguments, int p_argcount, Varia
|
|||
}
|
||||
|
||||
Error CallableCustomBind::rpc(int p_peer_id, const Variant **p_arguments, int p_argcount, Callable::CallError &r_call_error) const {
|
||||
const Variant **args = (const Variant **)alloca(sizeof(const Variant **) * (binds.size() + p_argcount));
|
||||
const Variant **args = (const Variant **)alloca(sizeof(Variant *) * (binds.size() + p_argcount));
|
||||
for (int i = 0; i < p_argcount; i++) {
|
||||
args[i] = (const Variant *)p_arguments[i];
|
||||
}
|
||||
|
|
|
@ -1789,7 +1789,7 @@ void AnimationMixer::_blend_apply() {
|
|||
|
||||
void AnimationMixer::_call_object(Object *p_object, const StringName &p_method, const Vector<Variant> &p_params, bool p_deferred) {
|
||||
// Separate function to use alloca() more efficiently
|
||||
const Variant **argptrs = (const Variant **)alloca(sizeof(const Variant **) * p_params.size());
|
||||
const Variant **argptrs = (const Variant **)alloca(sizeof(Variant *) * p_params.size());
|
||||
const Variant *args = p_params.ptr();
|
||||
uint32_t argcount = p_params.size();
|
||||
for (uint32_t i = 0; i < argcount; i++) {
|
||||
|
|
Loading…
Reference in a new issue