diff options
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/crash_handler_osx.mm | 9 | ||||
-rw-r--r-- | platform/osx/display_server_osx.mm | 3 | ||||
-rw-r--r-- | platform/osx/godot_main_osx.mm | 4 | ||||
-rw-r--r-- | platform/osx/joypad_osx.cpp | 14 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 2 | ||||
-rw-r--r-- | platform/osx/osx_terminal_logger.mm | 5 |
6 files changed, 23 insertions, 14 deletions
diff --git a/platform/osx/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index 3e640b3bf3..06ed91907c 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -89,8 +89,9 @@ static void handle_crash(int sig) { fprintf(stderr, "\n================================================================\n"); fprintf(stderr, "%s: Program crashed with signal %d\n", __FUNCTION__, sig); - if (OS::get_singleton()->get_main_loop()) + if (OS::get_singleton()->get_main_loop()) { OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_CRASH); + } // Print the engine version just before, so that people are reminded to include the version in backtrace reports. if (String(VERSION_HASH).is_empty()) { @@ -119,8 +120,9 @@ static void handle_crash(int sig) { snprintf(fname, 1024, "%s", demangled); } - if (demangled) + if (demangled) { free(demangled); + } } } @@ -177,8 +179,9 @@ CrashHandler::~CrashHandler() { } void CrashHandler::disable() { - if (disabled) + if (disabled) { return; + } #ifdef CRASH_HANDLER_ENABLED signal(SIGSEGV, nullptr); diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index b7258e6cf4..b2201eabbc 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -790,8 +790,9 @@ String DisplayServerOSX::global_menu_get_item_submenu(const String &p_menu_root, const NSMenu *sub_menu = [menu_item submenu]; if (sub_menu) { for (Map<String, NSMenu *>::Element *E = submenu.front(); E; E = E->next()) { - if (E->get() == sub_menu) + if (E->get() == sub_menu) { return E->key(); + } } } } diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm index 7fabfaa1b7..f3db363151 100644 --- a/platform/osx/godot_main_osx.mm +++ b/platform/osx/godot_main_osx.mm @@ -49,7 +49,7 @@ int main(int argc, char **argv) { first_arg = i + 2; } printf("%i: %s\n", i, argv[i]); - }; + } #ifdef DEBUG_ENABLED // Lets report the path we made current after all that. @@ -84,4 +84,4 @@ int main(int argc, char **argv) { Main::cleanup(); return os.get_exit_code(); -}; +} diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp index d518206f04..7d31ede61d 100644 --- a/platform/osx/joypad_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -322,10 +322,11 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) { // Bluetooth device. String guid = "05000000"; for (int i = 0; i < 12; i++) { - if (i < name.size()) + if (i < name.size()) { guid += _hex_str(name[i]); - else + } else { guid += "00"; + } } input->joy_connection_changed(id, true, name, guid); } @@ -381,8 +382,9 @@ bool joypad::check_ff_features() { if (ret == FF_OK && (features.supportedEffects & FFCAP_ET_CONSTANTFORCE)) { uint32_t val; ret = FFDeviceGetForceFeedbackProperty(ff_device, FFPROP_FFGAIN, &val, sizeof(val)); - if (ret != FF_OK) + if (ret != FF_OK) { return false; + } int num_axes = features.numFfAxes; ff_axes = (DWORD *)memalloc(sizeof(DWORD) * num_axes); ff_directions = (LONG *)memalloc(sizeof(LONG) * num_axes); @@ -509,16 +511,18 @@ void JoypadOSX::joypad_vibration_stop(int p_id, uint64_t p_timestamp) { int JoypadOSX::get_joy_index(int p_id) const { for (int i = 0; i < device_list.size(); i++) { - if (device_list[i].id == p_id) + if (device_list[i].id == p_id) { return i; + } } return -1; } int JoypadOSX::get_joy_ref(IOHIDDeviceRef p_device) const { for (int i = 0; i < device_list.size(); i++) { - if (device_list[i].device_ref == p_device) + if (device_list[i].device_ref == p_device) { return i; + } } return -1; } diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 868721e875..6700f8fe82 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -441,7 +441,7 @@ void OS_OSX::run() { } @catch (NSException *exception) { ERR_PRINT("NSException: " + String::utf8([exception reason].UTF8String)); } - }; + } main_loop->finalize(); } diff --git a/platform/osx/osx_terminal_logger.mm b/platform/osx/osx_terminal_logger.mm index c1dca111a7..48e26f42bf 100644 --- a/platform/osx/osx_terminal_logger.mm +++ b/platform/osx/osx_terminal_logger.mm @@ -40,10 +40,11 @@ void OSXTerminalLogger::log_error(const char *p_function, const char *p_file, in } const char *err_details; - if (p_rationale && p_rationale[0]) + if (p_rationale && p_rationale[0]) { err_details = p_rationale; - else + } else { err_details = p_code; + } switch (p_type) { case ERR_WARNING: |