mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-11 20:03:11 +00:00
[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:
parent
354a161722
commit
8cc00cd91b
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue