printf: refactor macros to function
commit00a5f3dd83a5d9c5d6c6a0665eaf7f675dfa6f4b
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Nov 2024 19:24:10 +0000 (18 11:24 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Nov 2024 16:41:34 +0000 (19 08:41 -0800)
treeb9390598399c30ac0b9ab8aa870e34b94d3ff65b
parentc41ca2814d2ffad5fff9b9526d1be9eb5366d72d
printf: refactor macros to function

* src/printf.c (struct arg_cursor): New struct.
(get_curr_arg): New function.
(print_formatted): Use it instead of ...
(GET_CURR_ARG, SET_CURR_ARG): ... these removed macros.
This makes the code a bit easier to follow, and any efficiency
cost should be minimal.
src/printf.c