@@ -21,18 +21,18 @@ int puts(const char *str) {
2121}
2222
2323// Formats for printf
24- typedef enum Format {
24+ typedef enum printf_format {
2525 NORMAL ,
2626 HEX ,
2727 UPPER_HEX ,
2828 OCTAL ,
2929 BINARY ,
3030 POINTER ,
31- } Format ;
31+ } printf_format ;
3232
33- typedef struct Format_Info {
33+ typedef struct printf_format_info {
3434 int bytes ;
35- Format format ;
35+ printf_format format ;
3636 bool is_signed ;
3737 bool alternate_format ;
3838 bool print_plus ;
@@ -46,9 +46,10 @@ typedef struct Format_Info {
4646 } direction ;
4747 char c ;
4848 } pad ;
49- } Format_Info ;
49+ } printf_format_info ;
5050
51- static size_t format_int (char * buf , uint64_t raw_value , Format_Info fmt ) {
51+ static size_t format_int (
52+ char * buf , uint64_t raw_value , printf_format_info fmt ) {
5253 int base = 0 ;
5354 const char * charset = __lower_hex_charset ;
5455
@@ -241,8 +242,8 @@ static size_t format_int(char *buf, uint64_t raw_value, Format_Info fmt) {
241242 }
242243}
243244
244- ssize_t format_string (
245- Format_Info format , bool constrain_string_len , const char * str , char * buf ) {
245+ ssize_t format_string (printf_format_info format , bool constrain_string_len ,
246+ const char * str , char * buf ) {
246247 ssize_t buf_ix = 0 ;
247248
248249 if (format .pad .len || constrain_string_len ) {
@@ -285,7 +286,8 @@ ssize_t format_string(
285286 return buf_ix ;
286287}
287288
288- static size_t format_float (char * buf , double raw_value , Format_Info fmt ) {
289+ static size_t format_float (
290+ char * buf , double raw_value , printf_format_info fmt ) {
289291 long int_part = (long )raw_value ;
290292 long fractional_part = labs ((long )(raw_value * 1000 ) % 1000 );
291293
@@ -318,7 +320,7 @@ int vsprintf(char *buf, const char *fmt, va_list args) {
318320 bool do_print_int = false;
319321 bool do_print_float = false;
320322 bool constrain_string_len = false;
321- Format_Info format = {
323+ printf_format_info format = {
322324 .bytes = 4 ,
323325 .is_signed = false,
324326 .alternate_format = false,
0 commit comments