GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
intprops-wrappers.c
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2020-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include "intprops.h"
31 
32 #include "intprops-wrappers.h"
33 
34 // The *_OVERFLOW macros are provided by gnulib. We don't include gnulib
35 // headers directly in Octave's C++ source files to avoid problems that
36 // may be caused by the way that gnulib overrides standard library
37 // functions.
38 
39 #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
40 # pragma GCC diagnostic ignored "-Wsign-compare"
41 # pragma GCC diagnostic ignored "-Wtype-limits"
42 #endif
43 
44 int
46 {
47  return INT_MULTIPLY_WRAPV (a, b, r);
48 }
49 
50 int
51 octave_li_multiply_overflow_wrapper (long int a, long int b, long int *r)
52 {
53  return INT_MULTIPLY_WRAPV (a, b, r);
54 }
55 
56 #if defined (OCTAVE_HAVE_LONG_LONG_INT)
57 int
58 octave_lli_multiply_overflow_wrapper (long long int a, long long int b,
59  long long int *r)
60 {
61  return INT_MULTIPLY_WRAPV (a, b, r);
62 }
63 #endif
64 
65 int
66 octave_ui_multiply_overflow_wrapper (unsigned int a, unsigned int b,
67  unsigned int *r)
68 {
69  return INT_MULTIPLY_WRAPV (a, b, r);
70 }
71 
72 int
73 octave_uli_multiply_overflow_wrapper (unsigned long int a, unsigned long int b,
74  unsigned long int *r)
75 {
76  return INT_MULTIPLY_WRAPV (a, b, r);
77 }
78 
79 #if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
80 int
81 octave_ulli_multiply_overflow_wrapper (unsigned long long int a,
82  unsigned long long int b,
83  unsigned long long int *r)
84 {
85  return INT_MULTIPLY_WRAPV (a, b, r);
86 }
87 #endif
int octave_i_multiply_overflow_wrapper(int a, int b, int *r)
int octave_li_multiply_overflow_wrapper(long int a, long int b, long int *r)
int octave_uli_multiply_overflow_wrapper(unsigned long int a, unsigned long int b, unsigned long int *r)
int octave_ui_multiply_overflow_wrapper(unsigned int a, unsigned int b, unsigned int *r)
T * r
Definition: mx-inlines.cc:773