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

Unified Diff: printing/backend/win_helper.cc

Issue 413763003: clang/win: Fix most -Wwriteable-strings warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: printing/backend/win_helper.cc
diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc
index ac5892b8b5a2320e0e96ca2982ad254bab5996a8..6aba7c6a0dec8bcbac46513903aafac76c9504a3 100644
--- a/printing/backend/win_helper.cc
+++ b/printing/backend/win_helper.cc
@@ -472,14 +472,18 @@ scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevModeWithColor(
scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevMode(HANDLE printer,
DEVMODE* in) {
- LONG buffer_size = DocumentProperties(NULL, printer, L"", NULL, NULL, 0);
+ LONG buffer_size = DocumentProperties(
+ NULL, printer, const_cast<wchar_t*>(L""), NULL, NULL, 0);
if (buffer_size < static_cast<int>(sizeof(DEVMODE)))
return scoped_ptr<DEVMODE, base::FreeDeleter>();
scoped_ptr<DEVMODE, base::FreeDeleter> out(
reinterpret_cast<DEVMODE*>(malloc(buffer_size)));
DWORD flags = (in ? (DM_IN_BUFFER) : 0) | DM_OUT_BUFFER;
- if (DocumentProperties(NULL, printer, L"", out.get(), in, flags) != IDOK)
+ if (DocumentProperties(
+ NULL, printer, const_cast<wchar_t*>(L""), out.get(), in, flags) !=
+ IDOK) {
return scoped_ptr<DEVMODE, base::FreeDeleter>();
+ }
CHECK_GE(buffer_size, out.get()->dmSize + out.get()->dmDriverExtra);
return out.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698