Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: zetab on June 16, 2014, 10:02:36 pm

Title: Patch for inserting implementation
Post by: zetab on June 16, 2014, 10:02:36 pm
Hello,

If I remember it right, this is once reported by ollydbg in an old bug ticket, but somehow it's not applied to the source.

The patch fixes the wrong return type when inserting implementation of functions whose return type have multiple words, e.g. "unsigned int func();".

Code
Index: src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- src/plugins/codecompletion/codecompletion.cpp (revision 9807)
+++ src/plugins/codecompletion/codecompletion.cpp (working copy)
@@ -2744,7 +2744,7 @@
                 str << ed->GetLineIndentString(line - 1);
             if (addDoxgenComment)
                 str << _T("/** @brief ") << token->m_Name << _T("\n  *\n  * @todo: document this function\n  */\n");
-            wxString type = token->m_BaseType;
+            wxString type = token->m_FullType;
             if ((type.Last() == _T('&') || type.Last() == _T('*')) && type[type.Len() - 2] == _T(' '))
             {
                 type[type.Len() - 2] = type.Last();

Title: Re: Patch for inserting implementation
Post by: ollydbg on June 18, 2014, 08:22:11 am
Hi, thanks for the remind, I really forgot this.

The good news is that I can still find the old bug report, I just did a Google search by
Code
  return type ollydbg  site:alpha0010.github.io/cb-history
Credit goes to alpha!!

Now, I find it here:
Bug 18526 - Code::Blocks History (http://alpha0010.github.io/cb-history/bugs/18526-Insert_all_cl.html)

There are a lot of discussions two years ago, I will read them.