From efa2945502abb069ab8b1ba8a6ba253fa32b80cd Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 12 Jan 2023 09:57:59 +0100
Subject: [PATCH] SDL_migration.cocci: add SIMD Alloc / Free
---
build-scripts/SDL_migration.cocci | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 08fa1e886d87..7161feef9b5b 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -31,6 +31,21 @@
// So this file is a set of many semantic patches, mostly independant.
+
+// SDL_SIMDAlloc(), SDL_SIMDFree() have been removed.
+@@
+expression e1;
+@@
+- SDL_SIMDAlloc(e1)
++ SDL_aligned_alloc(SDL_SIMDGetAlignment(), e1)
+
+@@
+expression e1;
+@@
+- SDL_SIMDFree(
++ SDL_aligned_free(
+ e1)
+
// SDL_Vulkan_GetInstanceExtensions() no longer takes a window parameter.
@@
expression e1, e2, e3;
@@ -42,7 +57,6 @@ expression e1, e2, e3;
// SDL_Vulkan_GetVkGetInstanceProcAddr() now returns `SDL_FunctionPointer` instead of `void *`, and should be cast to PFN_vkGetInstanceProcAddr.
@@
typedef PFN_vkGetInstanceProcAddr;
-expression e1, e2, e3;
@@
+ (PFN_vkGetInstanceProcAddr)
SDL_Vulkan_GetVkGetInstanceProcAddr()