summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-13 15:41:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 15:41:21 -0700
commitb4c9f3f04673753da30011e9f1282cd5d1fa0f40 (patch)
tree9890d43409c8d60b1041de921c961067907419fb /xfa/fgas/crt
parentcdce75706de7e76e73550a0582e1fd28af324fd0 (diff)
downloadpdfium-b4c9f3f04673753da30011e9f1282cd5d1fa0f40.tar.xz
Remove implicit cast from CFX_ByteString to (const char*).
BUG= Review URL: https://codereview.chromium.org/1885973002
Diffstat (limited to 'xfa/fgas/crt')
-rw-r--r--xfa/fgas/crt/fgas_codepage.cpp2
-rw-r--r--xfa/fgas/crt/fgas_stream.cpp10
2 files changed, 5 insertions, 7 deletions
diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp
index 57d97db83c..4734a0005e 100644
--- a/xfa/fgas/crt/fgas_codepage.cpp
+++ b/xfa/fgas/crt/fgas_codepage.cpp
@@ -339,5 +339,5 @@ uint16_t FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength) {
*pBuf++ = (FX_CHAR)*pStr++;
}
csStr.ReleaseBuffer(iLength);
- return FX_GetCodePageFromStringA(csStr, iLength);
+ return FX_GetCodePageFromStringA(csStr.c_str(), iLength);
}
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 02fa2109d1..1a3b239184 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -420,7 +420,7 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
}
}
#else
- CFX_ByteString wsMode;
+ const FX_CHAR* wsMode = "rb";
if (dwAccess & FX_STREAMACCESS_Write) {
if (dwAccess & FX_STREAMACCESS_Append) {
wsMode = "a+b";
@@ -429,18 +429,16 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
} else {
wsMode = "r+b";
}
- } else {
- wsMode = "rb";
}
CFX_ByteString szFileName = CFX_ByteString::FromUnicode(pszSrcFileName);
- m_hFile = FXSYS_fopen(szFileName, wsMode);
+ m_hFile = FXSYS_fopen(szFileName.c_str(), wsMode);
if (m_hFile == NULL) {
if (dwAccess & FX_STREAMACCESS_Write) {
if (dwAccess & FX_STREAMACCESS_Create) {
- m_hFile = FXSYS_fopen(szFileName, "w+b");
+ m_hFile = FXSYS_fopen(szFileName.c_str(), "w+b");
}
if (m_hFile == NULL) {
- m_hFile = FXSYS_fopen(szFileName, "r+b");
+ m_hFile = FXSYS_fopen(szFileName.c_str(), "r+b");
if (m_hFile == NULL) {
return FALSE;
}