summaryrefslogtreecommitdiff
path: root/src/shared/gameinfo.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-11-28 11:19:20 +0100
committerTannin <devnull@localhost>2014-11-28 11:19:20 +0100
commit99de80e7224f2491fb7518e32f195ad6a912b624 (patch)
treeef8f1d3ba16b7681beaae5cf67d0f5671e486061 /src/shared/gameinfo.cpp
parent78f628e0af2f2df562c40ac1424b432b6a969055 (diff)
replaced all uses of NULL with nullptr
fixed a few placed where NULL was used as a number or boolean
Diffstat (limited to 'src/shared/gameinfo.cpp')
-rw-r--r--src/shared/gameinfo.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp
index 1a815701..3727ea49 100644
--- a/src/shared/gameinfo.cpp
+++ b/src/shared/gameinfo.cpp
@@ -37,7 +37,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
namespace MOShared {
-GameInfo* GameInfo::s_Instance = NULL;
+GameInfo* GameInfo::s_Instance = nullptr;
GameInfo::GameInfo(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gameDirectory)
@@ -62,14 +62,14 @@ void GameInfo::identifyMyGamesDirectory(const std::wstring &file)
m_MyGamesDirectory.clear();
// a) this is the way it should work. get the configured My Documents\My Games directory
- if (::SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, myDocuments) == S_OK) {
+ if (::SHGetFolderPathW(nullptr, CSIDL_PERSONAL, nullptr, SHGFP_TYPE_CURRENT, myDocuments) == S_OK) {
m_MyGamesDirectory = std::wstring(myDocuments) + L"\\My Games";
}
// b) if there is no <game> directory there, look in the default directory
if (m_MyGamesDirectory.empty()
|| !FileExists(m_MyGamesDirectory + L"\\" + file)) {
- if (::SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_DEFAULT, myDocuments) == S_OK) {
+ if (::SHGetFolderPathW(nullptr, CSIDL_PERSONAL, nullptr, SHGFP_TYPE_DEFAULT, myDocuments) == S_OK) {
std::wstring fromDefault = std::wstring(myDocuments) + L"\\My Games";
if (FileExists(fromDefault + L"\\" + file)) {
m_MyGamesDirectory = fromDefault;
@@ -99,13 +99,13 @@ bool GameInfo::identifyGame(const std::wstring &moDirectory, const std::wstring
s_Instance = new SkyrimInfo(moDirectory, moDataDirectory, searchPath);
}
- return s_Instance != NULL;
+ return s_Instance != nullptr;
}
bool GameInfo::init(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gamePath)
{
- if (s_Instance == NULL) {
+ if (s_Instance == nullptr) {
if (gamePath.length() == 0) {
// search upward in the directory until a recognized game-binary is found
std::wstring searchPath(moDirectory);
@@ -191,7 +191,7 @@ std::wstring GameInfo::getLocalAppFolder() const
wchar_t localAppFolder[MAX_PATH];
memset(localAppFolder, '\0', MAX_PATH * sizeof(wchar_t));
- if (::SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, localAppFolder) == S_OK) {
+ if (::SHGetFolderPathW(nullptr, CSIDL_LOCAL_APPDATA, nullptr, SHGFP_TYPE_CURRENT, localAppFolder) == S_OK) {
return localAppFolder;
} else {
// fallback: try the registry
@@ -212,7 +212,7 @@ std::wstring GameInfo::getSpecialPath(LPCWSTR name) const
WCHAR temp[MAX_PATH];
DWORD bufferSize = MAX_PATH;
- errorcode = ::RegQueryValueExW(key, name, NULL, NULL, (LPBYTE)temp, &bufferSize);
+ errorcode = ::RegQueryValueExW(key, name, nullptr, nullptr, (LPBYTE)temp, &bufferSize);
if (errorcode != ERROR_SUCCESS) {
throw windows_error((boost::format("failed to look up special folder (%1%)") % ToString(name, true)).str(), errorcode);
}