Remove use of INTDEF/INTUSE in stdio-common

This commit is contained in:
Andreas Schwab 2012-05-29 23:55:13 +02:00
parent 12e5e0f357
commit 5be8418cb0
12 changed files with 54 additions and 66 deletions

View File

@ -1,3 +1,24 @@
2012-06-01 Andreas Schwab <schwab@linux-m68k.org>
[BZ #14132]
* elf/dl-reloc.c: Include <_itoa.h>.
(_dl_reloc_bad_type): Remove use of INTUSE.
* elf/dl-minimal.c (_itoa, _itoa_lower_digits): Likewise.
* stdio-common/_itoa.c (_itoa_word, _itoa): Likewise.
* stdio-common/psiginfo.c (psiginfo): Likewise.
* stdio-common/psignal.c (psignal): Likewise.
* string/strsignal.c (strsignal): Likewise.
* include/signal.h (_sys_siglist): Declare hidden proto.
* stdio-common/itoa-digits.c: Include <_itoa.h>. Replace
INTVARDEF with libc_hidden_data_def.
* stdio-common/itoa-udigits.c: Likewise.
* sysdeps/generic/_itoa.h (_itoa_upper_digits_internal)
(_itoa_lower_digits_internal): Remove declaration.
(_itoa_upper_digits, _itoa_lower_digits): Declare hidden proto.
* sysdeps/gnu/siglist.c (_sys_siglist_internal)
(_sys_sigabbrev_internal): Remove aliases.
(_sys_siglist): Define hidden alias.
2012-05-31 Markus Trippelsdorf <markus@trippelsdorf.de>
* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add

View File

@ -315,12 +315,10 @@ _itoa (value, buflim, base, upper_case)
unsigned int base;
int upper_case;
{
extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
assert (! upper_case);
do
*--buflim = INTUSE(_itoa_lower_digits)[value % base];
*--buflim = _itoa_lower_digits[value % base];
while ((value /= base) != 0);
return buflim;
@ -380,5 +378,5 @@ rtld_hidden_def (__chk_fail)
/* The '_itoa_lower_digits' variable in libc.so is able to handle bases
up to 36. We don't need this here. */
const char INTUSE(_itoa_lower_digits)[16] attribute_hidden
= "0123456789abcdef";
const char _itoa_lower_digits[16] = "0123456789abcdef";
rtld_hidden_data_def (_itoa_lower_digits)

View File

@ -1,5 +1,5 @@
/* Relocate a shared object and resolve its references to other loaded objects.
Copyright (C) 1995-2006, 2008-2010, 2011 Free Software Foundation, Inc.
Copyright (C) 1995-2012 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
@ -24,6 +24,7 @@
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/types.h>
#include <_itoa.h>
#include "dynamic-link.h"
/* Statistics function. */
@ -338,8 +339,7 @@ void
internal_function __attribute_noinline__
_dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
{
extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
#define DIGIT(b) INTUSE(_itoa_lower_digits)[(b) & 0xf];
#define DIGIT(b) _itoa_lower_digits[(b) & 0xf];
/* XXX We cannot translate these messages. */
static const char msg[2][32

View File

@ -14,6 +14,7 @@ libc_hidden_proto (__sigpause)
libc_hidden_proto (raise)
libc_hidden_proto (__libc_current_sigrtmin)
libc_hidden_proto (__libc_current_sigrtmax)
libc_hidden_proto (_sys_siglist)
/* Now define the internal interfaces. */
extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler);

View File

@ -1,6 +1,5 @@
/* Internal function for converting integers to ASCII.
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2007
Free Software Foundation, Inc.
Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund <tege@matematik.su.se>
and Ulrich Drepper <drepper@gnu.org>.
@ -160,27 +159,13 @@ const struct base_table_t _itoa_base_table[] attribute_hidden =
};
#endif
/* Lower-case digits. */
extern const char _itoa_lower_digits[];
extern const char _itoa_lower_digits_internal[] attribute_hidden;
/* Upper-case digits. */
extern const char _itoa_upper_digits[];
extern const char _itoa_upper_digits_internal[] attribute_hidden;
char *
_itoa_word (_ITOA_WORD_TYPE 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
);
: _itoa_lower_digits);
switch (base)
{
@ -213,8 +198,8 @@ _itoa (value, buflim, base, upper_case)
int upper_case;
{
const char *digits = (upper_case
? INTUSE(_itoa_upper_digits)
: INTUSE(_itoa_lower_digits));
? _itoa_upper_digits
: _itoa_lower_digits);
const struct base_table_t *brec = &_itoa_base_table[base - 2];
switch (base)

View File

@ -1,5 +1,5 @@
/* Digits.
Copyright (C) 1994,1995,1996,1999,2000,2002 Free Software Foundation, Inc.
Copyright (C) 1994-2012 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
@ -16,7 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <_itoa.h>
/* Lower-case digits. */
const char _itoa_lower_digits[36]
= "0123456789abcdefghijklmnopqrstuvwxyz";
INTVARDEF(_itoa_lower_digits)
libc_hidden_data_def (_itoa_lower_digits)

View File

@ -1,5 +1,5 @@
/* Digits.
Copyright (C) 1994,1995,1996,1999,2000,2002 Free Software Foundation, Inc.
Copyright (C) 1994-2012 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
@ -16,7 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <_itoa.h>
/* Upper-case digits. */
const char _itoa_upper_digits[36]
= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
INTVARDEF(_itoa_upper_digits)
libc_hidden_data_def (_itoa_upper_digits)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2009, 2010 Free Software Foundation, Inc.
/* Copyright (C) 2009-2012 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
@ -26,11 +26,6 @@
#include <not-cancel.h>
/* Defined in sys_siglist.c. */
extern const char *const _sys_siglist[];
extern const char *const _sys_siglist_internal[] attribute_hidden;
#define MF(l) MF1 (l)
#define MF1(l) str_##l
#define C(s1, s2) C1 (s1, s2)
@ -84,7 +79,7 @@ psiginfo (const siginfo_t *pinfo, const char *s)
const char *desc;
if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG
&& ((desc = INTUSE(_sys_siglist)[pinfo->si_signo]) != NULL
&& ((desc = _sys_siglist[pinfo->si_signo]) != NULL
#ifdef SIGRTMIN
|| (pinfo->si_signo >= SIGRTMIN && pinfo->si_signo < SIGRTMAX)
#endif

View File

@ -1,5 +1,4 @@
/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 2001, 2002, 2004, 2005, 2009
Free Software Foundation, Inc.
/* Copyright (C) 1991-2012 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
@ -22,12 +21,6 @@
#include <libintl.h>
#include <wchar.h>
/* Defined in sys_siglist.c. */
extern const char *const _sys_siglist[];
extern const char *const _sys_siglist_internal[] attribute_hidden;
/* Print out on stderr a line consisting of the test in S, a colon, a space,
a message describing the meaning of the signal number SIG and a newline.
If S is NULL or "", the colon and space are omitted. */
@ -41,7 +34,7 @@ psignal (int sig, const char *s)
else
colon = ": ";
if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL)
if (sig >= 0 && sig < NSIG && (desc = _sys_siglist[sig]) != NULL)
(void) __fxprintf (NULL, "%s%s%s\n", s, colon, _(desc));
else
{

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1994-2002, 2005 Free Software Foundation, Inc.
/* Copyright (C) 1991-2012 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
@ -22,10 +22,6 @@
#include <libintl.h>
#include <bits/libc-lock.h>
/* Defined in siglist.c. */
extern const char *const _sys_siglist[];
extern const char *const _sys_siglist_internal[] attribute_hidden;
static __libc_key_t key;
/* If nonzero the key allocation failed and we should better use a
@ -55,7 +51,7 @@ strsignal (int signum)
(signum >= SIGRTMIN && signum <= SIGRTMAX) ||
#endif
signum < 0 || signum >= NSIG
|| (desc = INTUSE(_sys_siglist)[signum]) == NULL)
|| (desc = _sys_siglist[signum]) == NULL)
{
char *buffer = getbuffer ();
int len;

View File

@ -1,5 +1,5 @@
/* Internal function for converting integers to ASCII.
Copyright (C) 1994-1999,2002,2003,2007 Free Software Foundation, Inc.
Copyright (C) 1994-2012 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
@ -45,9 +45,11 @@ extern char *_itoa (unsigned long long int value, char *buflim,
unsigned int base, int upper_case);
extern const char _itoa_upper_digits[];
extern const char _itoa_upper_digits_internal[] attribute_hidden;
extern const char _itoa_lower_digits[];
extern const char _itoa_lower_digits_internal[] attribute_hidden;
#if !defined NOT_IN_libc || defined IS_IN_rtld
hidden_proto (_itoa_upper_digits)
hidden_proto (_itoa_lower_digits)
#endif
#ifndef NOT_IN_libc
extern char *_itoa_word (_ITOA_WORD_TYPE value, char *buflim,
@ -58,14 +60,8 @@ _itoa_word (_ITOA_WORD_TYPE value, char *buflim,
unsigned int base, int upper_case)
{
const char *digits = (upper_case
# if defined IS_IN_rtld
? INTUSE(_itoa_upper_digits)
: INTUSE(_itoa_lower_digits)
# else
? _itoa_upper_digits
: _itoa_lower_digits
# endif
);
: _itoa_lower_digits);
switch (base)
{

View File

@ -1,5 +1,5 @@
/* Define list of all signal numbers and their names.
Copyright (C) 1997-2000, 2002, 2003, 2006 Free Software Foundation, Inc.
Copyright (C) 1997-2012 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
@ -28,7 +28,7 @@ const char *const __new_sys_siglist[NSIG] =
#include <siglist.h>
#undef init_sig
};
strong_alias (__new_sys_siglist, _sys_siglist_internal)
libc_hidden_ver (__new_sys_siglist, _sys_siglist)
const char *const __new_sys_sigabbrev[NSIG] =
{
@ -36,7 +36,6 @@ const char *const __new_sys_sigabbrev[NSIG] =
#include <siglist.h>
#undef init_sig
};
strong_alias (__new_sys_sigabbrev, _sys_sigabbrev_internal)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
declare_symbol_alias (__old_sys_siglist, __new_sys_siglist, object,