Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: frithjofh on November 02, 2015, 07:56:38 pm

Title: small patch for debugger
Post by: frithjofh on November 02, 2015, 07:56:38 pm
just a small patch for the debugger. function should have const wxString& in signature, not const wxChar*
Title: Re: small patch for debugger
Post by: oBFusCATed on November 03, 2015, 12:21:17 am
Can you explain why? It seems to work just fine as it is.
Title: Re: small patch for debugger
Post by: frithjofh on November 04, 2015, 10:58:41 am
the const wxChar* variable is only used to immediately being passed to a base constructor as a const wxString&.

in all wxWidgets constructors the title variable of the constructor is a const wxString&, so why not in the derived class constructor?

also this constructor is only called once and then with a wxString argument (a member of the class) which is transformed into const wxChar* just to satisfy the type in the constructor. superfluous y really pointless.

(by the way, in my patch I din't adapt that call. should have...)

I found this while trying to compile c::b against wx3.0 STL, in wx normal mode this is not an error.

it is when using STL because there is no conversion from wxString to const wxChar* as there isn't any from std::string to const char* in c++11 neither.

but I do think it is not a big change, it doesn't affect more code and it makes the code locally better, more readable, more consistent, and robust for future changes in wxWidgets.
Title: Re: small patch for debugger
Post by: oBFusCATed on November 04, 2015, 09:11:47 pm
I found this while trying to compile c::b against wx3.0 STL, in wx normal mode this is not an error.

it is when using STL because there is no conversion from wxString to const wxChar* as there isn't any from std::string to const char* in c++11 neither.
Interesting, it builds fine with my wx3.1+stl build without this patch. Probably they've changes something in wx after 3.0.
Title: Re: small patch for debugger
Post by: frithjofh on November 04, 2015, 09:13:22 pm
well, I didn't know that...

so my only reason is consistency... not very much then...  ;)