30 #ifndef _GL_INLINE_HEADER_BEGIN
31 #error "Please include config.h first."
33 _GL_INLINE_HEADER_BEGIN
35 # define XSIZE_INLINE _GL_INLINE
55 #define xcast_size_t(N) \
56 ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
63 xsum (
size_t size1,
size_t size2)
65 size_t sum = size1 + size2;
74 xsum3 (
size_t size1,
size_t size2,
size_t size3)
76 return xsum (
xsum (size1, size2), size3);
84 xsum4 (
size_t size1,
size_t size2,
size_t size3,
size_t size4)
94 xmax (
size_t size1,
size_t size2)
98 return (size1 >= size2 ? size1 : size2);
105 #define xtimes(N, ELSIZE) \
106 ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
109 #define size_overflow_p(SIZE) \
112 #define size_in_bounds_p(SIZE) \
115 _GL_INLINE_HEADER_END
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
t_real sum(int n1, int n2, int n3, t_real u[n1][n2][n3])
XSIZE_INLINE size_t xsum4(size_t size1, size_t size2, size_t size3, size_t size4)
Sum of four sizes, with overflow check.
#define XSIZE_INLINE
xsize.h – Checked size_t computations.
XSIZE_INLINE size_t xsum(size_t size1, size_t size2)
Sum of two sizes, with overflow check.
XSIZE_INLINE size_t xmax(size_t size1, size_t size2)
Maximum of two sizes, with overflow check.
XSIZE_INLINE size_t xsum3(size_t size1, size_t size2, size_t size3)
Sum of three sizes, with overflow check.