diff options
author | Nico Weber <thakis@chromium.org> | 2014-08-29 15:41:53 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2014-08-29 23:04:13 +0000 |
commit | d85710844c00acbfcf95f84ebcb6012d72eac645 (patch) | |
tree | ae5aa1e78b186d0a9e142d269ed6248fbfcdd9bf | |
parent | 62964a694ce67c5425344e2b6473724808a93f74 (diff) | |
download | chromium_src-d85710844c00acbfcf95f84ebcb6012d72eac645.zip chromium_src-d85710844c00acbfcf95f84ebcb6012d72eac645.tar.gz chromium_src-d85710844c00acbfcf95f84ebcb6012d72eac645.tar.bz2 |
clang/win: Fix a few warnings in targets not in chromium_builder_tests.
Also don't use "default" as a variable name, as it's a keyword.
Also fix a bug where a wstring was passed to %ls.
No real behavior change.
BUG=82385
R=hans@chromium.org
TBR=cpu, vitalybuka
Review URL: https://codereview.chromium.org/526513002
Cr-Commit-Position: refs/heads/master@{#292699}
-rw-r--r-- | chrome/installer/gcapi/gcapi.cc | 2 | ||||
-rw-r--r-- | chrome/installer/gcapi/gcapi.h | 2 | ||||
-rw-r--r-- | chrome/installer/gcapi/gcapi_last_run_test.cc | 2 | ||||
-rw-r--r-- | cloud_print/gcp20/prototype/x_privet_token.cc | 2 | ||||
-rw-r--r-- | cloud_print/service/win/cloud_print_service.cc | 9 | ||||
-rw-r--r-- | rlz/win/lib/machine_deal_test.cc | 14 | ||||
-rw-r--r-- | sandbox/win/sandbox_poc/pocdll/fs.cc | 2 |
7 files changed, 17 insertions, 16 deletions
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc index 7253935..ce0d22a 100644 --- a/chrome/installer/gcapi/gcapi.cc +++ b/chrome/installer/gcapi/gcapi.cc @@ -672,7 +672,7 @@ BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code, return TRUE; } -BOOL __stdcall ReactivateChrome(wchar_t* brand_code, +BOOL __stdcall ReactivateChrome(const wchar_t* brand_code, int shell_mode, DWORD* error_code) { BOOL result = FALSE; diff --git a/chrome/installer/gcapi/gcapi.h b/chrome/installer/gcapi/gcapi.h index a35293e..81a59b5 100644 --- a/chrome/installer/gcapi/gcapi.h +++ b/chrome/installer/gcapi/gcapi.h @@ -113,7 +113,7 @@ BOOL __stdcall CanOfferReactivation(const wchar_t* brand_code, // |shell_mode| should be set to one of GCAPI_INVOKED_STANDARD_SHELL or // GCAPI_INVOKED_UAC_ELEVATION depending on whether this method is invoked // from an elevated or non-elevated process. -BOOL __stdcall ReactivateChrome(wchar_t* brand_code, +BOOL __stdcall ReactivateChrome(const wchar_t* brand_code, int shell_mode, DWORD* error_code); diff --git a/chrome/installer/gcapi/gcapi_last_run_test.cc b/chrome/installer/gcapi/gcapi_last_run_test.cc index 8f07a3b..9dbd706 100644 --- a/chrome/installer/gcapi/gcapi_last_run_test.cc +++ b/chrome/installer/gcapi/gcapi_last_run_test.cc @@ -27,7 +27,7 @@ class GCAPILastRunTest : public ::testing::Test { void SetUp() { // Override keys - this is undone during destruction. std::wstring hkcu_override = base::StringPrintf( - L"hkcu_override\\%ls", base::ASCIIToWide(base::GenerateGUID())); + L"hkcu_override\\%ls", base::ASCIIToWide(base::GenerateGUID()).c_str()); override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override); // Create the client state key in the right places. diff --git a/cloud_print/gcp20/prototype/x_privet_token.cc b/cloud_print/gcp20/prototype/x_privet_token.cc index df26d8e..4093ccb 100644 --- a/cloud_print/gcp20/prototype/x_privet_token.cc +++ b/cloud_print/gcp20/prototype/x_privet_token.cc @@ -59,7 +59,7 @@ bool XPrivetToken::CheckValidXToken(const std::string& token) const { std::string XPrivetToken::GenerateXTokenWithTime(uint64 issue_time) const { std::string result; - std::string issue_time_str = base::StringPrintf("%"PRIu64, issue_time); + std::string issue_time_str = base::StringPrintf("%" PRIu64, issue_time); std::string hash = base::SHA1HashString(secret_ + kXPrivetTokenDelimeter + issue_time_str); diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc index 6f58095..2e15398 100644 --- a/cloud_print/service/win/cloud_print_service.cc +++ b/cloud_print/service/win/cloud_print_service.cc @@ -80,10 +80,11 @@ void InvalidUsage() { std::cout << "\n"; } -base::string16 GetOption(int string_id, const base::string16& default, - bool secure) { +base::string16 GetOption(int string_id, + const base::string16& default_option, + bool secure) { base::string16 prompt_format = cloud_print::LoadLocalString(string_id); - std::vector<base::string16> substitutions(1, default); + std::vector<base::string16> substitutions(1, default_option); std::cout << ReplaceStringPlaceholders(prompt_format, substitutions, NULL); base::string16 tmp; if (secure) { @@ -99,7 +100,7 @@ base::string16 GetOption(int string_id, const base::string16& default, std::getline(std::wcin, tmp); } if (tmp.empty()) - return default; + return default_option; return tmp; } diff --git a/rlz/win/lib/machine_deal_test.cc b/rlz/win/lib/machine_deal_test.cc index 47b7265..ec0526f 100644 --- a/rlz/win/lib/machine_deal_test.cc +++ b/rlz/win/lib/machine_deal_test.cc @@ -72,7 +72,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { // Bad responses - char* kBadDccResponse = + const char kBadDccResponse[] = "dcc: NotMyDCCode \r\n" "set_dcc: NewDCCode\r\n" "crc32: 1B4D6BB3"; @@ -81,7 +81,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { EXPECT_TRUE(rlz_lib::MachineDealCode::Get(dcc_50, 50)); EXPECT_STREQ("MyDCCode", dcc_50); - char* kBadCrcResponse = + const char kBadCrcResponse[] = "dcc: MyDCCode \r\n" "set_dcc: NewDCCode\r\n" "crc32: 90707106"; @@ -92,7 +92,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { // Good responses - char* kMissingSetResponse = + const char kMissingSetResponse[] = "dcc: MyDCCode \r\n" "crc32: 35F2E717"; EXPECT_TRUE(rlz_lib::MachineDealCode::SetFromPingResponse( @@ -100,7 +100,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { EXPECT_TRUE(rlz_lib::MachineDealCode::Get(dcc_50, 50)); EXPECT_STREQ("MyDCCode", dcc_50); - char* kGoodResponse = + const char kGoodResponse[] = "dcc: MyDCCode \r\n" "set_dcc: NewDCCode\r\n" "crc32: C8540E02"; @@ -109,7 +109,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { EXPECT_TRUE(rlz_lib::MachineDealCode::Get(dcc_50, 50)); EXPECT_STREQ("NewDCCode", dcc_50); - char* kGoodResponse2 = + const char kGoodResponse2[] = "set_dcc: NewDCCode2 \r\n" "dcc: NewDCCode \r\n" "crc32: 60B6409A"; @@ -119,7 +119,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { EXPECT_STREQ("NewDCCode2", dcc_50); MachineDealCodeHelper::Clear(); - char* kGoodResponse3 = + const char kGoodResponse3[] = "set_dcc: NewDCCode \r\n" "crc32: 374C1C47"; EXPECT_TRUE(rlz_lib::MachineDealCode::SetFromPingResponse( @@ -128,7 +128,7 @@ TEST_F(MachineDealCodeTest, SetFromPingResponse) { EXPECT_STREQ("NewDCCode", dcc_50); MachineDealCodeHelper::Clear(); - char* kGoodResponse4 = + const char kGoodResponse4[] = "dcc: \r\n" "set_dcc: NewDCCode \r\n" "crc32: 0AB1FB39"; diff --git a/sandbox/win/sandbox_poc/pocdll/fs.cc b/sandbox/win/sandbox_poc/pocdll/fs.cc index 9a5b2bc..aafb9a5 100644 --- a/sandbox/win/sandbox_poc/pocdll/fs.cc +++ b/sandbox/win/sandbox_poc/pocdll/fs.cc @@ -10,7 +10,7 @@ // Tries to open a file and outputs the result. // "path" can contain environment variables. // "output" is the stream for the logging. -void TryOpenFile(wchar_t *path, FILE *output) { +void TryOpenFile(const wchar_t *path, FILE *output) { wchar_t path_expanded[MAX_PATH] = {0}; DWORD size = ::ExpandEnvironmentStrings(path, path_expanded, MAX_PATH - 1); if (!size) { |