feat: reformatted code
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
/*
|
||||
* Integer to string
|
||||
*/
|
||||
void print_int(u32 value, u32 width, char* buf, u32 *ptr, u8 base) {
|
||||
void print_int(u32 value, u32 width, char *buf, u32 *ptr, u8 base) {
|
||||
// u32 in binary is 32 digits, so never longer than 33 digits
|
||||
char msg[33];
|
||||
itoa(value, msg, base);
|
||||
@@ -53,13 +53,13 @@ u32 vasprintf(char *buf, const char *fmt, va_list args) {
|
||||
break;
|
||||
}
|
||||
case 'c':
|
||||
buf[ptr++] = (char)va_arg(args, int);
|
||||
buf[ptr++] = (char) va_arg(args, int);
|
||||
break;
|
||||
case 'x':
|
||||
print_int((u32)va_arg(args, u32), arg_width, buf, &ptr, 16);
|
||||
print_int((u32) va_arg(args, u32), arg_width, buf, &ptr, 16);
|
||||
break;
|
||||
case 'd':
|
||||
print_int((u32)va_arg(args, u32), arg_width, buf, &ptr, 10);
|
||||
print_int((u32) va_arg(args, u32), arg_width, buf, &ptr, 10);
|
||||
break;
|
||||
case '%':
|
||||
buf[ptr++] = '%';
|
||||
@@ -85,7 +85,7 @@ int printf(const char *fmt, ...) {
|
||||
return result;
|
||||
}
|
||||
|
||||
int sprintf(char* target, const char*fmt, ...) {
|
||||
int sprintf(char *target, const char *fmt, ...) {
|
||||
int result;
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
Reference in New Issue
Block a user