News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

vector<int> is OK, but string or wstring no-work.

Started by Loaden, January 06, 2010, 05:39:50 AM

Previous topic - Next topic

MortenMacFly

Quote from: blueshake on January 18, 2010, 09:09:13 AM
what about this way.
...I'll try.

BTW: I was in fact thinking about having another flag for the token to declare it as "extern" (similar to m_IsConst). This would help to e.g. overwrite the "content" in the case you find the true definition / implementation. In addition the tooltip could show "extern" if only the "extern" declaration is found, indicating that the implementation might not be known (as it is in a binary library, for example).
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 January 18, 2010, 09:47:40 AM
Quote from: blueshake on January 18, 2010, 09:09:13 AM
what about this way.
...I'll try.

BTW: I was in fact thinking about having another flag for the token to declare it as "extern" (similar to m_IsConst). This would help to e.g. overwrite the "content" in the case you find the true definition / implementation. In addition the tooltip could show "extern" if only the "extern" declaration is found, indicating that the implementation might not be known (as it is in a binary library, for example).
Good idea! But it seems there are too many bool variables in the Token class.
    bool          m_IsOperator;
        bool          m_IsLocal;       // found in a local file?
        bool          m_IsTemp;        // if true, the tree deletes it in FreeTemporaries()
        bool          m_IsConst;       // the member method is const (yes/no)


As we build the C::B in the "debug" mode, then strip the debug information. I think one bool variable occupy 4 BYTE in the memory.
I'm not sure a enum variable(combine all the state in one variable) is better??
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.

sbezgodov

I have deleted cb configuration files. Next run cb creates these files with default values.
I've noticed that tokens replacement list is extended. See attacment.

std::string s1; s1. now works fine

As i understand, if you patched your installation to latest nighty, configuration files are not patched at first run.


[attachment deleted by admin]

blueshake

Quote from: sbezgodov on January 18, 2010, 10:50:50 AM
I have deleted cb configuration files. Next run cb creates these files with default values.
I've noticed that tokens replacement list is extended. See attacment.

std::string s1; s1. now works fine

As i understand, if you patched your installation to latest nighty, configuration files are not patched at first run.


work fine here.Make sure that you have include the string file. :D
see my 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?

Loaden

Quote from: sbezgodov on January 18, 2010, 10:50:50 AM
I have deleted cb configuration files. Next run cb creates these files with default values.
I've noticed that tokens replacement list is extended. See attacment.

std::string s1; s1. now works fine

As i understand, if you patched your installation to latest nighty, configuration files are not patched at first run.

Yes, you need edit the "default.conf" file, and add the replacement rules.
<TOKEN_REPLACEMENTS>
<ssmap>
<_GLIBCXX_BEGIN_NAMESPACE>
<![CDATA[+namespace]]>
</_GLIBCXX_BEGIN_NAMESPACE>
<_GLIBCXX_BEGIN_NAMESPACE_TR1>
<![CDATA[-namespace tr1 {]]>
</_GLIBCXX_BEGIN_NAMESPACE_TR1>
<_GLIBCXX_BEGIN_NESTED_NAMESPACE>
<![CDATA[+namespace]]>
</_GLIBCXX_BEGIN_NESTED_NAMESPACE>
<_GLIBCXX_END_NAMESPACE>
<![CDATA[}]]>
</_GLIBCXX_END_NAMESPACE>
<_GLIBCXX_END_NAMESPACE_TR1>
<![CDATA[}]]>
</_GLIBCXX_END_NAMESPACE_TR1>
<_GLIBCXX_END_NESTED_NAMESPACE>
<![CDATA[}]]>
</_GLIBCXX_END_NESTED_NAMESPACE>
<_GLIBCXX_STD>
<![CDATA[std]]>
</_GLIBCXX_STD>
</ssmap>
</TOKEN_REPLACEMENTS>

MortenMacFly

Quote from: ollydbg on January 18, 2010, 09:55:24 AM
I'm not sure a enum variable(combine all the state in one variable) is better??
In terms of memory footprint: yes. In terms of logic: the boolean field have nothing in common really. So combining them logically makes no sense. So a default enum would be enough.
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]