Author Topic: unnamed struct parse problem (branch version)  (Read 10559 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
unnamed struct parse problem (branch version)
« on: July 22, 2009, 07:03:12 am »
hello :
     I found that  codecompletion would not work if variant's type is unnamed struct .
code like this :
Code
struct
{
    int x;
    int y;
}cls;
int main()
{
    cls.//not work here.
    cout << "Hello world!" << endl;
    return 0;
}


here is the patch:
Code
Index: parserthread.cpp
===================================================================
--- parserthread.cpp (revision 5696)
+++ parserthread.cpp (working copy)
@@ -1228,7 +1228,7 @@
             {
                 static size_t num = 0;
                 wxString unnamedTmp;
-                unnamedTmp.Printf(_T("Unnamed-%s-%d"),
+                unnamedTmp.Printf(_T("Unnamed%s%d"),
                                   ct == ctClass ? _T("Class") :
                                   ct == ctUnion ? _T("Union") :
                                                   _T("Struct"), num++);

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: unnamed struct parse problem (branch version)
« Reply #1 on: July 22, 2009, 07:32:26 am »
Tested and works fine!
Thanks for the contribution.
By the way, can you explain why we should use Unnamed%s%d instead of Unnamed-%s-%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 blueshake

  • Regular
  • ***
  • Posts: 459
Re: unnamed struct parse problem (branch version)
« Reply #2 on: July 22, 2009, 08:03:12 am »
the - will affec the actual type .see the attachment .

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: unnamed struct parse problem (branch version)
« Reply #3 on: July 22, 2009, 08:21:03 am »
Ok, I know.
By the way, I found a bug in the wxAUI, it seems the edit caret flickes in the wrong place.
see here:
« Last Edit: July 22, 2009, 08:30:32 am by ollydbg »
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 blueshake

  • Regular
  • ***
  • Posts: 459
Re: unnamed struct parse problem (branch version)
« Reply #4 on: July 22, 2009, 09:13:10 am »
I don't catch the bug . :(
but I catch this .I found the key word will show twice in codecompletion in branch . :?

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?