From 54055558f1e988a5020820ed5669ae26e6e10687 Mon Sep 17 00:00:00 2001 From: warmenhoven Date: Tue, 4 Apr 2023 10:06:34 -0400 Subject: [PATCH] Fix several warnings (#15153) --- frontend/drivers/platform_darwin.m | 4 +- input/input_driver.c | 3 +- libretro-common/include/retro_miscellaneous.h | 4 ++ pkg/apple/.gitignore | 2 + pkg/apple/HelperBar/HelperBarViewModel.swift | 2 +- .../RetroArch_Metal.xcodeproj/project.pbxproj | 2 + .../RetroArch_iOS13.xcodeproj/project.pbxproj | 41 ++++++++++++++----- record/record_driver.c | 2 + tasks/task_save.c | 1 - 9 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 pkg/apple/.gitignore diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index 1fa5d14ea7..ebe1f67998 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -331,8 +331,6 @@ static void frontend_darwin_get_env(int *argc, char *argv[], char assets_zip_path[PATH_MAX_LENGTH]; CFURLRef bundle_url; CFStringRef bundle_path; - CFURLRef resource_url; - CFStringRef resource_path; char temp_dir[PATH_MAX_LENGTH] = {0}; char bundle_path_buf[PATH_MAX_LENGTH] = {0}; char documents_dir_buf[PATH_MAX_LENGTH] = {0}; @@ -424,6 +422,8 @@ static void frontend_darwin_get_env(int *argc, char *argv[], fill_pathname_join_special(assets_zip_path, bundle_path_buf, "assets.zip", sizeof(assets_zip_path)); #else + CFURLRef resource_url; + CFStringRef resource_path; char resource_path_buf[PATH_MAX_LENGTH] = {0}; resource_url = CFBundleCopyResourcesDirectoryURL(bundle); resource_path = CFURLCopyPath(resource_url); diff --git a/input/input_driver.c b/input/input_driver.c index 31ef1fe2a3..e4883518c5 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -4988,7 +4988,7 @@ bool replay_set_serialized_data(void* buf) uint32_t *header = (uint32_t *)(buffer+sizeof(int32_t)); int64_t *identifier_spot = (int64_t *)(header+4); int64_t identifier = swap_if_big64(*identifier_spot); - int32_t handle_idx = intfstream_tell(input_st->bsv_movie_state_handle->file); + int64_t handle_idx = intfstream_tell(input_st->bsv_movie_state_handle->file); bool is_compatible = identifier == input_st->bsv_movie_state_handle->identifier; if (is_compatible) @@ -6136,6 +6136,7 @@ void input_driver_collect_system_input(input_driver_state_t *input_st, * Note: Keyboard input always read from * port 0 */ if ( !display_kb + && current_input && current_input->input_state) { unsigned i; diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index a3d2854f09..953ab18600 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -49,6 +49,10 @@ #include #endif +#ifdef IOS +#include +#endif + static INLINE void bits_or_bits(uint32_t *a, uint32_t *b, uint32_t count) { uint32_t i; diff --git a/pkg/apple/.gitignore b/pkg/apple/.gitignore new file mode 100644 index 0000000000..8e82f86a58 --- /dev/null +++ b/pkg/apple/.gitignore @@ -0,0 +1,2 @@ +xcuserdata/ +xcshareddata/ diff --git a/pkg/apple/HelperBar/HelperBarViewModel.swift b/pkg/apple/HelperBar/HelperBarViewModel.swift index 9d14d1f783..c2186e90bc 100644 --- a/pkg/apple/HelperBar/HelperBarViewModel.swift +++ b/pkg/apple/HelperBar/HelperBarViewModel.swift @@ -68,7 +68,7 @@ class HelperBarViewModel { func createBarButtonItems() -> [UIBarButtonItem] { barItemMapping.removeAll() return barItems.map{ [weak self] item in - let barButtonItem = UIBarButtonItem(image: item.image, style: .plain, target: self, action: #selector(didTapBarItem(_:))) + let barButtonItem = UIBarButtonItem(image: item.image, style: .plain, target: self, action: #selector(self?.didTapBarItem(_:))) self?.barItemMapping[barButtonItem] = item return barButtonItem } diff --git a/pkg/apple/RetroArch_Metal.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_Metal.xcodeproj/project.pbxproj index 97bfc11a31..8ef688cef5 100644 --- a/pkg/apple/RetroArch_Metal.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_Metal.xcodeproj/project.pbxproj @@ -1862,6 +1862,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 05D7753120A55D2700646447 /* BaseConfig.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; @@ -1944,6 +1945,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 05D7753120A55D2700646447 /* BaseConfig.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; diff --git a/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj index ae5ab195d9..5db4fb3f84 100644 --- a/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj @@ -1364,6 +1364,7 @@ /* Begin PBXShellScriptBuildPhase section */ 9204BE271D319EF300BD49DB /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -1534,7 +1535,10 @@ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_NO_PIE = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/iOS/modules"; MARKETING_VERSION = 1.15.0; MTL_FAST_MATH = YES; @@ -1671,7 +1675,10 @@ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_NO_PIE = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/iOS/modules"; MARKETING_VERSION = 1.15.0; MTL_FAST_MATH = YES; @@ -1831,7 +1838,10 @@ ); INFOPLIST_FILE = "$(SRCROOT)/tvOS/Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(PROJECT_DIR)/tvOS/modules", "@executable_path/Frameworks", @@ -1985,7 +1995,10 @@ ); INFOPLIST_FILE = "$(SRCROOT)/tvOS/Info.plist"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(PROJECT_DIR)/tvOS/modules", "@executable_path/Frameworks", @@ -2113,7 +2126,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 1.15.0; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UK699V5ZS8; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -2130,8 +2143,12 @@ INFOPLIST_KEY_CFBundleDisplayName = RetroArchWidgetExtension; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 RetroArch. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.15.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -2179,7 +2196,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 1.15.0; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = UK699V5ZS8; ENABLE_NS_ASSERTIONS = NO; @@ -2196,8 +2213,12 @@ INFOPLIST_KEY_CFBundleDisplayName = RetroArchWidgetExtension; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 RetroArch. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.15.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArchiOS11.RetroArchWidgetExtension; diff --git a/record/record_driver.c b/record/record_driver.c index 5c61f1adee..0116384d53 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -171,8 +171,10 @@ static bool record_driver_init_first( bool recording_deinit(void) { recording_state_t *recording_st = &recording_state; +#ifdef HAVE_FFMPEG settings_t *settings = config_get_ptr(); bool history_list_enable = settings->bools.history_list_enable; +#endif if ( !recording_st->data || !recording_st->driver) diff --git a/tasks/task_save.c b/tasks/task_save.c index 9aa04fc740..636feebd6f 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -1168,7 +1168,6 @@ static bool content_load_rastate1(unsigned char* input, size_t size) #ifdef HAVE_BSV_MOVIE else if (memcmp(marker, RASTATE_REPLAY_BLOCK, 4) == 0) { - input_driver_state_t *input_st = input_state_get_ptr(); #ifdef HAVE_REWIND bool frame_is_reversed = state_manager_frame_is_reversed(); #else