News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Suggest on changing the Variables name in Tokenizer

Started by ollydbg, March 11, 2009, 02:40:11 AM

Previous topic - Next topic

ollydbg

In the Tokenizer class include Tokenizer.cpp and Tokenizer.h.

I think these member names should be changed to confirm the coding style.

   
m_peek             ->  m_PeekToken
m_curtoken        -> m_CurToken
m_peekavailable  -> m_PeekAvailable


I do think it is necessary, really? :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.

MortenMacFly

Quote from: ollydbg on March 11, 2009, 02:40:11 AM
   
m_peek             ->  m_PeekToken
m_curtoken        -> m_CurToken
m_peekavailable  -> m_PeekAvailable

No objections. Could you provide a patch?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Ok.
I have created a patch. See the attachment file. (I have successfully built them in my windows svn 5482)
I change the m_curtoken   -> m_Token
So that there are three groups members. Also, I change the Tokenizer.cpp's encoding to UTF8 without BOM.

Current:
m_Token XXX 
......
Undo:
m_UndoTokenXXX
......
Peek:
m_PeekTokenXXX
......

Also, I change the sequence of initial member list in the constructor to avoid compiling warnings.

[attachment deleted by admin]
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.

MortenMacFly

Quote from: ollydbg on March 11, 2009, 12:12:38 PM
I have created a patch.
Thanks. Give me some days to test it...


BTW, this:
Quote from: ollydbg on March 11, 2009, 12:12:38 PM
Also, I change the Tokenizer.cpp's encoding to UTF8 without BOM.
...caused a comment to be not readable anymore. So I am not going to apply the UTF8 change. Be careful with such. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

OK
The reason I change it's encoding is that by default, the "search thread" can't do search on this file( a messagebox will jump to say "can't open this file  :(), but after changing to UTF8 with out BOM( I converted it by NotePad++), then it can be searched correctly. :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.

MortenMacFly

Quote from: ollydbg on March 11, 2009, 02:40:19 PM
the "search thread" can't do search on this file
If you mean the thread search plugin - this works fine for me (see image attached). Hence I have applied a couple of patches - so probably it's not working in trunk, indeed.

Quote from: ollydbg on March 11, 2009, 02:40:19 PM
changing to UTF8 with out BOM( I converted it by NotePad++)
Hehe - what Notepad++ did was "converting" the characters in question to something else, but different. So the conversion is in fact kind of broken and just "works" because the problematic chars (² and ³) are no more. ;-)

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Quote from: MortenMacFly on March 11, 2009, 02:51:45 PM
If you mean the thread search plugin - this works fine for me (see image attached). Hence I have applied a couple of patches - so probably it's not working in trunk, indeed.
Thank you!
I can see your image, I'm looking forward to the new nightly build version that all these patches were applied to trunk. :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.

ollydbg

@MortenMacFly

Just a reminder, are all the patches on code completion still in testing phase? (It seems one months passed, I can't wait :D...)

Thanks.
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.

MortenMacFly

Quote from: ollydbg on April 11, 2009, 05:11:53 PM
Just a reminder, are all the patches on code completion still in testing phase? (It seems one months passed, I can't wait :D...)
Yes, they are. We (the devs) do still testing. Hence the release schedule is like that:
- merge wxaui branch
- create CC branch for official testing
- merge CC branch (won't take as long as wxaui branch though)
All I can say: Please be patient. Good things won't get lost - I promise. Keep in mind that these are hard times for all of us. Time is limited. But again: Nothing will get lost. For sure.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Thanks for explanation. :D
Thanks for all your efforts!
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.