diff options
| author | 2014-12-03 12:57:57 -0600 | |
|---|---|---|
| committer | 2014-12-03 12:57:57 -0600 | |
| commit | 8a624239703c046d89ebeaf3ea13c87af75b550f (patch) | |
| tree | 19546d2b06c71add6140f322a8aab0c918bbd9ca /src/common/file_util.cpp | |
| parent | Merge pull request #236 from rohit-n/sign-compare (diff) | |
| download | yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.gz yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.xz yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.zip | |
Change NULLs to nullptrs.
Diffstat (limited to 'src/common/file_util.cpp')
| -rw-r--r-- | src/common/file_util.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index b6dec838c..6c4860503 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -140,7 +140,7 @@ bool CreateDir(const std::string &path) | |||
| 140 | { | 140 | { |
| 141 | INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str()); | 141 | INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str()); |
| 142 | #ifdef _WIN32 | 142 | #ifdef _WIN32 |
| 143 | if (::CreateDirectory(Common::UTF8ToTStr(path).c_str(), NULL)) | 143 | if (::CreateDirectory(Common::UTF8ToTStr(path).c_str(), nullptr)) |
| 144 | return true; | 144 | return true; |
| 145 | DWORD error = GetLastError(); | 145 | DWORD error = GetLastError(); |
| 146 | if (error == ERROR_ALREADY_EXISTS) | 146 | if (error == ERROR_ALREADY_EXISTS) |
| @@ -423,7 +423,7 @@ u32 ScanDirectoryTree(const std::string &directory, FSTEntry& parentEntry) | |||
| 423 | FSTEntry entry; | 423 | FSTEntry entry; |
| 424 | const std::string virtualName(Common::TStrToUTF8(ffd.cFileName)); | 424 | const std::string virtualName(Common::TStrToUTF8(ffd.cFileName)); |
| 425 | #else | 425 | #else |
| 426 | struct dirent dirent, *result = NULL; | 426 | struct dirent dirent, *result = nullptr; |
| 427 | 427 | ||
| 428 | DIR *dirp = opendir(directory.c_str()); | 428 | DIR *dirp = opendir(directory.c_str()); |
| 429 | if (!dirp) | 429 | if (!dirp) |
| @@ -491,7 +491,7 @@ bool DeleteDirRecursively(const std::string &directory) | |||
| 491 | { | 491 | { |
| 492 | const std::string virtualName(Common::TStrToUTF8(ffd.cFileName)); | 492 | const std::string virtualName(Common::TStrToUTF8(ffd.cFileName)); |
| 493 | #else | 493 | #else |
| 494 | struct dirent dirent, *result = NULL; | 494 | struct dirent dirent, *result = nullptr; |
| 495 | DIR *dirp = opendir(directory.c_str()); | 495 | DIR *dirp = opendir(directory.c_str()); |
| 496 | if (!dirp) | 496 | if (!dirp) |
| 497 | return false; | 497 | return false; |
| @@ -552,7 +552,7 @@ void CopyDir(const std::string &source_path, const std::string &dest_path) | |||
| 552 | if (!FileUtil::Exists(source_path)) return; | 552 | if (!FileUtil::Exists(source_path)) return; |
| 553 | if (!FileUtil::Exists(dest_path)) FileUtil::CreateFullPath(dest_path); | 553 | if (!FileUtil::Exists(dest_path)) FileUtil::CreateFullPath(dest_path); |
| 554 | 554 | ||
| 555 | struct dirent dirent, *result = NULL; | 555 | struct dirent dirent, *result = nullptr; |
| 556 | DIR *dirp = opendir(source_path.c_str()); | 556 | DIR *dirp = opendir(source_path.c_str()); |
| 557 | if (!dirp) return; | 557 | if (!dirp) return; |
| 558 | 558 | ||
| @@ -586,11 +586,11 @@ std::string GetCurrentDir() | |||
| 586 | { | 586 | { |
| 587 | char *dir; | 587 | char *dir; |
| 588 | // Get the current working directory (getcwd uses malloc) | 588 | // Get the current working directory (getcwd uses malloc) |
| 589 | if (!(dir = __getcwd(NULL, 0))) { | 589 | if (!(dir = __getcwd(nullptr, 0))) { |
| 590 | 590 | ||
| 591 | ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", | 591 | ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", |
| 592 | GetLastErrorMsg()); | 592 | GetLastErrorMsg()); |
| 593 | return NULL; | 593 | return nullptr; |
| 594 | } | 594 | } |
| 595 | std::string strDir = dir; | 595 | std::string strDir = dir; |
| 596 | free(dir); | 596 | free(dir); |
| @@ -626,7 +626,7 @@ std::string& GetExeDirectory() | |||
| 626 | if (DolphinPath.empty()) | 626 | if (DolphinPath.empty()) |
| 627 | { | 627 | { |
| 628 | TCHAR Dolphin_exe_Path[2048]; | 628 | TCHAR Dolphin_exe_Path[2048]; |
| 629 | GetModuleFileName(NULL, Dolphin_exe_Path, 2048); | 629 | GetModuleFileName(nullptr, Dolphin_exe_Path, 2048); |
| 630 | DolphinPath = Common::TStrToUTF8(Dolphin_exe_Path); | 630 | DolphinPath = Common::TStrToUTF8(Dolphin_exe_Path); |
| 631 | DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\')); | 631 | DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\')); |
| 632 | } | 632 | } |
| @@ -826,7 +826,7 @@ void SplitFilename83(const std::string& filename, std::array<char, 9>& short_nam | |||
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | IOFile::IOFile() | 828 | IOFile::IOFile() |
| 829 | : m_file(NULL), m_good(true) | 829 | : m_file(nullptr), m_good(true) |
| 830 | {} | 830 | {} |
| 831 | 831 | ||
| 832 | IOFile::IOFile(std::FILE* file) | 832 | IOFile::IOFile(std::FILE* file) |
| @@ -834,7 +834,7 @@ IOFile::IOFile(std::FILE* file) | |||
| 834 | {} | 834 | {} |
| 835 | 835 | ||
| 836 | IOFile::IOFile(const std::string& filename, const char openmode[]) | 836 | IOFile::IOFile(const std::string& filename, const char openmode[]) |
| 837 | : m_file(NULL), m_good(true) | 837 | : m_file(nullptr), m_good(true) |
| 838 | { | 838 | { |
| 839 | Open(filename, openmode); | 839 | Open(filename, openmode); |
| 840 | } | 840 | } |
| @@ -845,7 +845,7 @@ IOFile::~IOFile() | |||
| 845 | } | 845 | } |
| 846 | 846 | ||
| 847 | IOFile::IOFile(IOFile&& other) | 847 | IOFile::IOFile(IOFile&& other) |
| 848 | : m_file(NULL), m_good(true) | 848 | : m_file(nullptr), m_good(true) |
| 849 | { | 849 | { |
| 850 | Swap(other); | 850 | Swap(other); |
| 851 | } | 851 | } |
| @@ -880,14 +880,14 @@ bool IOFile::Close() | |||
| 880 | if (!IsOpen() || 0 != std::fclose(m_file)) | 880 | if (!IsOpen() || 0 != std::fclose(m_file)) |
| 881 | m_good = false; | 881 | m_good = false; |
| 882 | 882 | ||
| 883 | m_file = NULL; | 883 | m_file = nullptr; |
| 884 | return m_good; | 884 | return m_good; |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | std::FILE* IOFile::ReleaseHandle() | 887 | std::FILE* IOFile::ReleaseHandle() |
| 888 | { | 888 | { |
| 889 | std::FILE* const ret = m_file; | 889 | std::FILE* const ret = m_file; |
| 890 | m_file = NULL; | 890 | m_file = nullptr; |
| 891 | return ret; | 891 | return ret; |
| 892 | } | 892 | } |
| 893 | 893 | ||