gthr-win32.h (__gthread_setspecific): Use CONST_CAST2.
authorAaron W. LaFramboise <aaronavay62@aaronwl.com>
Sun, 31 Aug 2008 18:26:48 +0000 (12:26 -0600)
committerAaron W. LaFramboise <aaronwl@gcc.gnu.org>
Sun, 31 Aug 2008 18:26:48 +0000 (12:26 -0600)
2008-08-31  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>

* gcc/gthr-win32.h (__gthread_setspecific): Use CONST_CAST2.

From-SVN: r139839

gcc/ChangeLog
gcc/config/i386/gthr-win32.c
gcc/gthr-win32.h

index 7b14a2c442837e6ea093d85f71936f4d407fce5e..4f7a34df0e24196240361075a4c374120d592045 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-31  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
+
+       * gthr-win32.h (__gthread_setspecific): Use CONST_CAST2.
+       * config/i386/gthr-win32.c (__gthread_setspecific): Same.
+
 2008-08-31  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
 
        * mkmap-flat.awk: Add option pe_dll.
index 3810fc0f26c5e66bee990c14ca18a12fcf907bc2..666a936cd7e06fc17affff3d54d82a8ba5435d47 100644 (file)
@@ -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
index adf6efb81a584d76dd72c97be7b1c124226cf653..f236aa350faaba89a760a3eee89c4bdf2ce455e1 100644 (file)
@@ -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