Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Rename refactoring goes out of scope

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
foxmuldr Posted - Jun 08 2018 : 1:44:56 PM
When I go to rename the sha1 token below to "crc" it changes the anonymous struct sub-member name references created by the sha1_sigz() macro as well:

#define u8 unsigned char
#define _SHA1_NUMBER_SIZE 20

#define sha1_sigz(z) struct { u8 sha1[_SHA1_NUMBER_SIZE]; u8 stop[1]; } z;

int main()
{
    sha1_sigz(sha1);

    memset(sha1.sha1, 32, sizeof(sha1.sha1));
    sha1.stop[0] = 0;

    printf((const char*)sha1.sha1);
    return 0;
}

After highlighting "sha1" on this line and pressing Alt+Shift+R and refactoring to "crc":
sha1_sigz(sha1);

...it changes to this:
#define s8 char
#define u8 unsigned char
#define _SHA1_NUMBER_SIZE 20

#define sha1_sigz(z) struct { u8 sha1[_SHA1_NUMBER_SIZE]; u8 stop[1]; } z;

int main()
{
    sha1_sigz(crc);

    memset(crc.crc, 32, sizeof(crc.crc));
    crc.stop[0] = 0;

    printf((const s8*)crc.crc);
    return 0;
}


License: ... (1-user license) Support ends 2018.04.12
VA_X.dll file version 10.9.2258.5 built 2018.03.06
DevEnv.exe version 15.7.27703.2018 Community
msenv.dll version 15.0.27703.2018
Comctl32.dll version 6.10.16299.431
Windows 10 10.0 Build 16299
8 processors (x86-64, WOW64)
Language info: 1252, 0x409

Observed the same behavior in VS2015 with VAX 2118 built 12/12/2016.

--
Rick C. Hodgin
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jun 08 2018 : 3:51:13 PM
I was able to reproduce the problem here. Thank you for the sample code and the clear description of the problem. I have put in a bug report for this:

case=111089

For now, you can put a named struct in the #define as a workaround. It has produced a correct rename with your sample code, for me.

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