From c5e340c71ba6f4563ca5fa245baa82b6363ddb2e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 29 Oct 1998 15:17:25 +0000 Subject: Update. 1998-10-29 Ulrich Drepper * sysdeps/unix/sysv/linux/ttyname_r.c (ttyname_r): Try reading /prof/self/fd/FD first. * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Likewise. * stdio-common/_itoa.h (_fitoa_word): New inline function. Write formatted number starting at given position and return pointer to following byte. (_fitoa): Likewise, for long long. --- stdio-common/_itoa.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'stdio-common') diff --git a/stdio-common/_itoa.h b/stdio-common/_itoa.h index 2794912c91..976636907d 100644 --- a/stdio-common/_itoa.h +++ b/stdio-common/_itoa.h @@ -1,5 +1,5 @@ /* Internal function for converting integers to ASCII. - Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -57,4 +57,24 @@ _itoa_word (unsigned long value, char *buflim, return bp; } +static inline char * __attribute__ ((unused)) +_fitoa_word (unsigned long value, char *buf, unsigned int base, int upper_case) +{ + char tmpbuf[sizeof (value) * 4]; /* Worst case length: base 2. */ + char *cp = _itoa_word (value, tmpbuf + sizeof (value) * 4, base, upper_case); + while (cp < tmpbuf + sizeof (value) * 4) + *buf++ = *cp++; + return buf; +} + +static inline char * __attribute__ ((unused)) +_fitoa (unsigned long long value, char *buf, unsigned int base, int upper_case) +{ + char tmpbuf[sizeof (value) * 4]; /* Worst case length: base 2. */ + char *cp = _itoa (value, tmpbuf + sizeof (value) * 4, base, upper_case); + while (cp < tmpbuf + sizeof (value) * 4) + *buf++ = *cp++; + return buf; +} + #endif /* itoa.h */ -- cgit v1.2.3