feat: Vfs and Ext2 support. Code style/attribute improvements

Added VFS and Ext2 support.
Optimized attributes of methods to improve code highlighting.
Printf attribute, malloc attribute, etc.
This commit is contained in:
2021-10-06 21:45:15 +02:00
parent 073051c99e
commit 03f0ec6f88
24 changed files with 1322 additions and 90 deletions

View File

@@ -68,6 +68,11 @@ uint32_t vasprintf(char *buf, const char *fmt, va_list args) {
++i;
}
}
int l = 0;
while (fmt[i] == 'l') {
l++;
i++;
}
switch (fmt[i]) {
case 's': { // string
uint32_t j = 0;
@@ -87,7 +92,12 @@ uint32_t vasprintf(char *buf, const char *fmt, va_list args) {
case 'x':
case 'p':
case 'X': // todo capitalize
print_int((uint32_t) va_arg(args, uint32_t), field_width, buf, &ptr, 16);
if (l == 0 || l == 1) {
print_int((uint32_t) va_arg(args, uint32_t), field_width, buf, &ptr, 16);
} else if (l == 2) {
print_int((uint64_t) va_arg(args, uint64_t), field_width, buf, &ptr, 16);
}
// todo error
break;
case 'i':
case 'd':