2000-11-20  Ulrich Drepper  <drepper@redhat.com>

	* csu/gmon-start.c: Always have prototype for __gmon_start.
	* csu/version.c: Add prototypes for __libc_print_version and
	__libc_main.
	* iconv/gconv.c: Include gconv_int.h and gconv.h.
	* iconv/gconv.h (struct __gconv_step): Remove const from __from_name
	and __to_name.
	* iconv/gconv_builtin.h: Add ASCII module definitions.
	* iconv/gconv_conf.c (__gconv_path_elem): Remove const.
	(add_module): Add cast to avoid warning.  Rework construction of
	strings for new module.
	* iconv/gconv_db.c (__gconv_alias_compare): Make s1 and s2 const.
	(derivation_compare): Likewise.
	* iconv/gconv_dl.c (do_release_shlib): Remove const from nodep.
	(__gconv_release_shlib): Cast do_release_shlib as parameter for twalk.
	* iconv/gconv_int.h (__gconv_path_elem): Remove const.
	(struct gconv_alias): Remove const from fromname and toname.
	* iconv/gconv_simple.c: Include gconv_builtin.h to get prototypes
	for loop functions.
	(internal_ucs4_loop): Use correct const-ness.
	(ucs4_internal_loop): Likewise.
	(internal_ucs4le_loop): Likewise.
	(ucs4le_internal_loop_single): Likewise.
	* iconv/gconv_trans.c (__gconv_transliterate): Make from_idx, from_tbl,
	to_idx, to_tbl, winbuf, winbufend const.  Change casts in
	assignments appropriately.
	(struct known_trans): Remove const from fname.
	(trans_compare): Make s1 and s2 const.
	* iconv/loop.c (LOOPFC): Make outend parameter const.  Add cast to
	avoid warning.
	* iconv/skeleton.c: Remove cast in calls of loop functions.
	* iconvdata/gconv-modules: Remove US-ASCII definitions.
	* iconvdata/iso646.c: Remove US_ASCII support.
	* include/set-hooks.h (DEFINE_HOOK): Also generate prototype.
	* include/unistd.h: Add __libc_check_standard_fds prototype.
	* string/bits/string2.h (__mempcpy_args): Add const to casts.
	* sysdeps/generic/initfini.c: Add prototypes for dummy, _init, and
	_fini.
	* sysdeps/generic/libc-start.c: Add prototype for __libc_start_main.
	* sysdeps/i386/i486/bits/string.h (strcmp): Add const to casts.
	* sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Add cast to avoid
	warning.
	* sysdeps/unix/sysv/linux/init-first.c: Add prototypes for
	__libc_init_first and _dl_start.

	* sysdeps/unix/sysv/linux/mips/clone.S: Fix comments.
This commit is contained in:
Ulrich Drepper 2000-11-20 09:16:41 +00:00
parent 1eab136137
commit 17427edd1f
23 changed files with 183 additions and 100 deletions

View File

