User forums > Using Code::Blocks

Advanced find and replace

(1/2) > >>

Jewest:
Hi,

I am using the vera++ checker and one of the remarks is that I use the short form for checking empty.
So far no problem, but I think the checker is right and I want to change the code.

so I want the change: if(!largertext.empty()) to: if(largertext.empty() == false)

any way to do this with the find and replace function?
If so how?

thank you in advance,

Jewest

sodev:
Could be done with a regular expression, but i see no reason for. Actually the first form looks much more "correct" to me than the second one, especially in the c++ world where you use implicit conversions to bool the second one might even not work. Are you sure the checker complains about that? And are you sure that you are not using some strict c rules (i assume your code is c++)?

BlueHazzard:
Do you want to do this only for one variable name, or for a lot different variable names?

Jewest:
First up, sorry for the late reply. been busy using C::B to finish a project.

@Sodev: it is not an implicit convertion, !<statement> is. the return value of the function is a boolean.
@ BlueHazzard: Yes I would like to do this with different var names, otherwise a simple find and replace would due. but the vera++ is reporting about 100 times the same message.

Jewest:
any suggestions?
How do I use the regexp to fix this?

Navigation

[0] Message Index

[#] Next page

Go to full version