Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1530 'Rename' and goto

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
kurt Posted - Jul 27 2006 : 8:59:58 PM
Trying to rename the goto label 'err' via the refactor menu.

  if (p)
    goto err; /*1*/

  if (q)
    goto err; /*2*/

  err:        /*3*/

If the mouse was on the occurrence of 'err' at /*1*/ or /*2*/, then both of those occurrences change to the new name; /*3*/ should change but does not.

If the mouse was on the occurrence of 'err' at /*3*/, then only /*3*/ changes; /*1*/ and /*2*/ should change but do not.

(VS2005 C++)
9   L A T E S T    R E P L I E S    (Newest First)
support Posted - Oct 29 2012 : 11:14:04 AM
case=1909 is fixed in build 1918
feline Posted - Oct 23 2008 : 1:22:18 PM
Unfortunately no progress yet, but I have just increased the priority on this bug for you. Hopefully this will help a bit.
mar10us Posted - Oct 23 2008 : 10:33:48 AM
Any progress for this case?
kurt Posted - Aug 01 2006 : 7:31:30 PM
sure, no problem.
feline Posted - Jul 31 2006 : 5:41:09 PM
*ouch* there is a lot of difference between inheriting a lot of goto's in code, and adding new ones.
you have my sympathies if your code base is like this example! i made the foolish assumption that you would not have inherited many, since most people try to avoid them.

i am seeing the same problem with rename as you. at a guess VA thinks it has two different local variables, at different scope's, and is reacting accordingly.

case=1909

for now, can you use the IDE's find and replace to rename the labels?
kurt Posted - Jul 31 2006 : 02:36:02 AM
Ok, here's a complete example. The problem occurs with a goto out of a switch.

int f(int i)
{
    int j;
    switch (i)
    {
        case 1:
            j = 88;
            goto zyxxy;
        case 2:
            j = 99;
            break;
        case 3:
            j = 77;
            goto zyxxy;
        default:
            return 0;            
    }
    return j;
zyxxy:
    return i*j;
}

Your advice on coding style is well taken. Perhaps you can help me polish up this million or so lines of legacy code? Thanks!
feline Posted - Jul 30 2006 : 1:35:28 PM
i really like to avoid goto's in my code, and i normally manage still i agree there are times when you need something like this.

as for inline asm, i don't recall that on the feature matrix, so i shall claim it is not officially supported
bugfix Posted - Jul 30 2006 : 12:44:57 AM
feline, there are definitely situations where gotos make sense and code even more readable.
Speaking of labels, did someone try refactoring on inline asm?:)
feline Posted - Jul 29 2006 : 12:41:44 PM
might one suggest not using goto?

pasting this code sample into VS2005, using VA 1530, rename on any of the three instances of "err" lists all three instances in the rename window. do you see the error with this actual sample?

if you are using "err" in different context's then VA may well not be searching far enough across the file, thinking that err is a local variable instead of a label name.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000