mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[qwaq] Update bi_printf to work with Ruamoko's va_list
Same deal as for test_bi in qfcc's test harness. I really need to consolidate all these little functions.
This commit is contained in:
parent
e3f88b2b9c
commit
175cc408d8
1 changed files with 13 additions and 0 deletions
|
@ -152,6 +152,19 @@ bi_printf (progs_t *pr)
|
|||
pr_type_t **args = pr->pr_params + 1;
|
||||
dstring_t *dstr = dstring_new ();
|
||||
|
||||
if (pr->progs->version == PROG_VERSION) {
|
||||
__auto_type va_list = &P_PACKED (pr, pr_va_list_t, 1);
|
||||
count = va_list->count;
|
||||
if (count) {
|
||||
args = alloca (count * sizeof (pr_type_t *));
|
||||
for (int i = 0; i < count; i++) {
|
||||
args[i] = &pr->pr_globals[va_list->list + i * 4];
|
||||
}
|
||||
} else {
|
||||
args = 0;
|
||||
}
|
||||
}
|
||||
|
||||
PR_Sprintf (pr, dstr, "bi_printf", fmt, count, args);
|
||||
if (dstr->str) {
|
||||
Sys_Printf ("%s", dstr->str);
|
||||
|
|
Loading…
Reference in a new issue