svn commit: trunk/uClibc/libc/stdio

psm at uclibc.org psm at uclibc.org
Fri Dec 16 00:41:20 UTC 2005


Author: psm
Date: 2005-12-15 16:38:38 -0800 (Thu, 15 Dec 2005)
New Revision: 12913

Log:
Get rid of warnings, use internals, create new hidden versions

Modified:
   trunk/uClibc/libc/stdio/_stdio.h
   trunk/uClibc/libc/stdio/fgets.c
   trunk/uClibc/libc/stdio/fgetwc.c
   trunk/uClibc/libc/stdio/fopen.c
   trunk/uClibc/libc/stdio/fopen64.c
   trunk/uClibc/libc/stdio/fputs.c
   trunk/uClibc/libc/stdio/fputws.c
   trunk/uClibc/libc/stdio/getwchar.c
   trunk/uClibc/libc/stdio/old_vfprintf.c
   trunk/uClibc/libc/stdio/popen.c
   trunk/uClibc/libc/stdio/putwchar.c
   trunk/uClibc/libc/stdio/scanf.c
   trunk/uClibc/libc/stdio/vfprintf.c


Changeset:
Modified: trunk/uClibc/libc/stdio/_stdio.h
===================================================================
--- trunk/uClibc/libc/stdio/_stdio.h	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/_stdio.h	2005-12-16 00:38:38 UTC (rev 12913)
@@ -398,6 +398,7 @@
 extern int __ferror_unlocked(FILE *stream);
 
 extern int __fgetc_unlocked_internal(FILE *stream) attribute_hidden;
+extern int __getc_unlocked(FILE *stream) attribute_hidden;
 extern char *__fgets_unlocked(char *__restrict s, int n,
 					FILE * __restrict stream) attribute_hidden;
 

Modified: trunk/uClibc/libc/stdio/fgets.c
===================================================================
--- trunk/uClibc/libc/stdio/fgets.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/fgets.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -58,15 +58,16 @@
 	return NULL;
 }
 
-weak_alias(__fgets_unlocked,fgets_unlocked);
+weak_alias(__fgets_unlocked,fgets_unlocked)
 
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fgets_unlocked,fgets);
+hidden_strong_alias(__fgets_unlocked,__fgets)
+weak_alias(__fgets_unlocked,fgets)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-char *fgets(char *__restrict s, int n,
+char attribute_hidden *__fgets(char *__restrict s, int n,
 			register FILE * __restrict stream)
 {
 	char *retval;
@@ -80,5 +81,6 @@
 
 	return retval;
 }
+strong_alias(__fgets,fgets)
 
 #endif

Modified: trunk/uClibc/libc/stdio/fgetwc.c
===================================================================
--- trunk/uClibc/libc/stdio/fgetwc.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/fgetwc.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -108,16 +108,17 @@
 	return wi;
 }
 
-weak_alias(__fgetwc_unlocked,fgetwc_unlocked);
-weak_alias(__fgetwc_unlocked,getwc_unlocked);
+weak_alias(__fgetwc_unlocked,fgetwc_unlocked)
+weak_alias(__fgetwc_unlocked,getwc_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fgetwc_unlocked,fgetwc);
-weak_alias(__fgetwc_unlocked,getwc);
+hidden_strong_alias(__fgetwc_unlocked,__fgetwc)
+weak_alias(__fgetwc_unlocked,fgetwc)
+weak_alias(__fgetwc_unlocked,getwc)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-wint_t fgetwc(register FILE *stream)
+wint_t attribute_hidden __fgetwc(register FILE *stream)
 {
 	wint_t retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -130,7 +131,7 @@
 
 	return retval;
 }
+strong_alias(__fgetwc,fgetwc)
+weak_alias(__fgetwc,getwc)
 
-weak_alias(fgetwc,getwc);
-
 #endif

Modified: trunk/uClibc/libc/stdio/fopen.c
===================================================================
--- trunk/uClibc/libc/stdio/fopen.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/fopen.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -9,8 +9,10 @@
 
 #ifndef __DO_LARGEFILE
 # define FILEDES_ARG    (-1)
+#undef __fopen
 #undef fopen
 #else
+#undef __fopen64
 #undef fopen64
 #endif
 

Modified: trunk/uClibc/libc/stdio/fopen64.c
===================================================================
--- trunk/uClibc/libc/stdio/fopen64.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/fopen64.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -9,6 +9,7 @@
 
 #define __DO_LARGEFILE
 #define __fopen       __fopen64
+#undef fopen
 #define fopen         fopen64
 #define FILEDES_ARG   (-2)
 #include "fopen.c"

Modified: trunk/uClibc/libc/stdio/fputs.c
===================================================================
--- trunk/uClibc/libc/stdio/fputs.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/fputs.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -22,14 +22,15 @@
 	return ((__fwrite_unlocked(s, 1, n, stream) == n) ? n : EOF);
 }
 
-weak_alias(__fputs_unlocked,fputs_unlocked);
+weak_alias(__fputs_unlocked,fputs_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__fputs_unlocked,fputs);
+hidden_strong_alias(__fputs_unlocked,__fputs)
+weak_alias(__fputs_unlocked,fputs)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-int fputs(const char * __restrict s, register FILE * __restrict stream)
+int attribute_hidden __fputs(const char * __restrict s, register FILE * __restrict stream)
 {
 	int retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -42,5 +43,6 @@
 
 	return retval;
 }
+strong_alias(__fputs,fputs)
 
 #endif

