User forums > General (but related to Code::Blocks)

CodeCompletion r5979 problems

(1/3) > >>

koso:
I have some strange problems with latest CC .. this is my test code:


--- Code: ---void getBase(int n) {
}

int main() {
    return 0;
}

--- End code ---
On first project startup is everything as expected .. but after first change with save, list of global function symbols is updated, and it shows two symbols with names "e(" and "n(". Type of the first (from debug tool) is "v o i d g e t B a s". Also sometimes when i add somewhere space, after save, there are no symbols at all ...

The only solution I found is to delete .layout file for project and restart C::B, but next save, ant it is again broken ... anyone with the same problems?

blueshake:
@koso
Does it work withou save??????

blueshake:
I download the svn 5979 and confirm it ,but in my local copy it work well.seems something is wrong.

blueshake:
haha,get the reason.
patch:

--- Code: ---Index: src/include/filemanager.h
===================================================================
--- src/include/filemanager.h (revision 5979)
+++ src/include/filemanager.h (working copy)
@@ -144,7 +144,19 @@
     NullLoader(const wxString& name, char* buffer, size_t size) { fileName = name; data = buffer; len = size; Ready(); };
     void operator()(){};
 };
-
+class EditorReuser : public LoaderBase
+{
+public:
+    EditorReuser(const wxString& name, const wxString& s)
+    {
+        fileName = name;
+        len = strlen(s.mb_str(wxConvUTF8));
+        data = new char[len + 1];
+        strcpy(data, (const char*)s.mb_str(wxConvUTF8));
+        Ready();
+    }
+    void operator()(){};
+};
 // ***** class: FileManager *****
 class FileManager : public Mgr<FileManager>
 {
Index: src/sdk/filemanager.cpp
===================================================================
--- src/sdk/filemanager.cpp (revision 5979)
+++ src/sdk/filemanager.cpp (working copy)
@@ -138,12 +138,8 @@
                 cbEditor* ed = em->GetBuiltinEditor(em->GetEditor(i));
                 if(ed && fileName == ed->GetFilename())
                 {
-                    wxString s(ed->GetControl()->GetText());
-                    #if wxCHECK_VERSION(2, 9, 0)
-                    NullLoader *nl = new NullLoader(file, (char*) s.wx_str(), s.length() * sizeof(wxChar));
-                    #else
-                    NullLoader *nl = new NullLoader(file, (char*) s.c_str(), s.length() * sizeof(wxChar));
-                    #endif
+
+                    EditorReuser *nl = new EditorReuser(file, ed->GetControl()->GetText());
                     return nl;
                 }
             }

--- End code ---

MortenMacFly:

--- Quote from: blueshake on December 16, 2009, 11:26:43 am ---haha,get the reason.

--- End quote ---
Dammed. My fault. Actually this slipped in when I committed ollydbg's patch. I'll fix this in SVN asap...

Navigation

[0] Message Index

[#] Next page

Go to full version