@ -1,6 +1,52 @@
2000-11-20 Ulrich Drepper <drepper@redhat.com>
* csu/gmon-start.c: Always have prototype for __gmon_start.
* csu/version.c: Add prototypes for __libc_print_version and
__libc_main.
* iconv/gconv.c: Include gconv_int.h and gconv.h.
* iconv/gconv.h (struct __gconv_step): Remove const from __from_name
and __to_name.
* iconv/gconv_builtin.h: Add ASCII module definitions.
* iconv/gconv_conf.c (__gconv_path_elem): Remove const.
(add_module): Add cast to avoid warning. Rework construction of
strings for new module.
* iconv/gconv_db.c (__gconv_alias_compare): Make s1 and s2 const.
(derivation_compare): Likewise.
* iconv/gconv_dl.c (do_release_shlib): Remove const from nodep.
(__gconv_release_shlib): Cast do_release_shlib as parameter for twalk.
* iconv/gconv_int.h (__gconv_path_elem): Remove const.
(struct gconv_alias): Remove const from fromname and toname.
* iconv/gconv_simple.c: Include gconv_builtin.h to get prototypes
for loop functions.
(internal_ucs4_loop): Use correct const-ness.
(ucs4_internal_loop): Likewise.
(internal_ucs4le_loop): Likewise.
(ucs4le_internal_loop_single): Likewise.
* iconv/gconv_trans.c (__gconv_transliterate): Make from_idx, from_tbl,
to_idx, to_tbl, winbuf, winbufend const. Change casts in
assignments appropriately.
(struct known_trans): Remove const from fname.
(trans_compare): Make s1 and s2 const.
* iconv/loop.c (LOOPFC): Make outend parameter const. Add cast to
avoid warning.
* iconv/skeleton.c: Remove cast in calls of loop functions.
* iconvdata/gconv-modules: Remove US-ASCII definitions.
* iconvdata/iso646.c: Remove US_ASCII support.
* include/set-hooks.h (DEFINE_HOOK): Also generate prototype.
* include/unistd.h: Add __libc_check_standard_fds prototype.
* string/bits/string2.h (__mempcpy_args): Add const to casts.
* sysdeps/generic/initfini.c: Add prototypes for dummy, _init, and
_fini.
* sysdeps/generic/libc-start.c: Add prototype for __libc_start_main.
* sysdeps/i386/i486/bits/string.h (strcmp): Add const to casts.
* sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Add cast to avoid
warning.
* sysdeps/unix/sysv/linux/init-first.c: Add prototypes for
__libc_init_first and _dl_start.
2000-11-20 Hiroyuki Machida <machida@sm.sony.co.jp> 2000-11-20 Hiroyuki Machida <machida@sm.sony.co.jp>
* sysdeps/unix/sysv/linux/mips/clone.S: Fix comments. * sysdeps/unix/sysv/linux/mips/clone.S: Fix comments.
* sysdeps/unix/sysv/linux/mips/kernel_stat.h (kernel_stat): Expand * sysdeps/unix/sysv/linux/mips/kernel_stat.h (kernel_stat): Expand
time_t to 'long int' not, 'unsigned int'. Use 'long int' for time_t to 'long int' not, 'unsigned int'. Use 'long int' for

View File

@ -34,6 +34,7 @@ Compiled by GNU CC version "__VERSION__".\n"
#include <unistd.h> #include <unistd.h>
extern void __libc_print_version (void);
void void
__libc_print_version (void) __libc_print_version (void)
{ {
@ -58,6 +59,7 @@ weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
/* This function is the entry point for the shared object. /* This function is the entry point for the shared object.
Running the library as a program will get here. */ Running the library as a program will get here. */
extern void __libc_main (void) __attribute__ ((noreturn));
void void
__libc_main (void) __libc_main (void)
{ {

View File

@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <assert.h> #include <assert.h>
#include <gconv.h> #include <gconv_int.h>
#include <sys/param.h> #include <sys/param.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stddef.h> #include <stddef.h>

View File

@ -115,8 +115,8 @@ struct __gconv_step
int __counter; int __counter;
__const char *__from_name; char *__from_name;
__const char *__to_name; char *__to_name;
__gconv_fct __fct; __gconv_fct __fct;
__gconv_init_fct __init_fct; __gconv_init_fct __init_fct;

View File

@ -76,6 +76,28 @@ BUILTIN_TRANSFORMATION ("INTERNAL", "ISO-10646/UCS2/", 1, "=INTERNAL->ucs2",
4, 4, 2, 2) 4, 4, 2, 2)
BUILTIN_ALIAS ("ANSI_X3.4//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ISO-IR-6//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ANSI_X3.4-1986//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ISO_646.IRV:1991//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ASCII//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("ISO646-US//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("US-ASCII//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("US//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("IBM367//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("CP367//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("CSASCII//", "ANSI_X3.4-1968//")
BUILTIN_ALIAS ("OSF00010020//", "ANSI_X3.4-1968//")
BUILTIN_TRANSFORMATION ("ANSI_X3.4-1968//", "INTERNAL", 1, "=ascii->INTERNAL",
__gconv_transform_ascii_internal, NULL, NULL,
4, 4, 1, 1)
BUILTIN_TRANSFORMATION ("INTERNAL", "ANSI_X3.4-1968//", 1, "=INTERNAL->ascii",
__gconv_transform_internal_ascii, NULL, NULL,
4, 4, 1, 1)
#if BYTE_ORDER == BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
BUILTIN_ALIAS ("UNICODEBIG//", "ISO-10646/UCS2/") BUILTIN_ALIAS ("UNICODEBIG//", "ISO-10646/UCS2/")
BUILTIN_ALIAS ("UCS-2BE//", "ISO-10646/UCS2/") BUILTIN_ALIAS ("UCS-2BE//", "ISO-10646/UCS2/")

View File

@ -23,6 +23,7 @@
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <search.h> #include <search.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -38,7 +39,7 @@ static const char default_gconv_path[] = GCONV_PATH;
/* The path elements, as determined by the __gconv_get_path function. /* The path elements, as determined by the __gconv_get_path function.
All path elements end in a slash. */ All path elements end in a slash. */
const struct path_elem *__gconv_path_elem; struct path_elem *__gconv_path_elem;
/* Maximum length of a single path element in __gconv_path_elem. */ /* Maximum length of a single path element in __gconv_path_elem. */
size_t __gconv_max_path_elem_len; size_t __gconv_max_path_elem_len;
@ -283,7 +284,7 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules,
/* See whether we must add the ending. */ /* See whether we must add the ending. */
need_ext = 0; need_ext = 0;
if (wp - module < sizeof (gconv_module_ext) if (wp - module < (ptrdiff_t) sizeof (gconv_module_ext)
|| memcmp (wp - sizeof (gconv_module_ext), gconv_module_ext, || memcmp (wp - sizeof (gconv_module_ext), gconv_module_ext,
sizeof (gconv_module_ext)) != 0) sizeof (gconv_module_ext)) != 0)
/* We must add the module extension. */ /* We must add the module extension. */
@ -304,23 +305,19 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules,
{ {
char *tmp; char *tmp;
new_module->from_string = memcpy ((char *) new_module new_module->from_string = tmp = (char *) (new_module + 1);
+ sizeof (struct gconv_module), tmp = __mempcpy (tmp, from, to - from);
from, to - from);
new_module->to_string = memcpy ((char *) new_module->from_string new_module->to_string = tmp;
+ (to - from), to, module - to); tmp = __mempcpy (tmp, to, module - to);
new_module->cost_hi = cost_hi; new_module->cost_hi = cost_hi;
new_module->cost_lo = modcounter; new_module->cost_lo = modcounter;
new_module->module_name = (char *) new_module->to_string + (module - to); new_module->module_name = tmp;
if (dir_len == 0) if (dir_len != 0)
tmp = (char *) new_module->module_name; tmp = __mempcpy (tmp, directory, dir_len);
else
tmp = __mempcpy ((char *) new_module->module_name,
directory, dir_len);
tmp = __mempcpy (tmp, module, wp - module); tmp = __mempcpy (tmp, module, wp - module);

View File

@ -44,8 +44,8 @@ __libc_lock_define_initialized (static, lock)
int int
__gconv_alias_compare (const void *p1, const void *p2) __gconv_alias_compare (const void *p1, const void *p2)
{ {
struct gconv_alias *s1 = (struct gconv_alias *) p1; const struct gconv_alias *s1 = (const struct gconv_alias *) p1;
struct gconv_alias *s2 = (struct gconv_alias *) p2; const struct gconv_alias *s2 = (const struct gconv_alias *) p2;
return strcmp (s1->fromname, s2->fromname); return strcmp (s1->fromname, s2->fromname);
} }
@ -90,8 +90,8 @@ struct known_derivation
static int static int
derivation_compare (const void *p1, const void *p2) derivation_compare (const void *p1, const void *p2)
{ {
struct known_derivation *s1 = (struct known_derivation *) p1; const struct known_derivation *s1 = (const struct known_derivation *) p1;
struct known_derivation *s2 = (struct known_derivation *) p2; const struct known_derivation *s2 = (const struct known_derivation *) p2;
int result; int result;
result = strcmp (s1->from, s2->from); result = strcmp (s1->from, s2->from);

View File

@ -149,7 +149,7 @@ __gconv_find_shlib (const char *name)
static struct __gconv_loaded_object *release_handle; static struct __gconv_loaded_object *release_handle;
static void static void
do_release_shlib (const void *nodep, VISIT value, int level) do_release_shlib (void *nodep, VISIT value, int level)
{ {
struct __gconv_loaded_object *obj = *(struct __gconv_loaded_object **) nodep; struct __gconv_loaded_object *obj = *(struct __gconv_loaded_object **) nodep;
@ -184,7 +184,7 @@ __gconv_release_shlib (struct __gconv_loaded_object *handle)
/* Process all entries. Please note that we also visit entries /* Process all entries. Please note that we also visit entries
with release counts <= 0. This way we can finally unload them with release counts <= 0. This way we can finally unload them
if necessary. */ if necessary. */
__twalk (loaded, do_release_shlib); __twalk (loaded, (__action_fn_t) do_release_shlib);
} }

View File

@ -33,7 +33,7 @@ struct path_elem
}; };
/* Variable with search path for `gconv' implementation. */ /* Variable with search path for `gconv' implementation. */
extern const struct path_elem *__gconv_path_elem; extern struct path_elem *__gconv_path_elem;
/* Maximum length of a single path element. */ /* Maximum length of a single path element. */
extern size_t __gconv_max_path_elem_len; extern size_t __gconv_max_path_elem_len;
@ -41,8 +41,8 @@ extern size_t __gconv_max_path_elem_len;
/* Structure for alias definition. Simply to strings. */ /* Structure for alias definition. Simply to strings. */
struct gconv_alias struct gconv_alias
{ {
const char *fromname; char *fromname;
const char *toname; char *toname;
}; };

View File

@ -29,6 +29,15 @@
#include <wchar.h> #include <wchar.h>
#include <sys/param.h> #include <sys/param.h>
#define BUILTIN_ALIAS(s1, s2) /* nothing */
#define BUILTIN_TRANSFORMATION(From, To, Cost, Name, Fct, Init, End, MinF, \
MaxF, MinT, MaxT) \
extern int Fct (struct __gconv_step *, struct __gconv_step_data *, \
__const unsigned char **, __const unsigned char *, \
unsigned char **, size_t *, int, int);
#include "gconv_builtin.h"
#ifndef EILSEQ #ifndef EILSEQ
# define EILSEQ EINVAL # define EILSEQ EINVAL
#endif #endif
@ -66,7 +75,7 @@ internal_ucs4_loop (struct __gconv_step *step,
size_t cnt; size_t cnt;
for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4) for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
*((uint32_t *) outptr)++ = bswap_32 (*(uint32_t *) inptr); *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
*inptrp = inptr; *inptrp = inptr;
*outptrp = outptr; *outptrp = outptr;
@ -215,9 +224,9 @@ ucs4_internal_loop (struct __gconv_step *step,
uint32_t inval; uint32_t inval;
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
inval = bswap_32 (*(uint32_t *) inptr); inval = bswap_32 (*(const uint32_t *) inptr);
#else #else
inval = *(uint32_t *) inptr; inval = *(const uint32_t *) inptr;
#endif #endif
if (__builtin_expect (inval, 0) > 0x7fffffff) if (__builtin_expect (inval, 0) > 0x7fffffff)
@ -420,7 +429,7 @@ internal_ucs4le_loop (struct __gconv_step *step,
size_t cnt; size_t cnt;
for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4) for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
*((uint32_t *) outptr)++ = bswap_32 (*(uint32_t *) inptr); *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
*inptrp = inptr; *inptrp = inptr;
*outptrp = outptr; *outptrp = outptr;
@ -566,9 +575,9 @@ ucs4le_internal_loop (struct __gconv_step *step,
uint32_t inval; uint32_t inval;
#if __BYTE_ORDER == __BIG_ENDIAN #if __BYTE_ORDER == __BIG_ENDIAN
inval = bswap_32 (*(uint32_t *) inptr); inval = bswap_32 (*(const uint32_t *) inptr);
#else #else
inval = *(uint32_t *) inptr; inval = *(const uint32_t *) inptr;
#endif #endif
if (__builtin_expect (inval, 0) > 0x7fffffff) if (__builtin_expect (inval, 0) > 0x7fffffff)
@ -796,13 +805,13 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP #define LOOPFCT FROM_LOOP
#define BODY \ #define BODY \
{ \ { \
if (__builtin_expect (*((uint32_t *) inptr), 0) > 0x7f) \ if (__builtin_expect (*((const uint32_t *) inptr), 0) > 0x7f) \
{ \ { \
STANDARD_ERR_HANDLER (4); \ STANDARD_ERR_HANDLER (4); \
} \ } \
else \ else \
/* It's an one byte sequence. */ \ /* It's an one byte sequence. */ \
*outptr++ = *((uint32_t *) inptr)++; \ *outptr++ = *((const uint32_t *) inptr)++; \
} }
#define LOOP_NEED_FLAGS #define LOOP_NEED_FLAGS
#include <iconv/loop.c> #include <iconv/loop.c>
@ -827,7 +836,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP #define LOOPFCT FROM_LOOP
#define BODY \ #define BODY \
{ \ { \
uint32_t wc = *((uint32_t *) inptr); \ uint32_t wc = *((const uint32_t *) inptr); \
\ \
/* Since we control every character we read this cannot happen. */ \ /* Since we control every character we read this cannot happen. */ \
assert (wc <= 0x7fffffff); \ assert (wc <= 0x7fffffff); \
@ -1146,7 +1155,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP #define LOOPFCT FROM_LOOP
#define BODY \ #define BODY \
{ \ { \
uint16_t u1 = *((uint16_t *) inptr); \ uint16_t u1 = *((const uint16_t *) inptr); \
\ \
if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \ if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \
{ \ { \
@ -1186,7 +1195,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP #define LOOPFCT FROM_LOOP
#define BODY \ #define BODY \
{ \ { \
uint32_t val = *((uint32_t *) inptr); \ uint32_t val = *((const uint32_t *) inptr); \
\ \
if (__builtin_expect (val, 0) >= 0x10000) \ if (__builtin_expect (val, 0) >= 0x10000) \
{ \ { \
@ -1236,7 +1245,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP #define LOOPFCT FROM_LOOP
#define BODY \ #define BODY \
{ \ { \
uint16_t u1 = bswap_16 (*((uint16_t *) inptr)); \ uint16_t u1 = bswap_16 (*((const uint16_t *) inptr)); \
\ \
if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \ if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \
{ \ { \
@ -1276,7 +1285,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP #define LOOPFCT FROM_LOOP
#define BODY \ #define BODY \
{ \ { \
uint32_t val = *((uint32_t *) inptr); \ uint32_t val = *((const uint32_t *) inptr); \
if (__builtin_expect (val, 0) >= 0x10000) \ if (__builtin_expect (val, 0) >= 0x10000) \
{ \ { \
STANDARD_ERR_HANDLER (4); \ STANDARD_ERR_HANDLER (4); \

View File

@ -41,18 +41,18 @@ __gconv_transliterate (struct __gconv_step *step,
{ {
/* Find out about the locale's transliteration. */ /* Find out about the locale's transliteration. */
uint_fast32_t size; uint_fast32_t size;
uint32_t *from_idx; const uint32_t *from_idx;
uint32_t *from_tbl; const uint32_t *from_tbl;
uint32_t *to_idx; const uint32_t *to_idx;
uint32_t *to_tbl; const uint32_t *to_tbl;
uint32_t *winbuf; const uint32_t *winbuf;
uint32_t *winbufend; const uint32_t *winbufend;
uint_fast32_t low; uint_fast32_t low;
uint_fast32_t high; uint_fast32_t high;
/* The input buffer. There are actually 4-byte values. */ /* The input buffer. There are actually 4-byte values. */
winbuf = (uint32_t *) *inbufp; winbuf = (const uint32_t *) *inbufp;
winbufend = (uint32_t *) inbufend; winbufend = (const uint32_t *) inbufend;
/* If there is no transliteration information in the locale don't do /* If there is no transliteration information in the locale don't do
anything and return the error. */ anything and return the error. */
@ -61,10 +61,14 @@ __gconv_transliterate (struct __gconv_step *step,
goto no_rules; goto no_rules;
/* Get the rest of the values. */ /* Get the rest of the values. */
from_idx = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_IDX); from_idx =
from_tbl = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_TBL); (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_IDX);
to_idx = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_IDX); from_tbl =
to_tbl = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_TBL); (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_TBL);
to_idx =
(const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_IDX);
to_tbl =
(const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_TBL);
/* Test whether there is enough input. */ /* Test whether there is enough input. */
if (winbuf + 1 > winbufend) if (winbuf + 1 > winbufend)
@ -156,9 +160,9 @@ __gconv_transliterate (struct __gconv_step *step,
if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE_LEN) != 0) if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE_LEN) != 0)
{ {
int n = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE_LEN); int n = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE_LEN);
uint32_t *ranges = (uint32_t *) _NL_CURRENT (LC_CTYPE, const uint32_t *ranges =
_NL_CTYPE_TRANSLIT_IGNORE); (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE);
uint32_t wc = *(uint32_t *) (*inbufp); const uint32_t wc = *(const uint32_t *) (*inbufp);
int i; int i;
/* Test whether there is enough input. */ /* Test whether there is enough input. */
@ -184,7 +188,7 @@ __gconv_transliterate (struct __gconv_step *step,
/* One last chance: use the default replacement. */ /* One last chance: use the default replacement. */
if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0) if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0)
{ {
uint32_t *default_missing = (uint32_t *) const uint32_t *default_missing = (const uint32_t *)
_NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING); _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING);
const unsigned char *toinptr = (const unsigned char *) default_missing; const unsigned char *toinptr = (const unsigned char *) default_missing;
uint32_t len = _NL_CURRENT_WORD (LC_CTYPE, uint32_t len = _NL_CURRENT_WORD (LC_CTYPE,
@ -230,7 +234,7 @@ struct known_trans
/* This structure must remain the first member. */ /* This structure must remain the first member. */
struct trans_struct info; struct trans_struct info;
const char *fname; char *fname;
void *handle; void *handle;
int open_count; int open_count;
}; };
@ -247,8 +251,8 @@ __libc_lock_define_initialized (static, lock);
static int static int
trans_compare (const void *p1, const void *p2) trans_compare (const void *p1, const void *p2)
{ {
struct known_trans *s1 = (struct known_trans *) p1; const struct known_trans *s1 = (const struct known_trans *) p1;
struct known_trans *s2 = (struct known_trans *) p2; const struct known_trans *s2 = (const struct known_trans *) p2;
return strcmp (s1->info.name, s2->info.name); return strcmp (s1->info.name, s2->info.name);
} }

View File

@ -217,7 +217,7 @@ static inline int
FCTNAME (LOOPFCT) (struct __gconv_step *step, FCTNAME (LOOPFCT) (struct __gconv_step *step,
struct __gconv_step_data *step_data, struct __gconv_step_data *step_data,
const unsigned char **inptrp, const unsigned char *inend, const unsigned char **inptrp, const unsigned char *inend,
unsigned char **outptrp, unsigned char *outend, unsigned char **outptrp, const unsigned char *outend,
size_t *irreversible EXTRA_LOOP_DECLS) size_t *irreversible EXTRA_LOOP_DECLS)
{ {
#ifdef LOOP_NEED_STATE #ifdef LOOP_NEED_STATE
@ -326,7 +326,7 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
UNPACK_BYTES UNPACK_BYTES
#else #else
/* Add the bytes from the state to the input buffer. */ /* Add the bytes from the state to the input buffer. */
for (inlen = 0; inlen < (state->__count & 7); ++ inlen) for (inlen = 0; inlen < (size_t) (state->__count & 7); ++inlen)
bytebuf[inlen] = state->__value.__wchb[inlen]; bytebuf[inlen] = state->__value.__wchb[inlen];
#endif #endif

View File

@ -502,15 +502,13 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
if (FROM_DIRECTION) if (FROM_DIRECTION)
/* Run the conversion loop. */ /* Run the conversion loop. */
nstatus = FROM_LOOP (step, data, inptrp, inend, nstatus = FROM_LOOP (step, data, inptrp, inend,
&outbuf, &outbuf, outerr,
(unsigned char *) outerr,
lirreversiblep lirreversiblep
EXTRA_LOOP_ARGS); EXTRA_LOOP_ARGS);
else else
/* Run the conversion loop. */ /* Run the conversion loop. */
nstatus = TO_LOOP (step, data, inptrp, inend, nstatus = TO_LOOP (step, data, inptrp, inend,
&outbuf, &outbuf, outerr,
(unsigned char *) outerr,
lirreversiblep lirreversiblep
EXTRA_LOOP_ARGS); EXTRA_LOOP_ARGS);
} }
@ -524,15 +522,14 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
nstatus = GEN_unaligned (FROM_LOOP) (step, data, nstatus = GEN_unaligned (FROM_LOOP) (step, data,
inptrp, inend, inptrp, inend,
&outbuf, &outbuf,
(unsigned char *) outerr, outerr,
lirreversiblep lirreversiblep
EXTRA_LOOP_ARGS); EXTRA_LOOP_ARGS);
else else
/* Run the conversion loop. */ /* Run the conversion loop. */
nstatus = GEN_unaligned (TO_LOOP) (step, data, nstatus = GEN_unaligned (TO_LOOP) (step, data,
inptrp, inend, inptrp, inend,
&outbuf, &outbuf, outerr,
(unsigned char *) outerr,
lirreversiblep lirreversiblep
EXTRA_LOOP_ARGS); EXTRA_LOOP_ARGS);
} }

View File

@ -33,22 +33,6 @@
# alias: alias name which is not really recognized. # alias: alias name which is not really recognized.
# name: the real name of the character set # name: the real name of the character set
# from to module cost
alias ANSI_X3.4// ANSI_X3.4-1968//
alias ISO-IR-6// ANSI_X3.4-1968//
alias ANSI_X3.4-1986// ANSI_X3.4-1968//
alias ISO_646.IRV:1991// ANSI_X3.4-1968//
alias ASCII// ANSI_X3.4-1968//
alias ISO646-US// ANSI_X3.4-1968//
alias US-ASCII// ANSI_X3.4-1968//
alias US// ANSI_X3.4-1968//
alias IBM367// ANSI_X3.4-1968//
alias CP367// ANSI_X3.4-1968//
alias CSASCII// ANSI_X3.4-1968//
alias OSF00010020// ANSI_X3.4-1968//
module ANSI_X3.4-1968// INTERNAL ISO646 2
module INTERNAL ANSI_X3.4-1968// ISO646 2
alias ISO-IR-4// BS_4730// alias ISO-IR-4// BS_4730//
alias ISO646-GB// BS_4730// alias ISO646-GB// BS_4730//
alias GB// BS_4730// alias GB// BS_4730//

View File

@ -62,7 +62,6 @@ enum direction
enum variant enum variant
{ {
illegal_var, illegal_var,
US, /* ANSI_X3.4-1968 */
GB, /* BS_4730 */ GB, /* BS_4730 */
CA, /* CSA_Z243.4-1985-1 */ CA, /* CSA_Z243.4-1985-1 */
CA2, /* CSA_Z243.4-1985-2 */ CA2, /* CSA_Z243.4-1985-2 */
@ -90,7 +89,6 @@ enum variant
static const char *names[] = static const char *names[] =
{ {
[US] = "ANSI_X3.4-1968//",
[GB] = "BS_4730//", [GB] = "BS_4730//",
[CA] = "CSA_Z243.4-1985-1//", [CA] = "CSA_Z243.4-1985-1//",
[CA2] = "CSA_Z243.4-1985-2//", [CA2] = "CSA_Z243.4-1985-2//",

View File

@ -52,7 +52,8 @@ do { \
which calls each function on the hook in turn, with ARGS. */ which calls each function on the hook in turn, with ARGS. */
# define DEFINE_HOOK_RUNNER(name, runner, proto, args) \ # define DEFINE_HOOK_RUNNER(name, runner, proto, args) \
DEFINE_HOOK (name, proto); void runner proto { RUN_HOOK (name, args); } DEFINE_HOOK (name, proto); \
extern void runner proto; void runner proto { RUN_HOOK (name, args); }
#else #else

View File

@ -98,4 +98,9 @@ extern void *__sbrk (intptr_t __delta);
environment variables that normally affect them. */ environment variables that normally affect them. */
extern int __libc_enable_secure; extern int __libc_enable_secure;
/* Various internal function. */
extern void __libc_check_standard_fds (void);
#endif #endif

View File

@ -208,8 +208,8 @@ __STRING2_COPY_TYPE (8);
# if _STRING_ARCH_unaligned # if _STRING_ARCH_unaligned
# define __mempcpy_args(src) \ # define __mempcpy_args(src) \
((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4], \ ((__const char *) (src))[0], ((__const char *) (src))[2], \
((char *) (src))[6], \ ((__const char *) (src))[4], ((__const char *) (src))[6], \
__extension__ __STRING2_SMALL_GET16 (src, 0), \ __extension__ __STRING2_SMALL_GET16 (src, 0), \
__extension__ __STRING2_SMALL_GET16 (src, 4), \ __extension__ __STRING2_SMALL_GET16 (src, 4), \
__extension__ __STRING2_SMALL_GET32 (src, 0), \ __extension__ __STRING2_SMALL_GET32 (src, 0), \

View File

@ -50,6 +50,7 @@ asm ("\n/*@HEADER_ENDS*/");
/* To determine whether we need .end and .align: */ /* To determine whether we need .end and .align: */
asm ("\n/*@TESTS_BEGIN*/"); asm ("\n/*@TESTS_BEGIN*/");
extern void dummy (void (*foo) (void));
void void
dummy (void (*foo) (void)) dummy (void (*foo) (void))
{ {
@ -68,10 +69,11 @@ call_gmon_start(void)
void (*gmon_start) (void) = __gmon_start__; void (*gmon_start) (void) = __gmon_start__;
if (gmon_start) if (gmon_start)
gmon_start (); gmon_start ();
} }
SECTION (".init"); SECTION (".init");
extern void _init (void);
void void
_init (void) _init (void)
{ {
@ -97,6 +99,7 @@ asm ("\n/*@_init_EPILOG_ENDS*/");
asm ("\n/*@_fini_PROLOG_BEGINS*/"); asm ("\n/*@_fini_PROLOG_BEGINS*/");
SECTION (".fini"); SECTION (".fini");
extern void _fini (void);
void void
_fini (void) _fini (void)
{ {

View File

@ -33,8 +33,15 @@ extern void *__libc_stack_end;
extern void __pthread_initialize_minimal (void) __attribute__ ((weak)); extern void __pthread_initialize_minimal (void) __attribute__ ((weak));
#endif #endif
/* Prototype for local function. */
extern void __libc_check_standard_fds (void); extern int BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
int argc,
char *__unbounded *__unbounded ubp_av,
void (*init) (void),
void (*fini) (void),
void (*rtld_fini) (void),
void *__unbounded stack_end)
__attribute__ ((noreturn));
int int
/* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the /* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the

View File

@ -1057,18 +1057,20 @@ __strncat_g (char *__dest, __const char __src[], size_t __n)
: (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \ : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \
&& sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \ && sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \
? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \ ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \
? __strcmp_cc ((unsigned char *) (s1), \ ? __strcmp_cc ((__const unsigned char *) (s1), \
(unsigned char *) (s2), strlen (s1)) \ (__const unsigned char *) (s2), \
: __strcmp_cg ((unsigned char *) (s1), \ strlen (s1)) \
(unsigned char *) (s2), strlen (s1))) \ : __strcmp_cg ((__const unsigned char *) (s1), \
(__const unsigned char *) (s2), \
strlen (s1))) \
: (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \ : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \
&& sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \ && sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \
? (__builtin_constant_p (s1) \ ? (__builtin_constant_p (s1) \
? __strcmp_cc ((unsigned char *) (s1), \ ? __strcmp_cc ((__const unsigned char *) (s1), \
(unsigned char *) (s2), \ (__const unsigned char *) (s2), \
strlen (s2)) \ strlen (s2)) \
: __strcmp_gc ((unsigned char *) (s1), \ : __strcmp_gc ((__const unsigned char *) (s1), \
(unsigned char *) (s2), \ (__const unsigned char *) (s2), \
strlen (s2))) \ strlen (s2))) \
: __strcmp_gg (s1, s2))))) : __strcmp_gg (s1, s2)))))

View File

@ -71,7 +71,7 @@ dl_fatal (const char *str)
make sure the library can actually work. */ \ make sure the library can actually work. */ \
FATAL ("FATAL: cannot determine library version\n"); \ FATAL ("FATAL: cannot determine library version\n"); \
__close (fd); \ __close (fd); \
buf[MIN (reslen, sizeof (bufmem) - 1)] = '\0'; \ buf[MIN (reslen, (ssize_t) sizeof (bufmem) - 1)] = '\0'; \
} \ } \
else \ else \
buf = uts.release; \ buf = uts.release; \

View File

@ -108,12 +108,16 @@ init (int argc, char **argv, char **envp)
strong_alias (init, _init); strong_alias (init, _init);
extern void __libc_init_first (void);
void void
__libc_init_first (void) __libc_init_first (void)
{ {
} }
#else #else
extern void __libc_init_first (int argc, char **argv, char **envp);
void void
__libc_init_first (int argc, char **argv, char **envp) __libc_init_first (int argc, char **argv, char **envp)
{ {
@ -127,6 +131,8 @@ __libc_init_first (int argc, char **argv, char **envp)
in ld.so causes disaster, because the _init definition above will in ld.so causes disaster, because the _init definition above will
cause ld.so to gain an init function, which is not a cool thing. */ cause ld.so to gain an init function, which is not a cool thing. */
extern void _dl_start (void) __attribute__ ((noreturn));
void void
_dl_start (void) _dl_start (void)
{ {