Commit fc5b7077 authored by scottmg's avatar scottmg Committed by Commit bot

Fix variable shadowing warning in logging on VS2015

d:\src\cr3\src\base\logging.cc(167): error C2220: warning treated as error - no 'object' file generated
d:\src\cr3\src\base\logging.cc(167): warning C4459: declaration of 'log_file' hides global declaration
d:\src\cr3\src\base\logging.cc(103): note: see declaration of 'logging::`anonymous-namespace'::log_file'

There was 3 different things called log_file in this file: a global FileHandle,
a local PathString, and a PathChar* member variable in LoggingSettings. :/

(Should probably rename all the globals to g_ prefixed in a followup.)

R=thakis@chromium.org
BUG=440500

Review URL: https://codereview.chromium.org/883853003

Cr-Commit-Position: refs/heads/master@{#313364}
parent 4c86fc66
......@@ -164,13 +164,12 @@ PathString GetDefaultLogFile() {
wchar_t module_name[MAX_PATH];
GetModuleFileName(NULL, module_name, MAX_PATH);
PathString log_file = module_name;
PathString::size_type last_backslash =
log_file.rfind('\\', log_file.size());
PathString log_name = module_name;
PathString::size_type last_backslash = log_name.rfind('\\', log_name.size());
if (last_backslash != PathString::npos)
log_file.erase(last_backslash + 1);
log_file += L"debug.log";
return log_file;
log_name.erase(last_backslash + 1);
log_name += L"debug.log";
return log_name;
#elif defined(OS_POSIX)
// On other platforms we just use the current directory.
return PathString("debug.log");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment