From 8d2aae7ee320da3a8ffe01c57e38b3f98443257d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Jul 2015 12:08:12 -0700 Subject: Revert "FX Bool considered harmful, part 3" This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 . --- core/src/fxcrt/fxcrt_platforms.cpp | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'core/src/fxcrt/fxcrt_platforms.cpp') diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp index 813af02ce4..e7182943be 100644 --- a/core/src/fxcrt/fxcrt_platforms.cpp +++ b/core/src/fxcrt/fxcrt_platforms.cpp @@ -40,20 +40,20 @@ CFXCRT_FileAccess_CRT::~CFXCRT_FileAccess_CRT() { Close(); } -bool CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) +FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) { if (m_hFile) { - return false; + return FALSE; } CFX_ByteString strMode; FXCRT_GetFileModeString(dwMode, strMode); m_hFile = FXSYS_fopen(fileName.GetCStr(), strMode.c_str()); return m_hFile != NULL; } -bool CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) +FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) { if (m_hFile) { - return false; + return FALSE; } CFX_WideString strMode; FXCRT_GetFileModeString(dwMode, strMode); @@ -128,45 +128,45 @@ size_t CFXCRT_FileAccess_CRT::WritePos(const void* pBuffer, size_t szBuffer, FX_ FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET); return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile); } -bool CFXCRT_FileAccess_CRT::Flush() +FX_BOOL CFXCRT_FileAccess_CRT::Flush() { if (!m_hFile) { - return false; + return FALSE; } return !FXSYS_fflush(m_hFile); } -bool CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile) +FX_BOOL CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile) { - return false; + return FALSE; } -bool FX_File_Exist(const CFX_ByteStringC& fileName) +FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName) { return access(fileName.GetCStr(), F_OK) > -1; } -bool FX_File_Exist(const CFX_WideStringC& fileName) +FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName) { return FX_File_Exist(FX_UTF8Encode(fileName)); } -bool FX_File_Delete(const CFX_ByteStringC& fileName) +FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName) { return remove(fileName.GetCStr()) > -1; } -bool FX_File_Delete(const CFX_WideStringC& fileName) +FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName) { return FX_File_Delete(FX_UTF8Encode(fileName)); } -bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) +FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) { CFXCRT_FileAccess_CRT src, dst; if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) { - return false; + return FALSE; } FX_FILESIZE size = src.GetSize(); if (!size) { - return false; + return FALSE; } if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) { - return false; + return FALSE; } FX_FILESIZE num = 0; uint8_t* pBuffer = FX_Alloc(uint8_t, 32768); @@ -176,17 +176,17 @@ bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fil } } FX_Free(pBuffer); - return true; + return TRUE; } -bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) +FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) { return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); } -bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) +FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst) { return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr()); } -bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) +FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst) { return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst)); } -- cgit v1.2.3