From 40c38b6c9d4b49d509630dccb55cf529b3da3d89 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 6 Jun 2004 06:06:02 +0000 Subject: Update. 2004-06-05 Ulrich Drepper * stdio-common/_itoa.h: Don't expand _itoa inline for libc. * stdio-common/_itoa.c: Add _itoa implementation. * nscd/nscd_gethst_r.c (__nscd_open_socket): Change implementation to also send request. Add parameter to allow this. Change callers. * nscd/nscd_getgr_r.c: Change __nscd_open_socket caller. * nscd/nscd_getpw_r.c: Likewise. * nscd/nscd-client.h: Change __nscd_open_socket prototype. --- stdio-common/_itoa.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'stdio-common') diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c index e39d88d..f61b23f 100644 --- a/stdio-common/_itoa.c +++ b/stdio-common/_itoa.c @@ -1,5 +1,5 @@ /* Internal function for converting integers to ASCII. - Copyright (C) 1994, 1995, 1996, 1999, 2000, 2002, 2003 + Copyright (C) 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Torbjorn Granlund @@ -166,6 +166,42 @@ extern const char _itoa_upper_digits_internal[] attribute_hidden; char * +_itoa_word (unsigned long value, char *buflim, + unsigned int base, int upper_case) +{ + const char *digits = (upper_case +#if !defined NOT_IN_libc || defined IS_IN_rtld + ? INTUSE(_itoa_upper_digits) + : INTUSE(_itoa_lower_digits) +#else + ? _itoa_upper_digits + : _itoa_lower_digits +#endif + ); + + switch (base) + { +#define SPECIAL(Base) \ + case Base: \ + do \ + *--buflim = digits[value % Base]; \ + while ((value /= Base) != 0); \ + break + + SPECIAL (10); + SPECIAL (16); + SPECIAL (8); + default: + do + *--buflim = digits[value % base]; + while ((value /= base) != 0); + } + return buflim; +} +#undef SPECIAL + + +char * _itoa (value, buflim, base, upper_case) unsigned long long int value; char *buflim; -- cgit v1.1