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
 Rename refactoring goes out of scope
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

foxmuldr
Tomato Guru

USA
414 Posts

Posted - Jun 08 2018 :  1:44:56 PM  Show Profile  Reply with Quote
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

Edited by - foxmuldr on Jun 08 2018 1:47:51 PM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 08 2018 :  3:51:13 PM  Show Profile  Reply with Quote
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.
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