Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Julia Lawall
On Mon, 3 Feb 2020, Markus Elfring wrote: > > Where is the space that yoyu are concerned about? > > … > @@ -1,7 +1,7 @@ > void on_message_element … > ↑ > > How was this character added at the first column in this line > of my software test approach? I don't understand. If you are showing a patc

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Julia Lawall
On Mon, 3 Feb 2020, Markus Elfring wrote: > > Where is the space that yoyu are concerned about? > > … > @@ -1,7 +1,7 @@ > void on_message_element … > ↑ > > How was this character added at the first column in this line > of my software test approach? > > > >> > >> https://github.com/wwmm/pul

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Markus Elfring
> Where is the space that yoyu are concerned about? … @@ -1,7 +1,7 @@ void on_message_element … ↑ How was this character added at the first column in this line of my software test approach? >> >> https://github.com/wwmm/pulseeffects/blob/acb5161a6ab8d3b0c395ed2809d3318ccf4931bc/src/source_

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread wellington wallace
Hi! I did not have the time to look at this file. Lots of places comparing two chars indeed. The strcmp output has to be compared to zero strcmp(src_name, "equalizer_input_level") == 0. This is the result returned when the arguments are equal. Best Regards, Wellington. On Mon, Feb

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Julia Lawall
On Mon, 3 Feb 2020, Markus Elfring wrote: > Hello, > > I have tried the following small script variant out for > the semantic patch language. > > @replacement@ > constant c; > identifier text; > expression x; > statement is, es; > @@ > char* text = x(...); > > if ( > + strcmp( > text > + ,

[Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Markus Elfring
Hello, I have tried the following small script variant out for the semantic patch language. @replacement@ constant c; identifier text; expression x; statement is, es; @@ char* text = x(...); if ( + strcmp( text + , - == std::string( c ) ) is else es A corresponding t