[libc][stdio] cleanup printf definition and clients
Move implementation to stdio.c to sit next to the other stdio definitions that use the debug output functions. Keep the declaration of it, though, in printf.h to sit next to sprintf, etc. Don't include printf.h directly in other places, rely on stdio.h to properly pull in these functions. Change-Id: I357cb04a5c78185b8fde908193b672326c2ee542 Signed-off-by: Dima Zavin <dima@android.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <app.h>
|
||||
#include <kernel/thread.h>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <app.h>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <rand.h>
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <rand.h>
|
||||
#include <err.h>
|
||||
#include <app/tests.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <rand.h>
|
||||
#include <err.h>
|
||||
#include <app/tests.h>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <app/tests.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void printf_tests(void)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <compiler.h>
|
||||
#include <stdint.h>
|
||||
#include <kernel/thread.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
#include <trace.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <dev/net/smc91c96.h>
|
||||
#include "smc91c96_p.h"
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <stddef.h>
|
||||
#include <compiler.h>
|
||||
#include <platform/debug.h>
|
||||
#include <printf.h>
|
||||
|
||||
__BEGIN_CDECLS
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define __DEV_USBC_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <hw/usb.h>
|
||||
|
||||
void usbc_init(void);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <compiler.h>
|
||||
#include <debug.h>
|
||||
#include <stddef.h>
|
||||
|
||||
__BEGIN_CDECLS
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <stddef.h>
|
||||
#include <malloc.h>
|
||||
#include <printf.h>
|
||||
#include <endian.h>
|
||||
#include <rand.h>
|
||||
#include <arch/defines.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifndef __TRACE_H
|
||||
#define __TRACE_H
|
||||
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* trace routines */
|
||||
#define TRACE_ENTRY printf("%s: entry\n", __PRETTY_FUNCTION__)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
*/
|
||||
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <kernel/timer.h>
|
||||
#include <kernel/debug.h>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <lib/console.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <ctype.h>
|
||||
#include <debug.h>
|
||||
#include <stdlib.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform.h>
|
||||
#include <lib/cksum.h>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <debug.h>
|
||||
#include <stdlib.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <list.h>
|
||||
#include <string.h>
|
||||
#include <arch/ops.h>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <ctype.h>
|
||||
#include <debug.h>
|
||||
#include <stdlib.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <list.h>
|
||||
#include <string.h>
|
||||
#include <arch/ops.h>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <string.h>
|
||||
#include <lib/console.h>
|
||||
#include <lib/fs.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <platform.h>
|
||||
|
||||
|
||||
@@ -22,25 +22,13 @@
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <printf.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <platform/debug.h>
|
||||
|
||||
int _printf(const char *fmt, ...)
|
||||
{
|
||||
int err;
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
err = _dvprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int sprintf(char *str, const char *fmt, ...)
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -67,3 +67,14 @@ int getchar(void)
|
||||
return getc(stdin);
|
||||
}
|
||||
|
||||
int _printf(const char *fmt, ...)
|
||||
{
|
||||
int err;
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
err = _dvprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <compiler.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/armemu/memmap.h>
|
||||
#include <platform/debug.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/debug.h>
|
||||
#include <arch/ops.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <kernel/timer.h>
|
||||
#include <platform/debug.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <arch/x86.h>
|
||||
#include <lib/cbuf.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/debug.h>
|
||||
#include <platform/realview-pb.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <lib/cbuf.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/debug.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <lib/cbuf.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/debug.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/debug.h>
|
||||
#include <arch/ops.h>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <reg.h>
|
||||
#include <debug.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <platform/debug.h>
|
||||
#include <arch/ops.h>
|
||||
|
||||
Reference in New Issue
Block a user