mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-08 17:00:47 +00:00
[gamecode] Support the l flag for %v and %q
This makes it much easier to print double vector types (for 3 and 4 components, at least).
This commit is contained in:
parent
77c1b584ea
commit
81b57903fc
1 changed files with 9 additions and 3 deletions
|
@ -1058,7 +1058,8 @@ fmt_state_modifiers (fmt_state_t *state)
|
||||||
// no modifiers supported
|
// no modifiers supported
|
||||||
if (state->c[0] == 'l'
|
if (state->c[0] == 'l'
|
||||||
&& (state->c[1] == 'i' || state->c[1] == 'd' || state->c[1] == 'x'
|
&& (state->c[1] == 'i' || state->c[1] == 'd' || state->c[1] == 'x'
|
||||||
|| state->c[1] == 'u')) {
|
|| state->c[1] == 'u'
|
||||||
|
|| state->c[1] == 'v' || state->c[1] == 'q')) {
|
||||||
(*state->fi)->flags |= FMT_LONG;
|
(*state->fi)->flags |= FMT_LONG;
|
||||||
state->c++;
|
state->c++;
|
||||||
}
|
}
|
||||||
|
@ -1183,8 +1184,13 @@ fmt_state_conversion (fmt_state_t *state)
|
||||||
(*state->fi)->precision = precision;
|
(*state->fi)->precision = precision;
|
||||||
(*state->fi)->minFieldWidth = minWidth;
|
(*state->fi)->minFieldWidth = minWidth;
|
||||||
(*state->fi)->type = 'g';
|
(*state->fi)->type = 'g';
|
||||||
(*state->fi)->data.float_var =
|
if (flags & FMT_LONG) {
|
||||||
P_VECTOR (pr, state->fmt_count)[i];
|
(*state->fi)->data.double_var
|
||||||
|
= (&P_var (pr, state->fmt_count, double))[i];
|
||||||
|
} else {
|
||||||
|
(*state->fi)->data.float_var =
|
||||||
|
P_VECTOR (pr, state->fmt_count)[i];
|
||||||
|
}
|
||||||
|
|
||||||
fmt_append_item (state);
|
fmt_append_item (state);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue