summaryrefslogtreecommitdiffstats
path: root/cloud_print/virtual_driver
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 22:04:53 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 22:04:53 +0000
commit900634e0e697f152b54c2783cc1d6f325695caf5 (patch)
tree80e2d12223175bfdd16c53398497647b9f827bfb /cloud_print/virtual_driver
parentc8680d6ef7d3dd49752859cc95a1867214135bd7 (diff)
downloadchromium_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 'cloud_print/virtual_driver')
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc
index 335503a..a4b2e0c 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc
@@ -236,7 +236,8 @@ TEST_F(PortMonitorTest, FlowTest) {
EXPECT_TRUE(monitor2->pfnEndDocPort != NULL);
// These functions should fail if we have not impersonated the user.
- EXPECT_FALSE(monitor2->pfnStartDocPort(port_handle, L"", 0, 0, NULL));
+ EXPECT_FALSE(monitor2->pfnStartDocPort(
+ port_handle, const_cast<wchar_t*>(L""), 0, 0, NULL));
EXPECT_FALSE(monitor2->pfnWritePort(port_handle,
buffer,
kBufferSize,
@@ -251,7 +252,8 @@ TEST_F(PortMonitorTest, FlowTest) {
// Now impersonate so we can test the success case.
ASSERT_TRUE(ImpersonateSelf(SecurityImpersonation));
- EXPECT_TRUE(monitor2->pfnStartDocPort(port_handle, L"", 0, 0, NULL));
+ EXPECT_TRUE(monitor2->pfnStartDocPort(
+ port_handle, const_cast<wchar_t*>(L""), 0, 0, NULL));
EXPECT_TRUE(monitor2->pfnWritePort(port_handle,
buffer,
kBufferSize,