mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
vsprintf: associate the format state with the format pointer
The vsnprintf() code is written as a state machine as it walks the format pointer, but for various historical reasons the state is oddly named and was encoded as the 'type' field in the 'struct printf_spec'. That naming came from the fact that the states used to not just encode the state of the state machine, but also the various integer types that would then be printed out. Let's make the state machine more obvious, and actually call it 'state', and associate it with the format pointer itself, rather than the 'printf_spec' that contains the currently decoded formatting specs. This also removes the bit packing from printf_spec, which makes it much easier on the compiler. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
292
lib/vsprintf.c
292
lib/vsprintf.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user