mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Update.
2004-06-05 Ulrich Drepper <drepper@redhat.com> * 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.
This commit is contained in:
@@ -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 <tege@matematik.su.se>
|
||||
@@ -165,6 +165,42 @@ extern const char _itoa_upper_digits[];
|
||||
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;
|
||||
|
Reference in New Issue
Block a user