News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Patch for inserting implementation

Started by zetab, June 16, 2014, 10:02:36 PM

Previous topic - Next topic

zetab

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();".


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();


ollydbg

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

  return type ollydbg  site:alpha0010.github.io/cb-history

Credit goes to alpha!!

Now, I find it here:
Bug 18526 - Code::Blocks History

There are a lot of discussions two years ago, I will read them.
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.