From: Vadim Zeitlin Date: Fri, 3 Oct 2008 21:52:59 +0000 (+0000) Subject: fix VC6 compilation problems due to its for variables scope brokenness (closes #10035) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/45a50a2e8ff5d066f96fcd40ce687c420d92b0e9 fix VC6 compilation problems due to its for variables scope brokenness (closes #10035) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/sockets/baseclient.cpp b/samples/sockets/baseclient.cpp index f9ce6c6f9a..6199b22181 100644 --- a/samples/sockets/baseclient.cpp +++ b/samples/sockets/baseclient.cpp @@ -254,13 +254,14 @@ Client::OnInit() int Client::OnRun() { + int i; switch(m_sendType) { case STRESS_TEST: switch(m_workMode) { case THREADS: - for (int i = 0; i < m_stressWorkers; i++) { + for (i = 0; i < m_stressWorkers; i++) { if (m_message.empty()) StartWorker(THREADS); else @@ -268,7 +269,7 @@ Client::OnRun() } break; case EVENTS: - for (int i = 0; i < m_stressWorkers; i++) { + for (i = 0; i < m_stressWorkers; i++) { if (m_message.empty()) StartWorker(EVENTS); else @@ -276,7 +277,7 @@ Client::OnRun() } break; default: - for (int i = 0; i < m_stressWorkers; i++) { + for (i = 0; i < m_stressWorkers; i++) { if (m_message.empty()) StartWorker(i % 5 == 0 ? THREADS : EVENTS); else @@ -450,11 +451,11 @@ Client::OnWorkerEvent(WorkerEvent& pEvent) { break; } } - for(EList::compatibility_iterator it = m_eventWorkers.GetFirst(); it ; it = it->GetNext()) + for(EList::compatibility_iterator it2 = m_eventWorkers.GetFirst(); it2 ; it2 = it2->GetNext()) { - if (it->GetData() == pEvent.m_sender) { - delete it->GetData(); - m_eventWorkers.DeleteNode(it); + if (it2->GetData() == pEvent.m_sender) { + delete it2->GetData(); + m_eventWorkers.DeleteNode(it2); break; } } diff --git a/samples/sockets/baseserver.cpp b/samples/sockets/baseserver.cpp index 9fcd74f338..cf879de292 100644 --- a/samples/sockets/baseserver.cpp +++ b/samples/sockets/baseserver.cpp @@ -342,8 +342,8 @@ int Server::OnExit() delete it->GetData(); } - for(EList::compatibility_iterator it = m_eventWorkers.GetFirst(); it ; it->GetNext()) { - delete it->GetData(); + for(EList::compatibility_iterator it2 = m_eventWorkers.GetFirst(); it2 ; it2->GetNext()) { + delete it2->GetData(); } m_threadWorkers.Clear(); @@ -429,13 +429,13 @@ void Server::OnWorkerEvent(WorkerEvent& pEvent) break; } } - for(EList::compatibility_iterator it = m_eventWorkers.GetFirst(); it ; it = it->GetNext()) + for(EList::compatibility_iterator it2 = m_eventWorkers.GetFirst(); it2 ; it2 = it2->GetNext()) { - if (it->GetData() == pEvent.m_sender) + if (it2->GetData() == pEvent.m_sender) { wxLogVerbose(wxT("Deleting event worker (%d left)"),m_eventWorkers.GetCount()); - delete it->GetData(); - m_eventWorkers.DeleteNode(it); + delete it2->GetData(); + m_eventWorkers.DeleteNode(it2); if (!pEvent.m_workerFailed) m_eventWorkersDone++; else