From: Aaron W. LaFramboise Date: Sun, 31 Aug 2008 18:26:48 +0000 (-0600) Subject: gthr-win32.h (__gthread_setspecific): Use CONST_CAST2. X-Git-Tag: releases/gcc-4.4.0~2738 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e2af376dd368ddb79ade1244833e609ea1fecdf;p=thirdparty%2Fgcc.git gthr-win32.h (__gthread_setspecific): Use CONST_CAST2. 2008-08-31 Aaron W. LaFramboise * gcc/gthr-win32.h (__gthread_setspecific): Use CONST_CAST2. From-SVN: r139839 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b14a2c44283..4f7a34df0e24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-08-31 Aaron W. LaFramboise + + * gthr-win32.h (__gthread_setspecific): Use CONST_CAST2. + * config/i386/gthr-win32.c (__gthread_setspecific): Same. + 2008-08-31 Aaron W. LaFramboise * mkmap-flat.awk: Add option pe_dll. diff --git a/gcc/config/i386/gthr-win32.c b/gcc/config/i386/gthr-win32.c index 3810fc0f26c5..666a936cd7e0 100644 --- a/gcc/config/i386/gthr-win32.c +++ b/gcc/config/i386/gthr-win32.c @@ -141,7 +141,10 @@ __gthr_win32_getspecific (__gthread_key_t key) int __gthr_win32_setspecific (__gthread_key_t key, const void *ptr) { - return (TlsSetValue (key, (void*) ptr) != 0) ? 0 : (int) GetLastError (); + if (TlsSetValue (key, CONST_CAST2(void *, const void *, ptr)) != 0) + return 0; + else + return GetLastError (); } void diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h index adf6efb81a58..f236aa350faa 100644 --- a/gcc/gthr-win32.h +++ b/gcc/gthr-win32.h @@ -455,7 +455,10 @@ __gthread_getspecific (__gthread_key_t key) static inline int __gthread_setspecific (__gthread_key_t key, const void *ptr) { - return __gthr_win32_setspecific (key, ptr); + if (TlsSetValue (key, CONST_CAST2(void *, const void *, ptr)) != 0) + return 0; + else + return GetLastError (); } static inline void