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