mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-22 15:51:23 +00:00
Fixed some Xcode warnings
This commit is contained in:
parent
e3916993e2
commit
cef1514b01
|
@ -72,7 +72,6 @@ SDL_GetPrefPath(const char *org, const char *app)
|
||||||
{ @autoreleasepool
|
{ @autoreleasepool
|
||||||
{
|
{
|
||||||
char *retval = NULL;
|
char *retval = NULL;
|
||||||
static SDL_bool shown = SDL_FALSE;
|
|
||||||
NSArray *array;
|
NSArray *array;
|
||||||
|
|
||||||
if (!app) {
|
if (!app) {
|
||||||
|
@ -94,10 +93,13 @@ SDL_GetPrefPath(const char *org, const char *app)
|
||||||
* between sessions. If you want your app's save data to
|
* between sessions. If you want your app's save data to
|
||||||
* actually stick around, you'll need to use iCloud storage.
|
* actually stick around, you'll need to use iCloud storage.
|
||||||
*/
|
*/
|
||||||
if (!shown)
|
|
||||||
{
|
{
|
||||||
shown = SDL_TRUE;
|
static SDL_bool shown = SDL_FALSE;
|
||||||
SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.\n");
|
if (!shown)
|
||||||
|
{
|
||||||
|
shown = SDL_TRUE;
|
||||||
|
SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||||
|
|
|
@ -186,8 +186,10 @@ IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCController *controlle
|
||||||
Uint8 subtype = 0;
|
Uint8 subtype = 0;
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
|
|
||||||
if ((@available(macOS 11.3, *)) && !GCController.shouldMonitorBackgroundEvents) {
|
if (@available(macOS 11.3, iOS 14.5, tvOS 14.5, *)) {
|
||||||
GCController.shouldMonitorBackgroundEvents = YES;
|
if (!GCController.shouldMonitorBackgroundEvents) {
|
||||||
|
GCController.shouldMonitorBackgroundEvents = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Explicitly retain the controller because SDL_JoystickDeviceItem is a
|
/* Explicitly retain the controller because SDL_JoystickDeviceItem is a
|
||||||
|
@ -576,7 +578,9 @@ IOS_JoystickInit(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
#ifdef SDL_JOYSTICK_MFI
|
||||||
NSNotificationCenter *center;
|
NSNotificationCenter *center;
|
||||||
|
#endif
|
||||||
#ifdef SDL_JOYSTICK_iOS_ACCELEROMETER
|
#ifdef SDL_JOYSTICK_iOS_ACCELEROMETER
|
||||||
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE)) {
|
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE)) {
|
||||||
/* Default behavior, accelerometer as joystick */
|
/* Default behavior, accelerometer as joystick */
|
||||||
|
|
|
@ -114,7 +114,7 @@ LoadHiddenSystemCursor(NSString *cursorName, SEL fallback)
|
||||||
NSString *cursorPath = [@"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Resources/cursors" stringByAppendingPathComponent:cursorName];
|
NSString *cursorPath = [@"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Resources/cursors" stringByAppendingPathComponent:cursorName];
|
||||||
NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:[cursorPath stringByAppendingPathComponent:@"info.plist"]];
|
NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:[cursorPath stringByAppendingPathComponent:@"info.plist"]];
|
||||||
/* we can't do animation atm. :/ */
|
/* we can't do animation atm. :/ */
|
||||||
const int frames = [[info valueForKey:@"frames"] integerValue];
|
const int frames = (int)[[info valueForKey:@"frames"] integerValue];
|
||||||
NSCursor *cursor;
|
NSCursor *cursor;
|
||||||
NSImage *image = [[NSImage alloc] initWithContentsOfFile:[cursorPath stringByAppendingPathComponent:@"cursor.pdf"]];
|
NSImage *image = [[NSImage alloc] initWithContentsOfFile:[cursorPath stringByAppendingPathComponent:@"cursor.pdf"]];
|
||||||
if ((image == nil) || (image.valid == NO)) {
|
if ((image == nil) || (image.valid == NO)) {
|
||||||
|
|
Loading…
Reference in a new issue