From 169daa11155988a210fac949297381743f3cb400 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 9 Dec 2025 23:14:53 +0100 Subject: feat: clang-tidy fixes --- lib/libc/stdio/fopen.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/libc/stdio/fopen.c') diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c index a56b907d..bef21f46 100644 --- a/lib/libc/stdio/fopen.c +++ b/lib/libc/stdio/fopen.c @@ -1,11 +1,10 @@ -#include "__stdio.h" // for __libc_fadd +#include "__stdio.h" // for __FILE, __libc_fadd #include "features.h" // for __weak #include "stdatomic.h" // for atomic_flag_clear #include "stddef.h" // for NULL #include // for EINVAL, errno #include // for O_WRONLY, O_CREAT, O_RDONLY, open, O_APPEND -#include // for __IMPL #include // for FILE, BUFSIZ, fopen, _IOLBF #include // for calloc, free, malloc #include // for strchr @@ -43,13 +42,13 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode) if ((stream = calloc(1, sizeof(FILE))) == NULL) return NULL; - __IMPL(stream)->fd = fd; - __IMPL(stream)->buf_size = BUFSIZ; - __IMPL(stream)->flags = flags; - __IMPL(stream)->type = _IOLBF; - atomic_flag_clear(&stream->lock); + __FILE(stream)->fd = fd; + __FILE(stream)->buf_size = BUFSIZ; + __FILE(stream)->flags = flags; + __FILE(stream)->type = _IOLBF; + atomic_flag_clear(&__FILE(stream)->lock); - if ((__IMPL(stream)->buf = malloc(BUFSIZ)) == NULL) { + if ((__FILE(stream)->buf = malloc(BUFSIZ)) == NULL) { close(fd); free(stream); return NULL; -- cgit v1.2.3