Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

what's the best and quick way to remove all the wx_str and c_str preprocessor

<< < (3/3)

ollydbg:
OK, now the below regrex works(I did it under notepad++)

match:

--- Code: ---\r\n[\t ]*#if wxCHECK_VERSION\(2\, 9\, 0\)\r\n([\t ]*.*?)wx_str(.*)\r\n[\t ]*#else\r\n(\1)c_str(\2)\r\n[\t ]*#endif

--- End code ---

replace:

--- Code: ---(\r\n)\1wx_str\2

--- End code ---

This only handle "one line" statement, I strip more than 200 places in our c::b source code, see the patches:

Any objection to apply this patch?

[attachment deleted by admin]

MortenMacFly:

--- Quote from: ollydbg on August 07, 2012, 06:46:44 am ---Any objection to apply this patch?

--- End quote ---
Not from my side... I've removed some of these portions anyways already... Nice to see them all gone at once.

ollydbg:
Ok, I have done in rev8202, and I think other parts of the preprocessor directives which can't matches by regex can be manually fixed later.

ollydbg:
I see two kind of issues in wxsmith code:

Issue one:

--- Code: ---#if wxCHECK_VERSION(2, 8, 0)
    WX_DEFINE_ARRAY_INT(bool,wxArrayBool);
#else
    WX_DEFINE_ARRAY(bool,wxArrayBool);
#endif

--- End code ---
Can we just strip them to:

--- Code: ---WX_DEFINE_ARRAY_INT(bool,wxArrayBool);

--- End code ---

I think currently no one was using wx 2.7.x.

Issue two:
Still a lot of usage of c_str(), like:

--- Code: ---Code = RebuildCode(BaseIndentation,Code.c_str(),(int)Code.Length(),EOL);
--- End code ---
or

--- Code: ---for ( const wxChar* Ch = Base.c_str(); *Ch; Ch++ )
--- End code ---

Should they all convert to wx_str() ?

Navigation

[0] Message Index

[*] Previous page

Go to full version