News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

small patch for debugger

Started by frithjofh, November 02, 2015, 07:56:38 PM

Previous topic - Next topic

frithjofh

just a small patch for the debugger. function should have const wxString& in signature, not const wxChar*
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

oBFusCATed

Can you explain why? It seems to work just fine as it is.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

frithjofh

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.
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

oBFusCATed

Quote from: frithjofh on November 04, 2015, 10:58:41 AM
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

frithjofh

well, I didn't know that...

so my only reason is consistency... not very much then...  ;)
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100