Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Side by Side Diff: base/file_version_info_win.cc

Issue 1507413003: clang/win: Let some chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_browsertests Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/file_version_info_unittest.cc ('k') | base/files/file_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_version_info_win.h" 5 #include "base/file_version_info_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return GetStringValue(L"LastChange"); 142 return GetStringValue(L"LastChange");
143 } 143 }
144 144
145 bool FileVersionInfoWin::is_official_build() { 145 bool FileVersionInfoWin::is_official_build() {
146 return (GetStringValue(L"Official Build").compare(L"1") == 0); 146 return (GetStringValue(L"Official Build").compare(L"1") == 0);
147 } 147 }
148 148
149 bool FileVersionInfoWin::GetValue(const wchar_t* name, 149 bool FileVersionInfoWin::GetValue(const wchar_t* name,
150 std::wstring* value_str) { 150 std::wstring* value_str) {
151 WORD lang_codepage[8]; 151 WORD lang_codepage[8];
152 int i = 0; 152 size_t i = 0;
153 // Use the language and codepage from the DLL. 153 // Use the language and codepage from the DLL.
154 lang_codepage[i++] = language_; 154 lang_codepage[i++] = language_;
155 lang_codepage[i++] = code_page_; 155 lang_codepage[i++] = code_page_;
156 // Use the default language and codepage from the DLL. 156 // Use the default language and codepage from the DLL.
157 lang_codepage[i++] = ::GetUserDefaultLangID(); 157 lang_codepage[i++] = ::GetUserDefaultLangID();
158 lang_codepage[i++] = code_page_; 158 lang_codepage[i++] = code_page_;
159 // Use the language from the DLL and Latin codepage (most common). 159 // Use the language from the DLL and Latin codepage (most common).
160 lang_codepage[i++] = language_; 160 lang_codepage[i++] = language_;
161 lang_codepage[i++] = 1252; 161 lang_codepage[i++] = 1252;
162 // Use the default language and Latin codepage (most common). 162 // Use the default language and Latin codepage (most common).
(...skipping 18 matching lines...) Expand all
181 return false; 181 return false;
182 } 182 }
183 183
184 std::wstring FileVersionInfoWin::GetStringValue(const wchar_t* name) { 184 std::wstring FileVersionInfoWin::GetStringValue(const wchar_t* name) {
185 std::wstring str; 185 std::wstring str;
186 if (GetValue(name, &str)) 186 if (GetValue(name, &str))
187 return str; 187 return str;
188 else 188 else
189 return L""; 189 return L"";
190 } 190 }
OLDNEW
« no previous file with comments | « base/file_version_info_unittest.cc ('k') | base/files/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698