[qfcc] Cast args to inline/intrinsic functions

The whole point of prototypes is to ensure arguments are of the correct
type. Fixes some ints getting into places where floats were expected
(eg, mix, smoothstep, etc).
This commit is contained in:
Bill Currie 2025-01-23 00:14:52 +09:00
parent 354a161722
commit 8cc00cd91b

View file

@ -213,6 +213,10 @@ reference_param (const type_t *ptype, const expr_t *arg)
arg = reference_expr (arg, nullptr);
} else if (!is_reference (ptype) && is_reference (arg_type)) {
arg = pointer_deref (arg);
} else if (!is_reference (ptype) && !is_reference (arg_type)) {
if (!type_same (ptype, arg_type)) {
arg = cast_expr (ptype, arg);
}
}
return arg;
}