mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Merge pull request #4845 from Barinzaya/fmt_variable_wp_without_index
Variable Width/Precision Without Index in `fmt`
This commit is contained in:
@@ -613,6 +613,10 @@ wprintf :: proc(w: io.Writer, fmt: string, args: ..any, flush := true, newline :
|
|||||||
i += 1
|
i += 1
|
||||||
width_index, _, index_ok := _arg_number(fmt, &i, len(args))
|
width_index, _, index_ok := _arg_number(fmt, &i, len(args))
|
||||||
|
|
||||||
|
if !index_ok {
|
||||||
|
width_index, index_ok = error_check_arg(fi, false, unused_args^)
|
||||||
|
}
|
||||||
|
|
||||||
if index_ok {
|
if index_ok {
|
||||||
unused_args^ -= {width_index}
|
unused_args^ -= {width_index}
|
||||||
|
|
||||||
@@ -638,6 +642,10 @@ wprintf :: proc(w: io.Writer, fmt: string, args: ..any, flush := true, newline :
|
|||||||
i += 1
|
i += 1
|
||||||
precision_index, _, index_ok := _arg_number(fmt, &i, len(args))
|
precision_index, _, index_ok := _arg_number(fmt, &i, len(args))
|
||||||
|
|
||||||
|
if !index_ok {
|
||||||
|
precision_index, index_ok = error_check_arg(fi, false, unused_args^)
|
||||||
|
}
|
||||||
|
|
||||||
if index_ok {
|
if index_ok {
|
||||||
unused_args^ -= {precision_index}
|
unused_args^ -= {precision_index}
|
||||||
fi.prec, _, fi.prec_set = int_from_arg(args, precision_index)
|
fi.prec, _, fi.prec_set = int_from_arg(args, precision_index)
|
||||||
|
|||||||
Reference in New Issue
Block a user