Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ollydbg on May 11, 2022, 04:20:25 pm

Title: About the F() macro and wxString::Format
Post by: ollydbg on May 11, 2022, 04:20:25 pm
I see this commit:

https://sourceforge.net/p/codeblocks/code/12807/

I remember that we have discussed several years ago, that the F() macro is not thread safe, it uses a global variable. So, maybe we will use wxString::Format to replace F()?
Title: Re: About the F() macro and wxString::Format
Post by: Miguel Gimenez on May 11, 2022, 04:42:25 pm
I think the F() macro currently has no advantage over wxString::Format() and complicates the calls unnecesarily, forcing usage of wx_str().
The thread-safe part is one important reason to ditch it.

Also, calls to wxT() and _T() should be removed. There are a lot of code like this:
Code
if (String[n] == wxT('P'))
that creates two temporary wxString and compares them, while this:
Code
if (String[n] == 'P')
does a direct wxChar comparation.
Title: Re: About the F() macro and wxString::Format
Post by: ollydbg on May 12, 2022, 03:33:14 am
Miguel Gimenez, I agree with your opinion.