Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: stahta01 on December 10, 2010, 04:32:55 pm

Title: Patch to CC in trunk
Post by: stahta01 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(),
Title: Re: Patch to CC in trunk
Post by: ollydbg on January 28, 2011, 01:03:24 pm
@loaden or morten
I think this patch can be applied in the trunk. :D
Title: Re: Patch to CC in trunk
Post by: Loaden 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. :(
Title: Re: Patch to CC in trunk
Post by: ollydbg 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.