]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wrong format specifiers in the samples.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 17 May 2012 16:10:19 +0000 (16:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 17 May 2012 16:10:19 +0000 (16:10 +0000)
Use "%ld" instead of "%d" to format long values, using "%d" results in an
assert failure under LP64 systems as int and long have different sizes there.

Closes #14311.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/sockets/baseserver.cpp
samples/sockets/client.cpp

index f00d05a2ed9813fcdc932d1a0b152659a1eab8a8..7e3d6d8fb1e28854e0e6b7a0b9629641af88d5c9 100644 (file)
@@ -258,7 +258,7 @@ Server::DumpStatistics()
 
     if ((int)(m_threadWorkersDone+m_eventWorkersDone) == m_maxConnections)
     {
-        wxLogMessage("%d connection(s) served, exiting",m_maxConnections);
+        wxLogMessage("%ld connection(s) served, exiting",m_maxConnections);
         ExitMainLoop();
     }
 }
@@ -279,7 +279,7 @@ Server::OnCmdLineParsed(wxCmdLineParser& pParser)
 
     if (pParser.Found("m",&m_maxConnections))
     {
-        wxLogMessage("%d connection(s) to exit",m_maxConnections);
+        wxLogMessage("%ld connection(s) to exit",m_maxConnections);
     }
 
     long port;
@@ -434,8 +434,8 @@ void  Server::OnWorkerEvent(WorkerEvent& pEvent)
     {
         if (it->GetData() == pEvent.m_sender)
         {
-            wxLogVerbose("Deleting thread worker (%d left)",
-                         m_threadWorkers.GetCount());
+            wxLogVerbose("Deleting thread worker (%lu left)",
+                         static_cast<unsigned long>( m_threadWorkers.GetCount() ));
             it->GetData()->Wait();
             delete it->GetData();
             m_threadWorkers.DeleteNode(it);
@@ -450,8 +450,8 @@ void  Server::OnWorkerEvent(WorkerEvent& pEvent)
     {
         if (it2->GetData() == pEvent.m_sender)
         {
-            wxLogVerbose("Deleting event worker (%d left)",
-                         m_eventWorkers.GetCount());
+            wxLogVerbose("Deleting event worker (%lu left)",
+                         static_cast<unsigned long>( m_eventWorkers.GetCount() ));
             delete it2->GetData();
             m_eventWorkers.DeleteNode(it2);
             if (!pEvent.m_workerFailed)
index 30d0fa49ab495960761b84043bdb29339d06a2f8..b3389bd4ebe0e0110c5c10ab4aa3ccea2796ad69 100644 (file)
@@ -612,9 +612,9 @@ void MyFrame::OnTestURL(wxCommandEvent& WXUNUSED(event))
     }
 
     // Print the contents type and file size
-    wxLogMessage("Contents type: %s\nFile size: %i\nStarting to download...",
+    wxLogMessage("Contents type: %s\nFile size: %lu\nStarting to download...",
                  url.GetProtocol().GetContentType(),
-                 data->GetSize());
+                 static_cast<unsigned long>( data->GetSize() ));
 
     // Get the data
     wxStringOutputStream sout;