diff mbox series

[fbtest,11/17] drawops: Make dT1 and dS1 in do_ellipse() unsigned

Message ID 20241215104508.191237-12-geert@linux-m68k.org
State New
Headers show
Series Export feature and large ellipses support | expand

Commit Message

Geert Uytterhoeven Dec. 15, 2024, 10:45 a.m. UTC
"dT1" and "dS1" are never negative, so they should be unsigned.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drawops/generic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drawops/generic.c b/drawops/generic.c
index 5c068e10d28fbdfe..5fd971b59bc698fe 100644
--- a/drawops/generic.c
+++ b/drawops/generic.c
@@ -316,8 +316,8 @@  static void do_ellipse(u32 x, u32 y, u32 a, u32 b, pixel_t pixel,
 	u32 y1 = b;
 	int S = a2*(1-2*b)+2*b2;
 	int T = b2-2*a2*(2*b-1);
-	int dT1 = 4*b2;
-	int dS1 = dT1+2*b2;
+	unsigned int dT1 = 4*b2;
+	unsigned int dS1 = dT1+2*b2;
 	int dS2 = -4*a2*(b-1);
 	int dT2 = dS2+2*a2;
 
@@ -358,8 +358,8 @@  static void do_ellipse(u32 x, u32 y, u32 a, u32 b, pixel_t pixel,
 	u32 y1 = 0;
 	int S = b2*(1-2*a)+2*a2;
 	int T = a2-2*b2*(2*a-1);
-	int dT1 = 4*a2;
-	int dS1 = dT1+2*a2;
+	unsigned int dT1 = 4*a2;
+	unsigned int dS1 = dT1+2*a2;
 	int dS2 = -4*b2*(a-1);
 	int dT2 = dS2+2*b2;