summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgthaker <gthaker@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-05 19:24:52 +0000
committergthaker <gthaker@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-05 19:24:52 +0000
commit8fa91c8c2f7a85011b34b5a396f07a4b4d4a50e7 (patch)
tree01425657e5a2d470e6f1ab8d4d5f5c9c87e507e9
parent2178392131b126c706b8fafebede853a220729d9 (diff)
downloadATCD-8fa91c8c2f7a85011b34b5a396f07a4b4d4a50e7.tar.gz
Pre-declared for-loop index to avoid problems with the incorrectly
implemented scope of for-loop indices in MS VC++ 6.0.
-rw-r--r--tests/SOCK_SEQPACK_Association_Test.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/SOCK_SEQPACK_Association_Test.cpp b/tests/SOCK_SEQPACK_Association_Test.cpp
index 059f9e82591..d5bc6a3b3ec 100644
--- a/tests/SOCK_SEQPACK_Association_Test.cpp
+++ b/tests/SOCK_SEQPACK_Association_Test.cpp
@@ -80,6 +80,9 @@ int main (int argc, ACE_TCHAR *argv[])
void dump_names(const ACE_SOCK_SEQPACK_Association& assoc)
{
+ // Pre-declare for-loop index
+ size_t i = 0;
+
size_t in_out_size = 100;
ACE_INET_Addr in_out[100];
@@ -99,7 +102,7 @@ void dump_names(const ACE_SOCK_SEQPACK_Association& assoc)
ACE_DEBUG((LM_DEBUG, "Called get_local_addrs\n"));
// Print individual results of get_local_addrs
- for (size_t i = 0; i < in_out_size; ++i) {
+ for (i = 0; i < in_out_size; ++i) {
if (in_out[i].addr_to_string(outbuf, outbuf_size)) {
@@ -130,7 +133,7 @@ void dump_names(const ACE_SOCK_SEQPACK_Association& assoc)
ACE_DEBUG((LM_DEBUG, "Called get_remote_addrs\n"));
// Print individual results of get_remote_addrs
- for (size_t i = 0; i < in_out_size; ++i) {
+ for (i = 0; i < in_out_size; ++i) {
if (in_out[i].addr_to_string(outbuf, outbuf_size)) {