1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +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:
Rémi Verschelde
2021-05-04 16:00:45 +02:00
parent 2b429b24b5
commit a828398655
633 changed files with 4454 additions and 4410 deletions

View File

@@ -73,7 +73,7 @@ void FileAccessUnix::check_errors() const {
Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
if (f)
fclose(f);
f = NULL;
f = nullptr;
path_src = p_path;
path = fix_path(p_path);
@@ -116,7 +116,7 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
f = fopen(path.utf8().get_data(), mode_string);
if (f == NULL) {
if (f == nullptr) {
switch (errno) {
case ENOENT: {
last_error = ERR_FILE_NOT_FOUND;
@@ -151,7 +151,7 @@ void FileAccessUnix::close() {
return;
fclose(f);
f = NULL;
f = nullptr;
if (close_notification_func) {
close_notification_func(path, flags);
@@ -170,7 +170,7 @@ void FileAccessUnix::close() {
}
bool FileAccessUnix::is_open() const {
return (f != NULL);
return (f != nullptr);
}
String FileAccessUnix::get_path() const {
@@ -331,10 +331,10 @@ FileAccess *FileAccessUnix::create_libc() {
return memnew(FileAccessUnix);
}
CloseNotificationFunc FileAccessUnix::close_notification_func = NULL;
CloseNotificationFunc FileAccessUnix::close_notification_func = nullptr;
FileAccessUnix::FileAccessUnix() :
f(NULL),
f(nullptr),
flags(0),
last_error(OK) {
}