diff liboctave/util/lo-utils.h @ 29445:b5f3ae7610cf

Use gnulib macros that account for the output type in integer overflow checks. * liboctave/wrappers/intprops-wrappers.c, intprops-wrappers.h: Use gnulib macro INT_MULTIPLY_WRAPV instead of INT_MULTIPLY_OVERFLOW. Change function prototypes accordingly * liboctave/util/lo-utils.cc, lo-utils.h (int_multiply_ok): Change function prototypes. * libinterp/dldfcn/__ode15__.cc (IDA::set_up): Adapt for changed function.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 16 Mar 2021 18:17:42 +0100
parents 7854d5752dd2
children da7210e30f3e
line wrap: on
line diff
--- a/liboctave/util/lo-utils.h	Mon Mar 15 19:57:54 2021 +0100
+++ b/liboctave/util/lo-utils.h	Tue Mar 16 18:17:42 2021 +0100
@@ -114,24 +114,27 @@
 
   namespace math
   {
-    extern OCTAVE_API bool int_multiply_overflow (int a, int b);
+    extern OCTAVE_API bool int_multiply_overflow (int a, int b, int *r);
 
-    extern OCTAVE_API bool int_multiply_overflow (long int a, long int b);
+    extern OCTAVE_API bool
+    int_multiply_overflow (long int a, long int b, long int *r);
 
 #if defined (OCTAVE_HAVE_LONG_LONG_INT)
     extern OCTAVE_API bool
-    int_multiply_overflow (long long int a, long long int b);
+    int_multiply_overflow (long long int a, long long int b, long long int *r);
 #endif
 
     extern OCTAVE_API bool
-    int_multiply_overflow (unsigned int a, unsigned int b);
+    int_multiply_overflow (unsigned int a, unsigned int b, unsigned int *r);
 
     extern OCTAVE_API bool
-    int_multiply_overflow (unsigned long int a, unsigned long int b);
+    int_multiply_overflow (unsigned long int a, unsigned long int b,
+                           unsigned long int *r);
 
 #if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
     extern OCTAVE_API bool
-    int_multiply_overflow (unsigned long long int a, unsigned long long int b);
+    int_multiply_overflow (unsigned long long int a, unsigned long long int b,
+                           unsigned long long int *r);
 #endif
   }
 }