]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/sockets/baseclient.cpp
Fix double-click support for wxListBox (#10548)
[wxWidgets.git] / samples / sockets / baseclient.cpp
index f9ce6c6f9abf3ec70ee1aaec6f9d75061500c9e7..b131981988c800ffa8a2bb253bee74648072e7e3 100644 (file)
@@ -72,7 +72,7 @@ WX_DECLARE_LIST(ThreadWorker, TList);
 WX_DECLARE_LIST(EventWorker, EList);
 
 class Client : public wxApp {
-    DECLARE_EVENT_TABLE();
+    DECLARE_EVENT_TABLE()
 public:
     void RemoveEventWorker(EventWorker* p_worker);
 private:
@@ -141,7 +141,7 @@ private:
 
 class EventWorker : public wxEvtHandler
 {
-    DECLARE_EVENT_TABLE();
+    DECLARE_EVENT_TABLE()
 public:
     EventWorker(const wxString& p_host, char* p_buf, int p_size);
     void Run();
@@ -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;
             }
         }