diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-23 22:04:53 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-23 22:04:53 +0000 |
commit | 900634e0e697f152b54c2783cc1d6f325695caf5 (patch) | |
tree | 80e2d12223175bfdd16c53398497647b9f827bfb /base/test | |
parent | c8680d6ef7d3dd49752859cc95a1867214135bd7 (diff) | |
download | chromium_src-900634e0e697f152b54c2783cc1d6f325695caf5.zip chromium_src-900634e0e697f152b54c2783cc1d6f325695caf5.tar.gz chromium_src-900634e0e697f152b54c2783cc1d6f325695caf5.tar.bz2 |
clang/win: Fix most -Wwriteable-strings warnings.
Many win32 APIs take non-const string pointers. I checked that MSDN documents
them as _In_ and says that they are inputs, and then added const_cast<>s at
the calling sites. (In one test, I introduced a helper struct so that there
can be fewer casts.)
This wasn't just busywork, I found one function that we were handing string
literals where the documentation explicitly said that that's not valid
(filed http://crbug.com/396705).
I didn't change the DECLARE_REGISTRY_APPID_RESOURCEID() call in cloud_print;
it sounds like that'll fix itself when we update to the 2014 sdk:
http://connect.microsoft.com/VisualStudio/feedback/details/806376/atl-hindrances-to-adopting-new-strictstrings-conformance-option-in-vs2013
BUG=396705,82385
R=rnk@chromium.org, rsleevi@chromium.org, sergeyu@chromium.org, vitalybuka@chromium.org
Review URL: https://codereview.chromium.org/413763003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test')
-rw-r--r-- | base/test/test_file_util_win.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/test/test_file_util_win.cc b/base/test/test_file_util_win.cc index ae3f0d5..ea07177 100644 --- a/base/test/test_file_util_win.cc +++ b/base/test/test_file_util_win.cc @@ -47,7 +47,7 @@ bool DenyFilePermission(const FilePath& path, DWORD permission) { change.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; change.Trustee.TrusteeForm = TRUSTEE_IS_NAME; change.Trustee.TrusteeType = TRUSTEE_IS_USER; - change.Trustee.ptstrName = L"CURRENT_USER"; + change.Trustee.ptstrName = const_cast<wchar_t*>(L"CURRENT_USER"); PACL new_dacl; if (SetEntriesInAcl(1, &change, old_dacl, &new_dacl) != ERROR_SUCCESS) { |