Author Topic: Patch to CC in trunk  (Read 8497 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7665
    • My Best Post
Patch to CC in trunk
« on: December 10, 2010, 04:32:55 pm »
FYI:

I compile Code::Blocks for ANSI build from time to time; this time I got warning in CC files in printf statement.
Normally the GCC warning are correct for me during ANSI builds; I have not had time to double check the results.
(Compiled under Windows 7 32-Bit) Not sure if changes are correct for 64Bit.
Tim S.

Code
Index: src/plugins/codecompletion/parser/tokenizer.cpp
===================================================================
--- src/plugins/codecompletion/parser/tokenizer.cpp (revision 6884)
+++ src/plugins/codecompletion/parser/tokenizer.cpp (working copy)
@@ -1290,7 +1290,7 @@
         {
             long value;
             if (token.ToLong(&value, 16))
-                exp.AddToInfixExpression(wxString::Format(_T("%d"), value));
+                exp.AddToInfixExpression(wxString::Format(_T("%ld"), value));
             else
                 exp.AddToInfixExpression(_T("0"));
         }
Index: src/plugins/codecompletion/parser/token.h
===================================================================
--- src/plugins/codecompletion/parser/token.h (revision 6884)
+++ src/plugins/codecompletion/parser/token.h (working copy)
@@ -87,7 +87,7 @@
         {
             const long totalTime = it->first->m_StopWatch.Time();
             wxString log;
-            log.Printf(_T("\"%s\" used time is %d minute(s), %d.%03d seconds; call times is %d."),
+            log.Printf(_T("\"%s\" used time is %ld minute(s), %ld.%03ld seconds; call times is %d."),
                        it->second.wx_str(),
                        (totalTime / 60000),
                        (totalTime / 1000) % 60,
Index: src/plugins/codecompletion/parser/parser.cpp
===================================================================
--- src/plugins/codecompletion/parser/parser.cpp (revision 6884)
+++ src/plugins/codecompletion/parser/parser.cpp (working copy)
@@ -953,7 +953,7 @@
         {
             wxCriticalSectionLocker locker(s_TokensTreeCritical);
             parseEndLog.Printf(_T("Project '%s' parsing stage done (%d total parsed files, ")
-                               _T("%d tokens in %d minute(s), %d.%03d seconds)."),
+                               _T("%d tokens in %ld minute(s), %ld.%03ld seconds)."),
                                m_Project ? m_Project->GetTitle().wx_str() : _T("*NONE*"),
                                m_TokensTree->m_FilesMap.size(),
                                m_TokensTree->realsize(),
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6024
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch to CC in trunk
« Reply #1 on: January 28, 2011, 01:03:24 pm »
@loaden or morten
I think this patch can be applied in the trunk. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Patch to CC in trunk
« Reply #2 on: February 10, 2011, 02:53:22 am »
@loaden or morten
I think this patch can be applied in the trunk. :D
I do not have 64-bit operating system. :(

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6024
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Patch to CC in trunk
« Reply #3 on: February 10, 2011, 04:41:54 am »
@loaden or morten
I think this patch can be applied in the trunk. :D
I do not have 64-bit operating system. :(
the patch is to support ANSI build, not 64bit build.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.