summaryrefslogtreecommitdiff
path: root/stdio-common/_itoa.h
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/_itoa.h')
-rw-r--r--stdio-common/_itoa.h22
1 files changed, 21 insertions, 1 deletions
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 */