From a39c43374ab5ffebde91453159af586f48b0ee7a Mon Sep 17 00:00:00 2001
From: Slávek Banko <slavek.banko@axis.cz>
Date: Thu, 17 Sep 2026 02:00:01 +0200
Subject: Replace TQ_INT32 compatibility hack with int32_t
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
---
 src/libs/jpegutils/jpegint.h | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/libs/jpegutils/jpegint.h b/src/libs/jpegutils/jpegint.h
index bf01aa3e..91122ef5 100644
--- a/src/libs/jpegutils/jpegint.h
+++ b/src/libs/jpegutils/jpegint.h
@@ -14,10 +14,7 @@
  */
 
 
-/* Ensuring definition INT32 */
-#ifndef INT32
-#define INT32	TQ_INT32
-#endif
+#include <stdint.h>
 
 /* Declarations for both compression & decompression */
 
@@ -280,16 +277,16 @@ struct jpeg_color_quantizer {
  * shift" instructions that shift in copies of the sign bit.  But some
  * C compilers implement >> with an unsigned shift.  For these machines you
  * must define RIGHT_SHIFT_IS_UNSIGNED.
- * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
+ * RIGHT_SHIFT provides a proper signed right shift of an int32_t quantity.
  * It is only applied with constant shift counts.  SHIFT_TEMPS must be
  * included in the variables of any routine using RIGHT_SHIFT.
  */
 
 #ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define SHIFT_TEMPS	INT32 shift_temp;
+#define SHIFT_TEMPS	int32_t shift_temp;
 #define RIGHT_SHIFT(x,shft)  \
 	((shift_temp = (x)) < 0 ? \
-	 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
+	 (shift_temp >> (shft)) | ((~((int32_t) 0)) << (32-(shft))) : \
 	 (shift_temp >> (shft)))
 #else
 #define SHIFT_TEMPS
@@ -402,7 +399,7 @@ extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */
 extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */
 
 /* Arithmetic coding probability estimation tables in jaricom.c */
-extern const INT32 jpeg_aritab[];
+extern const int32_t jpeg_aritab[];
 
 /* Suppress undefined-structure complaints if necessary. */
 
@@ -691,16 +688,16 @@ struct jpeg_color_quantizer {
  * shift" instructions that shift in copies of the sign bit.  But some
  * C compilers implement >> with an unsigned shift.  For these machines you
  * must define RIGHT_SHIFT_IS_UNSIGNED.
- * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
+ * RIGHT_SHIFT provides a proper signed right shift of an int32_t quantity.
  * It is only applied with constant shift counts.  SHIFT_TEMPS must be
  * included in the variables of any routine using RIGHT_SHIFT.
  */
 
 #ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define SHIFT_TEMPS	INT32 shift_temp;
+#define SHIFT_TEMPS	int32_t shift_temp;
 #define RIGHT_SHIFT(x,shft)  \
 	((shift_temp = (x)) < 0 ? \
-	 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
+	 (shift_temp >> (shft)) | ((~((int32_t) 0)) << (32-(shft))) : \
 	 (shift_temp >> (shft)))
 #else
 #define SHIFT_TEMPS
-- 
cgit v1.2.3

