summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog9
-rw-r--r--TAO/examples/Persistent_Grid/Grid_i.cpp19
-rw-r--r--TAO/examples/Simple/time/Time_Client_i.cpp9
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp2
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h4
5 files changed, 32 insertions, 11 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index ab0cb00b32a..e444d0ad49d 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,12 @@
+Mon Mar 26 20:44:40 UTC 2007 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+ * performance-tests/Cubit/TAO/MT_Cubit/client.h
+ * examples/Simple/time/Time_Client_i.cpp
+ * examples/Persistent_Grid/Grid_i.cpp
+
+ Fixes for strict aliasing warnings.
+
Mon Mar 26 15:24:47 UTC 2007 William R. Otte <wotte@dre.vanderbilt.edu>
* tao/Compression/zlib/ZlibCompressor.cpp
diff --git a/TAO/examples/Persistent_Grid/Grid_i.cpp b/TAO/examples/Persistent_Grid/Grid_i.cpp
index 99caf3105fc..2a59227186b 100644
--- a/TAO/examples/Persistent_Grid/Grid_i.cpp
+++ b/TAO/examples/Persistent_Grid/Grid_i.cpp
@@ -19,18 +19,26 @@ Grid_i::Grid_i (CORBA::Short x,
CORBA::Short y,
pool_t *mem_pool)
: width_ (x),
- height_ (y)
+ height_ (y),
+ array_ (0)
{
// First try to locate the matrix in the pool. If it is there then
// it has already been created. In such a case we just get that
// memory and assign it to array_
- if (mem_pool->find ("Array", (void *&) array_) == -1)
+
+ void *tmp_array (0);
+
+ if (mem_pool->find ("Array", tmp_array) != -1)
+ {
+ array_ = reinterpret_cast <CORBA::Long **> (tmp_array);
+ }
+ else
{
// Allocate memory for the matrix.
- ACE_ALLOCATOR (array_,
- static_cast<CORBA::Long **> (mem_pool->malloc (y * sizeof (CORBA::Long *))));
+ ACE_ALLOCATOR (array_,
+ static_cast<CORBA::Long **> (mem_pool->malloc (y * sizeof (CORBA::Long *))));
//array_ = (CORBA::Long **) mem_pool->malloc (y * sizeof (CORBA::Long *));
-
+
if (array_ != 0)
{
for (int ctr = 0; ctr < y; ctr++)
@@ -46,6 +54,7 @@ Grid_i::Grid_i (CORBA::Short x,
mem_pool->bind ("Array", array_);
}
}
+
}
// Default destructor.
diff --git a/TAO/examples/Simple/time/Time_Client_i.cpp b/TAO/examples/Simple/time/Time_Client_i.cpp
index 83ebb85e2e2..a46ea8d6b84 100644
--- a/TAO/examples/Simple/time/Time_Client_i.cpp
+++ b/TAO/examples/Simple/time/Time_Client_i.cpp
@@ -37,20 +37,21 @@ Time_Client_i::run (const char *name,
#else
CORBA::Long padding;
#endif /* HPUX */
- CORBA::Long timedate;
+ time_t timedate;
ACE_UNUSED_ARG (padding);
//Make the RMI.
- timedate = client->current_time ();
+ timedate = static_cast <time_t> (client->current_time ());
// Print out value
// Use ACE_OS::ctime_r(), ctime() doesn't seem to work properly
// under 64-bit solaris.
ACE_TCHAR ascii_timedate[64] = "";
- ACE_OS::ctime_r (reinterpret_cast<const time_t *> (&timedate),
- ascii_timedate, 64);
+ ACE_OS::ctime_r (&timedate,
+ ascii_timedate, 64);
+
ACE_DEBUG ((LM_DEBUG,
"string time is %s\n",
ascii_timedate));
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
index e0d97da8166..967e913da62 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -346,7 +346,7 @@ Client_i::activate_high_client (void)
0,
0,
0,
- (ACE_thread_t *) &this->task_id_) == -1)
+ &this->task_id_) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p; priority is %d\n",
"activate failed",
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h
index 263c3474e42..7d070123046 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.h
@@ -151,9 +151,11 @@ private:
u_int counter_;
// counter of the number of priorities used within a grain.
- char *task_id_;
// Set a task_id string starting with "@", so we are able to
// accurately count the number of context switches.
+ // On VxWorks, ACE_thread_t is a char *, making the string
+ // manipulations in the .cpp file valid.
+ ACE_thread_t task_id_;
ACE_Time_Value delta_;
// elapsed time for the latency tests.