summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/dir_access_unix.cpp26
-rw-r--r--drivers/unix/file_access_unix.cpp2
-rw-r--r--drivers/unix/net_socket_posix.cpp6
-rw-r--r--drivers/unix/os_unix.cpp6
-rw-r--r--drivers/unix/os_unix.h1
5 files changed, 18 insertions, 23 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index a2c9bae852..1754b47c85 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -71,7 +71,7 @@ Error DirAccessUnix::list_dir_begin() {
bool DirAccessUnix::file_exists(String p_file) {
GLOBAL_LOCK_FUNCTION
- if (p_file.is_rel_path()) {
+ if (p_file.is_relative_path()) {
p_file = current_dir.plus_file(p_file);
}
@@ -90,7 +90,7 @@ bool DirAccessUnix::file_exists(String p_file) {
bool DirAccessUnix::dir_exists(String p_dir) {
GLOBAL_LOCK_FUNCTION
- if (p_dir.is_rel_path()) {
+ if (p_dir.is_relative_path()) {
p_dir = get_current_dir().plus_file(p_dir);
}
@@ -105,7 +105,7 @@ bool DirAccessUnix::dir_exists(String p_dir) {
bool DirAccessUnix::is_readable(String p_dir) {
GLOBAL_LOCK_FUNCTION
- if (p_dir.is_rel_path()) {
+ if (p_dir.is_relative_path()) {
p_dir = get_current_dir().plus_file(p_dir);
}
@@ -116,7 +116,7 @@ bool DirAccessUnix::is_readable(String p_dir) {
bool DirAccessUnix::is_writable(String p_dir) {
GLOBAL_LOCK_FUNCTION
- if (p_dir.is_rel_path()) {
+ if (p_dir.is_relative_path()) {
p_dir = get_current_dir().plus_file(p_dir);
}
@@ -125,7 +125,7 @@ bool DirAccessUnix::is_writable(String p_dir) {
}
uint64_t DirAccessUnix::get_modified_time(String p_file) {
- if (p_file.is_rel_path()) {
+ if (p_file.is_relative_path()) {
p_file = current_dir.plus_file(p_file);
}
@@ -293,7 +293,7 @@ bool DirAccessUnix::drives_are_shortcuts() {
Error DirAccessUnix::make_dir(String p_dir) {
GLOBAL_LOCK_FUNCTION
- if (p_dir.is_rel_path()) {
+ if (p_dir.is_relative_path()) {
p_dir = get_current_dir().plus_file(p_dir);
}
@@ -328,7 +328,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
// try_dir is the directory we are trying to change into
String try_dir = "";
- if (p_dir.is_rel_path()) {
+ if (p_dir.is_relative_path()) {
String next_dir = current_dir.plus_file(p_dir);
next_dir = next_dir.simplify_path();
try_dir = next_dir;
@@ -372,13 +372,13 @@ String DirAccessUnix::get_current_dir(bool p_include_drive) {
}
Error DirAccessUnix::rename(String p_path, String p_new_path) {
- if (p_path.is_rel_path()) {
+ if (p_path.is_relative_path()) {
p_path = get_current_dir().plus_file(p_path);
}
p_path = fix_path(p_path);
- if (p_new_path.is_rel_path()) {
+ if (p_new_path.is_relative_path()) {
p_new_path = get_current_dir().plus_file(p_new_path);
}
@@ -388,7 +388,7 @@ Error DirAccessUnix::rename(String p_path, String p_new_path) {
}
Error DirAccessUnix::remove(String p_path) {
- if (p_path.is_rel_path()) {
+ if (p_path.is_relative_path()) {
p_path = get_current_dir().plus_file(p_path);
}
@@ -407,7 +407,7 @@ Error DirAccessUnix::remove(String p_path) {
}
bool DirAccessUnix::is_link(String p_file) {
- if (p_file.is_rel_path()) {
+ if (p_file.is_relative_path()) {
p_file = get_current_dir().plus_file(p_file);
}
@@ -422,7 +422,7 @@ bool DirAccessUnix::is_link(String p_file) {
}
String DirAccessUnix::read_link(String p_file) {
- if (p_file.is_rel_path()) {
+ if (p_file.is_relative_path()) {
p_file = get_current_dir().plus_file(p_file);
}
@@ -439,7 +439,7 @@ String DirAccessUnix::read_link(String p_file) {
}
Error DirAccessUnix::create_link(String p_source, String p_target) {
- if (p_target.is_rel_path()) {
+ if (p_target.is_relative_path()) {
p_target = get_current_dir().plus_file(p_target);
}
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index 6ea55219bb..f07c654bd6 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -111,7 +111,7 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
}
}
- if (is_backup_save_enabled() && (p_mode_flags & WRITE) && !(p_mode_flags & READ)) {
+ if (is_backup_save_enabled() && (p_mode_flags == WRITE)) {
save_path = path;
path = path + ".tmp";
}
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp
index efeaf32ff7..e01c6a0e0f 100644
--- a/drivers/unix/net_socket_posix.cpp
+++ b/drivers/unix/net_socket_posix.cpp
@@ -269,11 +269,11 @@ _FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IPAddress p_ip, Str
break; // IPv6 uses index.
}
- for (List<IPAddress>::Element *F = c.ip_addresses.front(); F; F = F->next()) {
- if (!F->get().is_ipv4()) {
+ for (const IPAddress &F : c.ip_addresses) {
+ if (!F.is_ipv4()) {
continue; // Wrong IP type
}
- if_ip = F->get();
+ if_ip = F;
break;
}
break;
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index a5c61bbea5..3032c31629 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -139,10 +139,6 @@ void OS_Unix::finalize_core() {
NetSocketPosix::cleanup();
}
-void OS_Unix::alert(const String &p_alert, const String &p_title) {
- fprintf(stderr, "ERROR: %s\n", p_alert.utf8().get_data());
-}
-
String OS_Unix::get_stdin_string(bool p_block) {
if (p_block) {
char buff[1024];
@@ -396,7 +392,7 @@ String OS_Unix::get_locale() const {
Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
String path = p_path;
- if (FileAccess::exists(path) && path.is_rel_path()) {
+ if (FileAccess::exists(path) && path.is_relative_path()) {
// dlopen expects a slash, in this case a leading ./ for it to be interpreted as a relative path,
// otherwise it will end up searching various system directories for the lib instead and finally failing.
path = "./" + path;
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 6c79d984e9..bf82019d38 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -52,7 +52,6 @@ protected:
public:
OS_Unix();
- virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
virtual String get_stdin_string(bool p_block) override;
//virtual void set_mouse_show(bool p_show);