diff options
author | scottmg <scottmg@chromium.org> | 2015-01-27 13:46:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-27 21:47:18 +0000 |
commit | fc5b7077362f170c9205dc976dbd144c6f6bd017 (patch) | |
tree | 104d2dc4db84038f245ab4c55b6a35c93d5e7d2a /base/logging.cc | |
parent | 4c86fc663c829793639a03ee68328de5f10127dc (diff) | |
download | chromium_src-fc5b7077362f170c9205dc976dbd144c6f6bd017.zip chromium_src-fc5b7077362f170c9205dc976dbd144c6f6bd017.tar.gz chromium_src-fc5b7077362f170c9205dc976dbd144c6f6bd017.tar.bz2 |
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}
Diffstat (limited to 'base/logging.cc')
-rw-r--r-- | base/logging.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/base/logging.cc b/base/logging.cc index 5d65fa5..c7a8881 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -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"); |