aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-11-07 15:07:10 +0000
committerJakub Jelinek <jakub@redhat.com>2008-11-07 15:07:10 +0000
commit4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59 (patch)
treebf8360059895514a7409ba883f8b658fa62b85bb /include
parent486bdb886330a250af76cbb12af55d2c67ec0981 (diff)
downloadglibc-4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59.zip
glibc-4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59.tar.gz
glibc-4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59.tar.bz2
* bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address,
__libc_tsd_get, __libc_tsd_set): Add TYPE argument, use it as the type of the thread variable instead of void *. * sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Likewise. * include/ctype.h (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust __libc_tsd_define arguments. (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Adjust __libc_tsd_address arguments. Remove union hack. * include/rpc/rpc.h (RPC_VARS): Adjust __libc_tsd_define arguments. * sunrpc/rpc_thread.c (RPC_VARS): Likewise. (__rpc_thread_destroy, rpc_thread_multi, __rpc_thread_variables): Adjust __libc_tsd_{set,get} arguments. * ctype/ctype-info.c (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust __libc_tsd_define arguments. * locale/uselocale.c (__uselocale): Adjust __libc_tsd_{set,get} arguments. * locale/lc-ctype.c (_nl_postload_ctype): Likewise. * locale/global-locale.c (__libc_tsd_LOCALE): Adjust type. (LOCALE): Adjust __libc_tsd_define arguments. * locale/localeinfo.h (_NL_CURRENT_LOCALE): Adjust __libc_tsd_get arguments. (LOCALE): Adjust __libc_tsd_define arguments. * sysdeps/mach/hurd/malloc-machine.h (MALLOC): Adjust __libc_tsd_define arguments. (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get} arguments. nptl/ * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define arguments. (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get} arguments. 2008-11-07 Jakub Jelinek <jakub@redhat.com> * bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Add TYPE argument, use it as the type of the thread variable instead of void *. * sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Likewise. * include/ctype.h (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust __libc_tsd_define arguments. (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Adjust __libc_tsd_address arguments. Remove union hack. * include/rpc/rpc.h (RPC_VARS): Adjust __libc_tsd_define arguments. * sunrpc/rpc_thread.c (RPC_VARS): Likewise. (__rpc_thread_destroy, rpc_thread_multi, __rpc_thread_variables): Adjust __libc_tsd_{set,get} arguments. * ctype/ctype-info.c (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust __libc_tsd_define arguments. * locale/uselocale.c (__uselocale): Adjust __libc_tsd_{set,get} arguments. * locale/lc-ctype.c (_nl_postload_ctype): Likewise. * locale/global-locale.c (__libc_tsd_LOCALE): Adjust type. (LOCALE): Adjust __libc_tsd_define arguments. * locale/localeinfo.h (_NL_CURRENT_LOCALE): Adjust __libc_tsd_get arguments. (LOCALE): Adjust __libc_tsd_define arguments. * sysdeps/mach/hurd/malloc-machine.h (MALLOC): Adjust __libc_tsd_define arguments. (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get} arguments.
Diffstat (limited to 'include')
-rw-r--r--include/ctype.h45
-rw-r--r--include/rpc/rpc.h2
2 files changed, 16 insertions, 31 deletions
diff --git a/include/ctype.h b/include/ctype.h
index ae38b1b..f4b782e 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -18,50 +18,35 @@ extern int __isctype (int __c, int __mask);
# define CTYPE_EXTERN_INLINE extern inline
# endif
-__libc_tsd_define (extern, CTYPE_B)
-__libc_tsd_define (extern, CTYPE_TOUPPER)
-__libc_tsd_define (extern, CTYPE_TOLOWER)
+__libc_tsd_define (extern, const uint16_t *, CTYPE_B)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOUPPER)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOLOWER)
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
__ctype_b_loc (void)
{
- union
- {
- void **ptr;
- const uint16_t **tablep;
- } u;
- u.ptr = __libc_tsd_address (CTYPE_B);
- if (__builtin_expect (*u.tablep == NULL, 0))
- *u.tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
- return u.tablep;
+ const uint16_t **tablep = __libc_tsd_address (const uint16_t *, CTYPE_B);
+ if (__builtin_expect (*tablep == NULL, 0))
+ *tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
+ return tablep;
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_toupper_loc (void)
{
- union
- {
- void **ptr;
- const int32_t **tablep;
- } u;
- u.ptr = __libc_tsd_address (CTYPE_TOUPPER);
- if (__builtin_expect (*u.tablep == NULL, 0))
- *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
- return u.tablep;
+ const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+ if (__builtin_expect (*tablep == NULL, 0))
+ *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
+ return tablep;
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_tolower_loc (void)
{
- union
- {
- void **ptr;
- const int32_t **tablep;
- } u;
- u.ptr = __libc_tsd_address (CTYPE_TOLOWER);
- if (__builtin_expect (*u.tablep == NULL, 0))
- *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
- return u.tablep;
+ const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+ if (__builtin_expect (*tablep == NULL, 0))
+ *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
+ return tablep;
}
# endif /* Not NOT_IN_libc. */
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index e5b1685..d2f3013 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -45,7 +45,7 @@ extern void __rpc_thread_key_cleanup (void);
extern void __rpc_thread_destroy (void);
-__libc_tsd_define (extern, RPC_VARS)
+__libc_tsd_define (extern, struct rpc_thread_variables *, RPC_VARS)
#define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)