From 9bbe51dc279e1203962bdf0b3266c9b14307638c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 5 Apr 2021 14:02:50 +0200 Subject: Style: Apply clang-tidy's `modernize-use-nullptr` --- platform/linuxbsd/joypad_linux.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/linuxbsd/joypad_linux.cpp') 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; } -- cgit v1.2.3 From d83761ba80b90e17aaefaa83c7ece0fa89511266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 5 Apr 2021 14:09:59 +0200 Subject: Style: Apply clang-tidy's `readability-braces-around-statements` --- platform/linuxbsd/joypad_linux.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/linuxbsd/joypad_linux.cpp') diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 1b15ad00f6..e8f4352dff 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -185,10 +185,11 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { if (devnode) { String devnode_str = devnode; if (devnode_str.find(ignore_str) == -1) { - if (action == "add") + if (action == "add") { open_joypad(devnode); - else if (String(action) == "remove") + } else if (String(action) == "remove") { close_joypad(get_joy_from_path(devnode)); + } } } -- cgit v1.2.3