diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-10 23:29:33 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-10 23:29:33 -0400 |
commit | 4c1d03b082f4972c02f5794976f4651fc5f85795 (patch) | |
tree | 0301195d09650346c91bd530a2eef735f98aea86 /kernel/include/lib | |
parent | make lib betterer (diff) | |
download | comus-4c1d03b082f4972c02f5794976f4651fc5f85795.tar.gz comus-4c1d03b082f4972c02f5794976f4651fc5f85795.tar.bz2 comus-4c1d03b082f4972c02f5794976f4651fc5f85795.zip |
fmt
Diffstat (limited to 'kernel/include/lib')
-rw-r--r-- | kernel/include/lib/kio.h | 9 | ||||
-rw-r--r-- | kernel/include/lib/klib.h | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/kernel/include/lib/kio.h b/kernel/include/lib/kio.h index ef22f95..66efc7b 100644 --- a/kernel/include/lib/kio.h +++ b/kernel/include/lib/kio.h @@ -44,7 +44,7 @@ __attribute__((format(printf, 1, 2))) int kprintf(const char *format, ...); * @returns number of bytes written */ __attribute__((format(printf, 2, 3))) int ksprintf(char *restrict s, - const char *format, ...); + const char *format, ...); /** * prints out a formatted string to a buffer with a given max length @@ -56,9 +56,8 @@ __attribute__((format(printf, 2, 3))) int ksprintf(char *restrict s, * @returns number of bytes written * @returns number of bytes that would of been written (past maxlen) */ -__attribute__((format(printf, 3, 4))) int ksnprintf(char *restrict s, - size_t maxlen, - const char *format, ...); +__attribute__((format(printf, 3, 4))) int +ksnprintf(char *restrict s, size_t maxlen, const char *format, ...); /** * prints out a formatted string @@ -89,6 +88,6 @@ int kvsprintf(char *restrict s, const char *format, va_list args); * @returns number of bytes that would of been written (past maxlen) */ int kvsnprintf(char *restrict s, size_t maxlen, const char *format, - va_list args); + va_list args); #endif /* kio.h */ diff --git a/kernel/include/lib/klib.h b/kernel/include/lib/klib.h index cb1de01..7f66e90 100644 --- a/kernel/include/lib/klib.h +++ b/kernel/include/lib/klib.h @@ -189,7 +189,12 @@ unsigned int bound(unsigned int min, unsigned int value, unsigned int max); #define __PANIC_STR2(x) #x #define panic(...) __panic(__PANIC_STR(__LINE__), __FILE__, __VA_ARGS__) -#define assert(val, ...) do { if (!(val)) { panic(__VA_ARGS__); } } while (0) +#define assert(val, ...) \ + do { \ + if (!(val)) { \ + panic(__VA_ARGS__); \ + } \ + } while (0) /** * Abort the kernel with a given message. @@ -197,8 +202,8 @@ unsigned int bound(unsigned int min, unsigned int value, unsigned int max); * @param format - the format string * @param ... - variable args for the format */ -__attribute__((noreturn, format(printf, 3, 4))) -void __panic(const char *line, const char *file, const char *format, ...); +__attribute__((noreturn, format(printf, 3, 4))) void +__panic(const char *line, const char *file, const char *format, ...); /** * Fill dst with a stack trace consisting of return addresses in order |