add support for Microsoft TCHAR character constants
This commit is contained in:
parent
2d717d77cd
commit
ec377d24eb
|
@ -10633,6 +10633,12 @@ void Tokenizer::simplifyMicrosoftStringFunctions()
|
|||
tok->deleteThis();
|
||||
tok->deleteNext();
|
||||
}
|
||||
else if (Token::Match(tok, "_T ( %any% )") && tok->strAt(2)[0] == '\'')
|
||||
{
|
||||
tok->deleteThis();
|
||||
tok->deleteThis();
|
||||
tok->deleteNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_settings->platformType == Settings::Win32W ||
|
||||
|
@ -10690,6 +10696,12 @@ void Tokenizer::simplifyMicrosoftStringFunctions()
|
|||
tok->deleteThis();
|
||||
tok->deleteNext();
|
||||
}
|
||||
else if (Token::Match(tok, "_T ( %any% )") && tok->strAt(2)[0] == '\'')
|
||||
{
|
||||
tok->deleteThis();
|
||||
tok->deleteThis();
|
||||
tok->deleteNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6101,6 +6101,7 @@ private:
|
|||
"PCTSTR pctstr;"
|
||||
"LPCTSTR lpctstr;"
|
||||
"void foo() {"
|
||||
" TCHAR tc = _T(\'c\'); "
|
||||
" TCHAR src[10] = _T(\"123456789\");"
|
||||
" TCHAR dst[10];"
|
||||
" _tcscpy(dst, src);"
|
||||
|
@ -6119,6 +6120,7 @@ private:
|
|||
"const char * pctstr ; "
|
||||
"const char * lpctstr ; "
|
||||
"void foo ( ) { "
|
||||
"char tc ; tc = \'c\' ; "
|
||||
"char src [ 10 ] = \"123456789\" ; "
|
||||
"char dst [ 10 ] ; "
|
||||
"strcpy ( dst , src ) ; "
|
||||
|
@ -6142,6 +6144,7 @@ private:
|
|||
"PCTSTR pctstr;"
|
||||
"LPCTSTR lpctstr;"
|
||||
"void foo() {"
|
||||
" TCHAR tc = _T(\'c\');"
|
||||
" TCHAR src[10] = _T(\"123456789\");"
|
||||
" TCHAR dst[10];"
|
||||
" _tcscpy(dst, src);"
|
||||
|
@ -6160,6 +6163,7 @@ private:
|
|||
"const unsigned short * pctstr ; "
|
||||
"const unsigned short * lpctstr ; "
|
||||
"void foo ( ) { "
|
||||
"unsigned short tc ; tc = \'c\' ; "
|
||||
"unsigned short src [ 10 ] = \"123456789\" ; "
|
||||
"unsigned short dst [ 10 ] ; "
|
||||
"wcscpy ( dst , src ) ; "
|
||||
|
|
Loading…
Reference in New Issue