Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Constant on the left
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pocruadhlaoich
Senior Member

Ireland
43 Posts

Posted - Sep 27 2017 :  09:40:23 AM  Show Profile  Reply with Quote
Hi,
the code inspection feature "Zero constant can be replaced with nullptr" is very useful. Is it possible to customise the action it performs so that it will place the constant on the left?

if (0 == pBlah)
if (pBlah == 0)

would be replaced with

if (nullptr == pBlah)

Currently the replace will happen in situ but it would be great to further improve the change to adhere to local coding standards.
Thanks,
Patrick

Edited by - pocruadhlaoich on Sep 27 2017 09:41:06 AM

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Sep 27 2017 :  10:53:58 AM  Show Profile  Reply with Quote
An interesting thought, I have put in a feature request to see what our developers make of this. Generally we are wary of getting to much into code formatting / coding standards, since there are so many different standards and rules, it would lead to a mass of options. Still, this one does make a lot of sense.

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
43 Posts

Posted - Sep 27 2017 :  12:50:29 PM  Show Profile  Reply with Quote
Cool, thanks feline. Please let me know of any updates!
Go to Top of Page

zzdev10
New Member

USA
6 Posts

Posted - Oct 20 2017 :  1:19:43 PM  Show Profile  Reply with Quote
I'd like to add a vote for this feature. It would be very useful if if code inspection was detecting and correcting cases like if( 0 == pBlah ).

zzdev
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Oct 21 2017 :  09:51:42 AM  Show Profile  Reply with Quote
Oops, I forgot to include the case number for the feature request:

case=111349

zzdev10, this feature request is specific to changes made to your code by Code Inspection, rather than checking for checks where the constant value is on the left hand side.

I have put in a feature request to check for this in general, since it seems a fair point:

case=111878

zen is the art of being at one with the two'ness
Go to Top of Page

pocruadhlaoich
Senior Member

Ireland
43 Posts

Posted - Sep 19 2018 :  08:06:51 AM  Show Profile  Reply with Quote
Is there any update on this feature request please?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Sep 20 2018 :  5:02:34 PM  Show Profile  Reply with Quote
Unfortunately no progress on this yet, but it is still in our list of feature requests, so we are aware of this and have not forgotten about it.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000