| 13394 | |
| 13395 | |
| 13396 | void Script::WarnLocalSameAsGlobal(LPCTSTR aVarName) |
| 13397 | // Relies on the following pre-conditions: |
| 13398 | // 1) It is an implicit (not declared) variable. |
| 13399 | // 2) Caller has verified that a global variable exists with the same name. |
| 13400 | // 3) g_Warn_LocalSameAsGlobal is on (true). |
| 13401 | // 4) g->CurrentFunc is the function which contains this variable. |
| 13402 | { |
| 13403 | auto func_name = g->CurrentFunc ? g->CurrentFunc->mName : _T(""); |
| 13404 | TCHAR buf[DIALOG_TITLE_SIZE]; |
| 13405 | sntprintf(buf, _countof(buf), _T("%s (in function %s)"), aVarName, func_name); |
| 13406 | ScriptWarning(g_Warn_LocalSameAsGlobal, WARNING_LOCAL_SAME_AS_GLOBAL, buf); |
| 13407 | } |
| 13408 | |
| 13409 | |
| 13410 |
nothing calls this directly
no test coverage detected