Modified: trunk/uClibc/libc/stdio/fputws.c
===================================================================
--- trunk/uClibc/libc/stdio/fputws.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/fputws.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -9,9 +9,6 @@
 
 #include "_stdio.h"
 
-extern int __fputws_unlocked(const wchar_t *__restrict ws,
-					FILE *__restrict stream) attribute_hidden;
-
 #ifdef __DO_UNLOCKED
 
 int attribute_hidden __fputws_unlocked(const wchar_t *__restrict ws,
@@ -24,12 +21,16 @@
 
 weak_alias(__fputws_unlocked,fputws_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
+hidden_strong_alias(__fputws_unlocked,__fputws)
 weak_alias(__fputws_unlocked,fputws)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
-int fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
+extern int __fputws_unlocked(const wchar_t *__restrict ws,
+					FILE *__restrict stream) attribute_hidden;
+
+int attribute_hidden __fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
 {
 	int retval;
 	__STDIO_AUTO_THREADLOCK_VAR;
@@ -42,5 +43,6 @@
 
 	return retval;
 }
+strong_alias(__fputws,fputws)
 
 #endif

Modified: trunk/uClibc/libc/stdio/getwchar.c
===================================================================
--- trunk/uClibc/libc/stdio/getwchar.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/getwchar.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -14,16 +14,18 @@
 	return __fgetwc_unlocked(stdin);
 }
 
-weak_alias(__getwchar_unlocked,getwchar_unlocked);
+weak_alias(__getwchar_unlocked,getwchar_unlocked)
 #ifndef __UCLIBC_HAS_THREADS__
-weak_alias(__getwchar_unlocked,getwchar);
+weak_alias(__getwchar_unlocked,getwchar)
 #endif
 
 #elif defined __UCLIBC_HAS_THREADS__
 
+extern wint_t __fgetwc (__FILE *__stream) attribute_hidden;
+
 wint_t getwchar(void)
 {
-	return fgetwc(stdin);
+	return __fgetwc(stdin);
 }
 
 #endif

Modified: trunk/uClibc/libc/stdio/old_vfprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/old_vfprintf.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/old_vfprintf.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -166,7 +166,7 @@
 
 #ifdef __STDIO_BUFFERS
 
-#define PUTC(C,F)      putc_unlocked((C),(F))
+#define PUTC(C,F)      __putc_unlocked((C),(F))
 #define OUTNSTR        _outnstr
 #define _outnstr(stream, string, len)	__stdio_fwrite(string, len, stream)
 
@@ -199,7 +199,7 @@
 static void putc_unlocked_sprintf(int c, __FILE_vsnprintf *f)
 {
 	if (!__STDIO_STREAM_IS_FAKE_VSNPRINTF_NB(&f->f)) {
-		putc_unlocked(c, &f->f);
+		__putc_unlocked(c, &f->f);
 	} else if (f->bufpos < f->bufend) {
 		*f->bufpos++ = c;
 	}

Modified: trunk/uClibc/libc/stdio/popen.c
===================================================================
--- trunk/uClibc/libc/stdio/popen.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/popen.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -19,6 +19,8 @@
 #define dup2 __dup2
 #define fdopen __fdopen
 #define pipe __pipe
+#define vfork __vfork
+#define fork __fork
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -109,7 +111,7 @@
 
 		/* SUSv3 mandates an exit code of 127 for the child if the
 		 * command interpreter can not be invoked. */
-		_exit(127);
+		_exit_internal(127);
 	}
 	VFORK_UNLOCK;
 

Modified: trunk/uClibc/libc/stdio/putwchar.c
===================================================================
--- trunk/uClibc/libc/stdio/putwchar.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/putwchar.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -21,9 +21,11 @@
 
 #elif defined __UCLIBC_HAS_THREADS__
 
+extern int __fputc (int __c, FILE *__stream) attribute_hidden;
+
 wint_t putwchar(wchar_t wc)
 {
-	return fputc(wc, stdout);
+	return __fputc(wc, stdout);
 }
 
 #endif

Modified: trunk/uClibc/libc/stdio/scanf.c
===================================================================
--- trunk/uClibc/libc/stdio/scanf.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/scanf.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -595,7 +595,7 @@
 #ifdef __UCLIBC_HAS_WCHAR__
 #define GETC(SC) (SC)->sc_getc((SC))
 #else  /* __UCLIBC_HAS_WCHAR__ */
-#define GETC(SC) getc_unlocked((SC)->fp)
+#define GETC(SC) __getc_unlocked((SC)->fp)
 #endif /* __UCLIBC_HAS_WCHAR__ */
 #endif
 
@@ -959,7 +959,7 @@
 #ifdef L_vfscanf
 static int sc_getc(register struct scan_cookie *sc)
 {
-	return (getc_unlocked)(sc->fp);	/* Disable the macro. */
+	return (__getc_unlocked)(sc->fp);	/* Disable the macro. */
 }
 
 static int scan_getwc(register struct scan_cookie *sc)

Modified: trunk/uClibc/libc/stdio/vfprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vfprintf.c	2005-12-16 00:35:09 UTC (rev 12912)
+++ trunk/uClibc/libc/stdio/vfprintf.c	2005-12-16 00:38:38 UTC (rev 12913)
@@ -95,6 +95,7 @@
 #define mbsrtowcs __mbsrtowcs
 #define btowc __btowc
 #define wcrtomb __wcrtomb
+#define fputws __fputws
 
 #define _ISOC99_SOURCE			/* for ULLONG primarily... */
 #define _GNU_SOURCE




More information about the uClibc-cvs mailing list