Author Topic: Patches to fix warning seen during ANSI Code::Blocks build.  (Read 7218 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Patches to fix warning seen during ANSI Code::Blocks build.
« on: February 04, 2009, 04:42:58 am »
When Compiling Code::Blocks for Non-Unicode Build I get many warning on conversion in fprint like statements. Patch to the Main Code::Blocks below. Does anyone which me to post the contrib ones?

Tim S

Code
Index: src/plugins/debuggergdb/debuggertree.cpp
===================================================================
--- src/plugins/debuggergdb/debuggertree.cpp (revision 5436)
+++ src/plugins/debuggergdb/debuggertree.cpp (working copy)
@@ -393,7 +393,7 @@
                 // take array indexing into account (if applicable)
                 if (array_index != -1)
                 {
-                    tmp.Prepend(wxString::Format(_T("[%d]: "), array_index));
+                    tmp.Prepend(wxString::Format(_T("[%ld]: "), array_index));
                     // if array element would occur multiple times, gdb adds as default "<repeated xx times> to the output
                     // so we have to look for it and increase the array_index correctly
                     // as default we increase by 1
Index: src/plugins/debuggergdb/cpuregistersdlg.cpp
===================================================================
--- src/plugins/debuggergdb/cpuregistersdlg.cpp (revision 5436)
+++ src/plugins/debuggergdb/cpuregistersdlg.cpp (working copy)
@@ -75,7 +75,7 @@
     wxString fmt;
     fmt.Printf(_T("0x%x"), (size_t)value);
     m_pList->SetItem(idx, 1, fmt);
-    fmt.Printf(_T("%u"), value);
+    fmt.Printf(_T("%lu"), value);
     m_pList->SetItem(idx, 2, fmt);
 
     for (int i = 0; i < 3; ++i)
Index: src/plugins/debuggergdb/examinememorydlg.cpp
===================================================================
--- src/plugins/debuggergdb/examinememorydlg.cpp (revision 5436)
+++ src/plugins/debuggergdb/examinememorydlg.cpp (working copy)
@@ -115,7 +115,7 @@
 
         unsigned long a;
         addr.ToULong(&a, 16);
-        m_pText->AppendText(wxString::Format(_T("0x%x: %.67s"), m_LastRowStartingAddress, m_LineText));
+        m_pText->AppendText(wxString::Format(_T("0x%lx: %.67s"), m_LastRowStartingAddress, m_LineText));
         for (int i = 0; i < 67; ++i)
             m_LineText[i] = _T(' ');
         // update starting address for next row
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Patches to fix warning seen during ANSI Code::Blocks build.
« Reply #1 on: February 04, 2009, 08:28:46 am »
I  will apply these this evening (together with your pch fix in the 02 feb thread). Bring on the others too.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Patches to fix warning seen during ANSI Code::Blocks build.
« Reply #2 on: February 04, 2009, 04:16:05 pm »
Attached 3 patch files in zip.



[attachment deleted by admin]
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Patches to fix warning seen during ANSI Code::Blocks build.
« Reply #3 on: February 04, 2009, 08:20:18 pm »
applied them. Thanks !!!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Patches to fix warning seen during ANSI Code::Blocks build.
« Reply #4 on: March 02, 2009, 04:04:18 pm »
I must of missed one.

Code
Index: src/plugins/contrib/wxSmith/wxwidgets/properties/wxsdimensionproperty.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/properties/wxsdimensionproperty.cpp (revision 5474)
+++ src/plugins/contrib/wxSmith/wxwidgets/properties/wxsdimensionproperty.cpp (working copy)
@@ -30,7 +30,7 @@
         case wxsCPP:
         {
             if ( !DialogUnits ) return wxString::Format(_T("%ld"),Value);
-            return wxString::Format(_T("wxDLG_UNIT(%s,wxSize(%d,0)).GetWidth()"),Context->m_WindowParent.c_str(),Value);
+            return wxString::Format(_T("wxDLG_UNIT(%s,wxSize(%ld,0)).GetWidth()"),Context->m_WindowParent.c_str(),Value);
         }
 
         default:
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Patches to fix warning seen during ANSI Code::Blocks build.
« Reply #5 on: March 02, 2009, 08:06:25 pm »
done