Fixed build warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m
index e657829..aa01657 100644
--- a/src/joystick/iphoneos/SDL_mfijoystick.m
+++ b/src/joystick/iphoneos/SDL_mfijoystick.m
@@ -1085,13 +1085,17 @@ IOS_MFIJoystickUpdate(SDL_Joystick *joystick)
-(void)cleanup
{
- if (self.player != nil) {
- [self.player cancelAndReturnError:nil];
- self.player = nil;
- }
- if (self.engine != nil) {
- [self.engine stopWithCompletionHandler:nil];
- self.engine = nil;
+ @autoreleasepool {
+ if (@available(macos 11.0, iOS 14.0, tvOS 14.0, *)) {
+ if (self.player != nil) {
+ [self.player cancelAndReturnError:nil];
+ self.player = nil;
+ }
+ if (self.engine != nil) {
+ [self.engine stopWithCompletionHandler:nil];
+ self.engine = nil;
+ }
+ }
}
}
diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m
index 1709fce..05d8a94 100644
--- a/src/render/metal/SDL_render_metal.m
+++ b/src/render/metal/SDL_render_metal.m
@@ -1029,13 +1029,6 @@ METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
}}
-// normalize a value from 0.0f to len into 0.0f to 1.0f.
-static inline float
-normtex(const float _val, const float len)
-{
- return _val / len;
-}
-
static int
METAL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd)
{