mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 00:43:46 +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:
parent
2b429b24b5
commit
a828398655
633 changed files with 4454 additions and 4410 deletions
|
@ -122,7 +122,7 @@ String DirAccessUnix::get_next() {
|
|||
|
||||
dirent *entry = readdir(dir_stream);
|
||||
|
||||
if (entry == NULL) {
|
||||
if (entry == nullptr) {
|
||||
list_dir_end();
|
||||
return "";
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ bool DirAccessUnix::current_is_hidden() const {
|
|||
void DirAccessUnix::list_dir_end() {
|
||||
if (dir_stream)
|
||||
closedir(dir_stream);
|
||||
dir_stream = 0;
|
||||
dir_stream = nullptr;
|
||||
_cisdir = false;
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ static void _get_drives(List<String> *list) {
|
|||
char strings[4096];
|
||||
|
||||
while (getmntent_r(mtab, &mnt, strings, sizeof(strings))) {
|
||||
if (mnt.mnt_dir != NULL && _filter_drive(&mnt)) {
|
||||
if (mnt.mnt_dir != nullptr && _filter_drive(&mnt)) {
|
||||
// Avoid duplicates
|
||||
if (!list->find(mnt.mnt_dir)) {
|
||||
list->push_back(mnt.mnt_dir);
|
||||
|
@ -290,7 +290,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
|
|||
// prev_dir is the directory we are changing out of
|
||||
String prev_dir;
|
||||
char real_current_dir_name[2048];
|
||||
ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == NULL, ERR_BUG);
|
||||
ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == nullptr, ERR_BUG);
|
||||
if (prev_dir.parse_utf8(real_current_dir_name))
|
||||
prev_dir = real_current_dir_name; //no utf8, maybe latin?
|
||||
|
||||
|
@ -311,7 +311,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
|
|||
|
||||
String base = _get_root_path();
|
||||
if (base != String() && !try_dir.begins_with(base)) {
|
||||
ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == NULL, ERR_BUG);
|
||||
ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == nullptr, ERR_BUG);
|
||||
String new_dir;
|
||||
new_dir.parse_utf8(real_current_dir_name);
|
||||
|
||||
|
@ -391,14 +391,14 @@ bool DirAccessUnix::is_hidden(const String &p_name) {
|
|||
}
|
||||
|
||||
DirAccessUnix::DirAccessUnix() {
|
||||
dir_stream = 0;
|
||||
dir_stream = nullptr;
|
||||
_cisdir = false;
|
||||
|
||||
/* determine drive count */
|
||||
|
||||
// set current directory to an absolute path of the current directory
|
||||
char real_current_dir_name[2048];
|
||||
ERR_FAIL_COND(getcwd(real_current_dir_name, 2048) == NULL);
|
||||
ERR_FAIL_COND(getcwd(real_current_dir_name, 2048) == nullptr);
|
||||
if (current_dir.parse_utf8(real_current_dir_name))
|
||||
current_dir = real_current_dir_name;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue