[Pkg-ace-devel] r358 - /trunk/debian/patches/31-gcc-4.1-fix.dpatch
tgg-guest at users.alioth.debian.org
tgg-guest at users.alioth.debian.org
Thu Jun 8 21:49:33 UTC 2006
Author: tgg-guest
Date: Thu Jun 8 21:49:32 2006
New Revision: 358
URL: http://svn.debian.org/wsvn/pkg-ace/?sc=1&rev=358
Log:
Backport the TSS type-punned fix.
Modified:
trunk/debian/patches/31-gcc-4.1-fix.dpatch
Modified: trunk/debian/patches/31-gcc-4.1-fix.dpatch
URL: http://svn.debian.org/wsvn/pkg-ace/trunk/debian/patches/31-gcc-4.1-fix.dpatch?rev=358&op=diff
==============================================================================
--- trunk/debian/patches/31-gcc-4.1-fix.dpatch (original)
+++ trunk/debian/patches/31-gcc-4.1-fix.dpatch Thu Jun 8 21:49:32 2006
@@ -3,6 +3,7 @@
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Backport `Sat Mar 11 09:09:35 2006 Douglas C. Schmidt <schmidt at cse.wustl.edu>'
+## DP: and `Sun Mar 26 21:40:10 2006 Douglas C. Schmidt <schmidt at cse.wustl.edu>'
## DP: Fix "dereferencing 4.1 type-punned pointers" gcc 4.1 warning.
@DPATCH@
@@ -352,3 +353,286 @@
else if (ACE_OutputCDR::wchar_maxbytes () == 2)
{
ACE_CDR::Short sx = static_cast<ACE_CDR::Short> (x);
+--- ACE_wrappers/ace/TSS_T.cpp- 2006-06-08 22:03:59.335893000 +0200
++++ ACE_wrappers/ace/TSS_T.cpp 2006-06-08 23:46:15.243363250 +0200
+@@ -195,18 +195,20 @@
+ ACE_TSS_Adapter *tss_adapter = 0;
+
+ // Get the adapter from thread-specific storage
+- if (ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter) == -1)
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ if (ACE_Thread::getspecific (this->key_, &temp) == -1)
+ return 0; // This should not happen!
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
+
+ // Check to see if this is the first time in for this thread.
+ if (tss_adapter == 0)
+ #else
+ // Get the ts_obj from thread-specific storage. Note that no locks
+ // are required here...
+- if (ACE_Thread::getspecific (this->key_,
+- (void **) &ts_obj) == -1)
++ void *temp = ts_obj; // Need this temp to keep G++ from complaining.
++ if (ACE_Thread::getspecific (this->key_, &temp) == -1)
+ return 0; // This should not happen!
++ ts_obj = static_cast <TYPE*> (temp);
+
+ // Check to see if this is the first time in for this thread.
+ if (ts_obj == 0)
+@@ -249,7 +251,7 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ // Return the underlying ts object.
+- return (TYPE *) tss_adapter->ts_obj_;
++ return static_cast<TYPE *> (tss_adapter->ts_obj_);
+ #else
+ return ts_obj;
+ #endif /* ACE_HAS_THR_C_DEST */
+@@ -274,16 +276,23 @@
+ ACE_TSS_Adapter *tss_adapter = 0;
+
+ // Get the tss adapter from thread-specific storage
+- if (ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter) == -1)
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ if (ACE_Thread::getspecific (this->key_, &temp) == -1)
+ return 0; // This should not happen!
+- else if (tss_adapter != 0)
+- // Extract the real TS object.
+- ts_obj = (TYPE *) tss_adapter->ts_obj_;
++ else
++ {
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ {
++ if (tss_adapter != 0)
++ // Extract the real TS object.
++ ts_obj = static_cast<TYPE *> (tss_adapter->ts_obj_);
++ }
++ }
+ #else
+- if (ACE_Thread::getspecific (this->key_,
+- (void **) &ts_obj) == -1)
++ void *temp = ts_obj; // Need this temp to keep G++ from complaining.
++ if (ACE_Thread::getspecific (this->key_, &temp) == -1)
+ return 0; // This should not happen!
++ ts_obj = static_cast <TYPE *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return ts_obj;
+@@ -310,13 +319,14 @@
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+
+- if (ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter) == -1)
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ if (ACE_Thread::getspecific (this->key_, &temp) == -1)
+ return 0; // This should not happen!
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
+
+ if (tss_adapter != 0)
+ {
+- ts_obj = (TYPE *) tss_adapter->ts_obj_;
++ ts_obj = static_cast<TYPE *> (tss_adapter->ts_obj_);
+ delete tss_adapter; // don't need this anymore
+ }
+
+@@ -332,9 +342,11 @@
+ return ts_obj; // This should not happen!
+ }
+ #else
++ void *temp = ts_obj; // Need this temp to keep G++ from complaining.
+ if (ACE_Thread::getspecific (this->key_,
+- (void **) &ts_obj) == -1)
++ &temp) == -1)
+ return 0; // This should not happen!
++ ts_obj = static_cast <TYPE *> (temp);
+ if (ACE_Thread::setspecific (this->key_,
+ (void *) new_ts_obj) == -1)
+ return ts_obj; // This should not happen!
+@@ -389,12 +401,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *)tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast<ACE_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->release ();
+@@ -409,12 +423,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
+ guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+ #else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->remove ();
+@@ -429,12 +445,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
+ guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+ #else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ // Make sure that this pointer is NULL when we shut down...
+@@ -486,12 +504,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->acquire ();
+@@ -506,12 +526,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->tryacquire ();
+@@ -551,12 +573,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast <ACE_Write_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Write_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->acquire_write ();
+@@ -571,12 +595,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast <ACE_Write_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Write_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->tryacquire_write ();
+@@ -639,12 +665,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast <ACE_Read_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Read_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->acquire_read ();
+@@ -659,12 +687,14 @@
+
+ #if defined (ACE_HAS_THR_C_DEST)
+ ACE_TSS_Adapter *tss_adapter = 0;
+- ACE_Thread::getspecific (this->key_,
+- (void **) &tss_adapter);
+- guard = (ACE_Guard<ACE_LOCK> *) tss_adapter->ts_obj_;
+-#else
+- ACE_Thread::getspecific (this->key_,
+- (void **) &guard);
++ void *temp = tss_adapter; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ tss_adapter = static_cast <ACE_TSS_Adapter *> (temp);
++ guard = static_cast <ACE_Read_Guard<ACE_LOCK> *> (tss_adapter->ts_obj_);
++#else
++ void *temp = guard; // Need this temp to keep G++ from complaining.
++ ACE_Thread::getspecific (this->key_, &temp);
++ guard = static_cast <ACE_Read_Guard<ACE_LOCK> *> (temp);
+ #endif /* ACE_HAS_THR_C_DEST */
+
+ return guard->tryacquire_read ();
More information about the Pkg-ace-devel
mailing list