diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2021-04-05 14:02:50 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-04-05 14:05:07 +0200 |
commit | 9bbe51dc279e1203962bdf0b3266c9b14307638c (patch) | |
tree | c9cd262d5930dfb7b07176c2e879845c95f04e84 /platform | |
parent | 65a288805726b219cb8f524db0c87fa58332a267 (diff) |
Style: Apply clang-tidy's `modernize-use-nullptr`
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/export/export.cpp | 8 | ||||
-rw-r--r-- | platform/javascript/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 8 | ||||
-rw-r--r-- | platform/linuxbsd/joypad_linux.cpp | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 326e513261..428a3c7c8c 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -2484,7 +2484,7 @@ public: _clear_assets_directory(); if (!apk_expansion) { print_verbose("Exporting project files.."); - err = export_project_files(p_preset, rename_and_store_file_in_gradle_project, NULL, ignore_so_file); + err = export_project_files(p_preset, rename_and_store_file_in_gradle_project, nullptr, ignore_so_file); if (err != OK) { EditorNode::add_io_error("Could not export project files to gradle project\n"); return err; @@ -2813,11 +2813,11 @@ public: zipOpenNewFileInZip(unaligned_apk, "assets/_cl_", &zipfi, - NULL, + nullptr, 0, - NULL, + nullptr, 0, - NULL, + nullptr, 0, // No compress (little size gain and potentially slower startup) Z_DEFAULT_COMPRESSION); zipWriteInFileInZip(unaligned_apk, command_line_flags.ptr(), command_line_flags.size()); diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 1e89e144cc..3f04bedea2 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -550,7 +550,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese if (f) { file_sizes[pck_path.get_file()] = (uint64_t)f->get_len(); memdelete(f); - f = NULL; + f = nullptr; } _fix_html(html, p_preset, p_path.get_file().get_basename(), p_debug, p_flags, shared_objects, file_sizes); f = FileAccess::open(p_path, FileAccess::WRITE); diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index d6ed416d7c..8dc1b41702 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -2012,7 +2012,7 @@ int DisplayServerX11::keyboard_get_layout_count() const { XkbGetNames(x11_display, XkbSymbolsNameMask, kbd); const Atom *groups = kbd->names->groups; - if (kbd->ctrls != NULL) { + if (kbd->ctrls != nullptr) { _group_count = kbd->ctrls->num_groups; } else { while (_group_count < XkbNumKbdGroups && groups[_group_count] != None) { @@ -2046,7 +2046,7 @@ String DisplayServerX11::keyboard_get_layout_language(int p_index) const { int _group_count = 0; const Atom *groups = kbd->names->groups; - if (kbd->ctrls != NULL) { + if (kbd->ctrls != nullptr) { _group_count = kbd->ctrls->num_groups; } else { while (_group_count < XkbNumKbdGroups && groups[_group_count] != None) { @@ -2085,7 +2085,7 @@ String DisplayServerX11::keyboard_get_layout_name(int p_index) const { int _group_count = 0; const Atom *groups = kbd->names->groups; - if (kbd->ctrls != NULL) { + if (kbd->ctrls != nullptr) { _group_count = kbd->ctrls->num_groups; } else { while (_group_count < XkbNumKbdGroups && groups[_group_count] != None) { @@ -2684,7 +2684,7 @@ bool DisplayServerX11::_wait_for_events() const { tv.tv_sec = 1; // Wait for next event or timeout. - int num_ready_fds = select(x11_fd + 1, &in_fds, NULL, NULL, &tv); + int num_ready_fds = select(x11_fd + 1, &in_fds, nullptr, nullptr, &tv); if (num_ready_fds > 0) { // Event received. diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 8ea0f6c246..1b15ad00f6 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -178,7 +178,7 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { select() ensured that this will not block. */ dev = udev_monitor_receive_device(mon); - if (dev && udev_device_get_devnode(dev) != 0) { + if (dev && udev_device_get_devnode(dev) != nullptr) { MutexLock lock(joy_mutex); String action = udev_device_get_action(dev); const char *devnode = udev_device_get_devnode(dev); @@ -212,7 +212,7 @@ void JoypadLinux::monitor_joypads() { struct dirent *current; char fname[64]; - while ((current = readdir(input_directory)) != NULL) { + while ((current = readdir(input_directory)) != nullptr) { if (strncmp(current->d_name, "event", 5) != 0) { continue; } |