summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-04 14:03:14 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-04 14:03:14 +0000
commit2e00d1e8cb258836fbc9a47caa6cec5b76aff915 (patch)
treeda68e0d860a968bfd1a8f5e1485700a5e67e6f93
parent3ba9d618b1c83e49de4d067af97fa4519cce74d8 (diff)
downloadATCD-2e00d1e8cb258836fbc9a47caa6cec5b76aff915.tar.gz
(do_priority_inversion_test): moved declaration of loop index "i" out
of two for loops, and declared as u_int instead of int to prevent signed/unsigned comparison.
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp22
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/client.cpp22
2 files changed, 24 insertions, 20 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
index 435ffb9e2f3..c01677c54a2 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -72,9 +72,11 @@ do_priority_inversion_test (Task_State &ts)
"activate failed",
priority));
+ u_int i;
+
// Drop the priority, so that the priority of clients will increase
// with increasing client number.
- for (int i = 0; i < ts.thread_count_; i++)
+ for (i = 0; i < ts.thread_count_; i++)
priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
priority,
ACE_SCOPE_THREAD);
@@ -124,24 +126,24 @@ do_priority_inversion_test (Task_State &ts)
FILE *latency_file_handle = 0;
char latency_file[BUFSIZ];
char buffer[BUFSIZ];
-
- sprintf (latency_file,
- "cb%d%s%d.txt",
+
+ sprintf (latency_file,
+ "cb%d%s%d.txt",
ACE_OS::getpid (),
ts.use_sysbench_ == 1? "SB": "__",
ts.thread_count_);
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"--->Output file for latency data is \"%s\"\n",
latency_file));
-
+
latency_file_handle = ACE_OS::fopen (latency_file, "w");
-
+
// @@ What does this loop do?
for (u_int j = 0; j < ts.start_count_; j ++)
{
sprintf (buffer,
"%s #%d",
- j == 0 ? "High Priority": "Low Priority",
+ j == 0 ? "High Priority": "Low Priority",
j);
for (u_int i = 0; i < ts.loop_count_; i ++)
@@ -153,9 +155,9 @@ do_priority_inversion_test (Task_State &ts)
buffer[0] = 0;
}
}
-
+
ACE_OS::fclose (latency_file_handle);
-
+
#else /* !defined (CHORUS) */
ACE_DEBUG ((LM_DEBUG, "Test done.\n"
"High priority client latency : %f msec, jitter: %f msec\n"
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
index 435ffb9e2f3..c01677c54a2 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -72,9 +72,11 @@ do_priority_inversion_test (Task_State &ts)
"activate failed",
priority));
+ u_int i;
+
// Drop the priority, so that the priority of clients will increase
// with increasing client number.
- for (int i = 0; i < ts.thread_count_; i++)
+ for (i = 0; i < ts.thread_count_; i++)
priority = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
priority,
ACE_SCOPE_THREAD);
@@ -124,24 +126,24 @@ do_priority_inversion_test (Task_State &ts)
FILE *latency_file_handle = 0;
char latency_file[BUFSIZ];
char buffer[BUFSIZ];
-
- sprintf (latency_file,
- "cb%d%s%d.txt",
+
+ sprintf (latency_file,
+ "cb%d%s%d.txt",
ACE_OS::getpid (),
ts.use_sysbench_ == 1? "SB": "__",
ts.thread_count_);
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"--->Output file for latency data is \"%s\"\n",
latency_file));
-
+
latency_file_handle = ACE_OS::fopen (latency_file, "w");
-
+
// @@ What does this loop do?
for (u_int j = 0; j < ts.start_count_; j ++)
{
sprintf (buffer,
"%s #%d",
- j == 0 ? "High Priority": "Low Priority",
+ j == 0 ? "High Priority": "Low Priority",
j);
for (u_int i = 0; i < ts.loop_count_; i ++)
@@ -153,9 +155,9 @@ do_priority_inversion_test (Task_State &ts)
buffer[0] = 0;
}
}
-
+
ACE_OS::fclose (latency_file_handle);
-
+
#else /* !defined (CHORUS) */
ACE_DEBUG ((LM_DEBUG, "Test done.\n"
"High priority client latency : %f msec, jitter: %f msec\n"