You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
Style: Replaces uses of 0/NULL by nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
@@ -212,10 +212,10 @@ String DirAccess::fix_path(String p_path) const {
|
||||
return p_path;
|
||||
}
|
||||
|
||||
DirAccess::CreateFunc DirAccess::create_func[ACCESS_MAX] = { 0, 0, 0 };
|
||||
DirAccess::CreateFunc DirAccess::create_func[ACCESS_MAX] = { nullptr, nullptr, nullptr };
|
||||
|
||||
DirAccess *DirAccess::create_for_path(const String &p_path) {
|
||||
DirAccess *da = NULL;
|
||||
DirAccess *da = nullptr;
|
||||
if (p_path.begins_with("res://")) {
|
||||
da = create(ACCESS_RESOURCES);
|
||||
} else if (p_path.begins_with("user://")) {
|
||||
@@ -230,20 +230,20 @@ DirAccess *DirAccess::create_for_path(const String &p_path) {
|
||||
DirAccess *DirAccess::open(const String &p_path, Error *r_error) {
|
||||
DirAccess *da = create_for_path(p_path);
|
||||
|
||||
ERR_FAIL_COND_V_MSG(!da, NULL, "Cannot create DirAccess for path '" + p_path + "'.");
|
||||
ERR_FAIL_COND_V_MSG(!da, nullptr, "Cannot create DirAccess for path '" + p_path + "'.");
|
||||
Error err = da->change_dir(p_path);
|
||||
if (r_error)
|
||||
*r_error = err;
|
||||
if (err != OK) {
|
||||
memdelete(da);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return da;
|
||||
}
|
||||
|
||||
DirAccess *DirAccess::create(AccessType p_access) {
|
||||
DirAccess *da = create_func[p_access] ? create_func[p_access]() : NULL;
|
||||
DirAccess *da = create_func[p_access] ? create_func[p_access]() : nullptr;
|
||||
if (da) {
|
||||
da->_access_type = p_access;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user