1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks

This commit is contained in:
Rémi Verschelde
2021-05-04 14:41:06 +02:00
parent 64a63e0861
commit b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions

View File

@@ -88,7 +88,6 @@ static void _setup_clock() {
#endif
void OS_Unix::debug_break() {
assert(false);
};
@@ -101,7 +100,6 @@ static void handle_interrupt(int sig) {
}
void OS_Unix::initialize_debugging() {
if (ScriptDebugger::get_singleton() != NULL) {
struct sigaction action;
memset(&action, 0, sizeof(action));
@@ -111,12 +109,10 @@ void OS_Unix::initialize_debugging() {
}
int OS_Unix::unix_initialize_audio(int p_audio_driver) {
return 0;
}
void OS_Unix::initialize_core() {
#if !defined(NO_THREADS)
init_thread_posix();
#endif
@@ -137,17 +133,14 @@ void OS_Unix::initialize_core() {
}
void OS_Unix::finalize_core() {
NetSocketPosix::cleanup();
}
void OS_Unix::alert(const String &p_alert, const String &p_title) {
fprintf(stderr, "ALERT: %s: %s\n", p_title.utf8().get_data(), p_alert.utf8().get_data());
}
String OS_Unix::get_stdin_string(bool p_block) {
if (p_block) {
char buff[1024];
String ret = stdin_buf + fgets(buff, 1024, stdin);
@@ -159,12 +152,10 @@ String OS_Unix::get_stdin_string(bool p_block) {
}
String OS_Unix::get_name() const {
return "Unix";
}
uint64_t OS_Unix::get_unix_time() const {
return time(NULL);
};
@@ -253,7 +244,6 @@ void OS_Unix::delay_usec(uint32_t p_usec) const {
}
}
uint64_t OS_Unix::get_ticks_usec() const {
#if defined(__APPLE__)
uint64_t longtime = mach_absolute_time() * _clock_scale;
#else
@@ -269,19 +259,16 @@ uint64_t OS_Unix::get_ticks_usec() const {
}
Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool read_stderr, Mutex *p_pipe_mutex) {
#ifdef __EMSCRIPTEN__
// Don't compile this code at all to avoid undefined references.
// Actual virtual call goes to OS_JavaScript.
ERR_FAIL_V(ERR_BUG);
#else
if (p_blocking && r_pipe) {
String argss;
argss = "\"" + p_path + "\"";
for (int i = 0; i < p_arguments.size(); i++) {
argss += String(" \"") + p_arguments[i] + "\"";
}
@@ -297,7 +284,6 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
char buf[65535];
while (fgets(buf, 65535, f)) {
if (p_pipe_mutex) {
p_pipe_mutex->lock();
}
@@ -342,14 +328,12 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
}
if (p_blocking) {
int status;
waitpid(pid, &status, 0);
if (r_exitcode)
*r_exitcode = WIFEXITED(status) ? WEXITSTATUS(status) : status;
} else {
if (r_child_id)
*r_child_id = pid;
}
@@ -359,7 +343,6 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
}
Error OS_Unix::kill(const ProcessID &p_pid) {
int ret = ::kill(p_pid, SIGKILL);
if (!ret) {
//avoid zombie process
@@ -370,17 +353,14 @@ Error OS_Unix::kill(const ProcessID &p_pid) {
}
int OS_Unix::get_process_id() const {
return getpid();
};
bool OS_Unix::has_environment(const String &p_var) const {
return getenv(p_var.utf8().get_data()) != NULL;
}
String OS_Unix::get_locale() const {
if (!has_environment("LANG"))
return "en";
@@ -392,7 +372,6 @@ 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()) {
@@ -439,7 +418,6 @@ Error OS_Unix::get_dynamic_library_symbol_handle(void *p_library_handle, const S
}
Error OS_Unix::set_cwd(const String &p_cwd) {
if (chdir(p_cwd.utf8().get_data()) != 0)
return ERR_CANT_OPEN;
@@ -447,24 +425,20 @@ Error OS_Unix::set_cwd(const String &p_cwd) {
}
String OS_Unix::get_environment(const String &p_var) const {
if (getenv(p_var.utf8().get_data()))
return getenv(p_var.utf8().get_data());
return "";
}
bool OS_Unix::set_environment(const String &p_var, const String &p_value) const {
return setenv(p_var.utf8().get_data(), p_value.utf8().get_data(), /* overwrite: */ true) == 0;
}
int OS_Unix::get_processor_count() const {
return sysconf(_SC_NPROCESSORS_CONF);
}
String OS_Unix::get_user_data_dir() const {
String appname = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/name"));
if (appname != "") {
bool use_custom_dir = ProjectSettings::get_singleton()->get("application/config/use_custom_user_dir");
@@ -483,7 +457,6 @@ String OS_Unix::get_user_data_dir() const {
}
String OS_Unix::get_executable_path() const {
#ifdef __linux__
//fix for running from a symlink
char buf[256];