From 9eaea7d6614c00c865c8059a161631a2668adf12 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 12 Jan 2023 20:51:01 +0100
Subject: [PATCH] SDL_migration.cocci: simplify multiplicaction / division by 1
---
build-scripts/SDL_migration.cocci | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 1bc2be863237..611dbd9b6308 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -215,7 +215,7 @@ expression e;
- SDL_GetRevisionNumber()
// SDL_RWread
-@@
+@ rule_rwread @
expression e1, e2, e3, e4;
identifier i;
@@
@@ -237,7 +237,7 @@ identifier i;
)
// SDL_RWwrite
-@@
+@ rule_rwwrite @
expression e1, e2, e3, e4;
identifier i;
@@
@@ -257,6 +257,17 @@ identifier i;
+ e3 * e4)
)
+@ depends on rule_rwread || rule_rwwrite @
+expression e;
+@@
+(
+- e * 1
++ e
+|
+- e / 1
++ e
+)
+
// SDL_SIMDAlloc(), SDL_SIMDFree() have been removed.
@@
expression e1;