summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio')
-rw-r--r--src/stdio/__printf.c2
-rw-r--r--src/stdio/__scanf.c2
-rw-r--r--src/stdio/__stdio_h.c (renamed from src/stdio/__stdio.c)2
-rw-r--r--src/stdio/_stdio.h6
-rw-r--r--src/stdio/fflush.c2
-rw-r--r--src/stdio/fopen.c4
6 files changed, 8 insertions, 10 deletions
diff --git a/src/stdio/__printf.c b/src/stdio/__printf.c
index 05c79747..807e0948 100644
--- a/src/stdio/__printf.c
+++ b/src/stdio/__printf.c
@@ -344,7 +344,7 @@ int (__printf)(struct io_options *opt, const char * format, va_list arg)
nout = __append(s, "0x", nout, n);
__itos(numbuf, (intptr_t)argptr, ZERO, sizeof(argptr) * 2, 16);
nout = __append(s, numbuf, nout, n);
- ADD_PREV_STRING(s_to_track, __stdio.formatted_pointers, __stdio.nformatted_pointers);
+ ADD_PREV_STRING(s_to_track, __stdio_h.formatted_pointers, __stdio_h.nformatted_pointers);
break;
case 'n': /* write-back */
diff --git a/src/stdio/__scanf.c b/src/stdio/__scanf.c
index 75e42942..9869fa37 100644
--- a/src/stdio/__scanf.c
+++ b/src/stdio/__scanf.c
@@ -253,7 +253,7 @@ int __scanf(struct io_options *opt, const char * format, va_list arg)
/* TODO: error checking */
str_ptr[i] = __get(opt);
}
- ASSERT_PREV_STRING(str_ptr, __stdio.formatted_pointers, __stdio.nformatted_pointers, "printf() or similar");
+ ASSERT_PREV_STRING(str_ptr, __stdio_h.formatted_pointers, __stdio_h.nformatted_pointers, "printf() or similar");
void **ptr = va_arg(arg, void **);
if (ptr == NULL) {
UNDEFINED("parameter is NULL");
diff --git a/src/stdio/__stdio.c b/src/stdio/__stdio_h.c
index d77e01dc..d553908f 100644
--- a/src/stdio/__stdio.c
+++ b/src/stdio/__stdio_h.c
@@ -1,6 +1,6 @@
#include "_stdio.h"
-struct __stdio __stdio = { 0 };
+struct __stdio_h __stdio_h = { 0 };
/*
STDC(0)
diff --git a/src/stdio/_stdio.h b/src/stdio/_stdio.h
index 57d33e63..cdd8fb47 100644
--- a/src/stdio/_stdio.h
+++ b/src/stdio/_stdio.h
@@ -128,13 +128,11 @@ size_t __conv(const char *, struct io_conversion *);
int __printf(struct io_options * restrict, const char * restrict, va_list);
int __scanf(struct io_options * restrict, const char * restrict, va_list);
-struct __stdio {
+extern struct __stdio_h {
struct __FILE FILES[FOPEN_MAX];
char **formatted_pointers;
size_t nformatted_pointers;
-};
-
-extern struct __stdio __stdio;
+} __stdio_h;
/*
STDC(-1)
diff --git a/src/stdio/fflush.c b/src/stdio/fflush.c
index a1e984f9..010e2e43 100644
--- a/src/stdio/fflush.c
+++ b/src/stdio/fflush.c
@@ -13,7 +13,7 @@ int fflush(FILE *stream)
if (stream == NULL) {
size_t i;
for (i = 0; i < FOPEN_MAX; i++) {
- stream = __stdio.FILES + i;
+ stream = __stdio_h.FILES + i;
if (stream->write && (stream->operation != OP_INPUT)) {
fflush(stream);
}
diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c
index dfb4f27c..824c8f30 100644
--- a/src/stdio/fopen.c
+++ b/src/stdio/fopen.c
@@ -15,8 +15,8 @@ FILE * fopen(const char * restrict filename, const char * restrict mode)
ASSERT_NOOVERLAP(filename, strlen(filename), mode, strlen(mode));
for (i = 0; i < FOPEN_MAX; i++) {
- if (__stdio.FILES[i].bmode == 0) {
- f = &(__stdio.FILES[i]);
+ if (__stdio_h.FILES[i].bmode == 0) {
+ f = &(__stdio_h.FILES[i]);
break;
}
}