dhcpd-pools  2.28
ISC dhcpd lease usage analyser
Macros
intprops.h File Reference
#include <limits.h>
Include dependency graph for intprops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _GL_INT_CONVERT(e, v)   (0 * (e) + (v))
 
#define _GL_INT_NEGATE_CONVERT(e, v)   (0 * (e) - (v))
 
#define TYPE_IS_INTEGER(t)   ((t) 1.5 == 1)
 
#define TYPE_TWOS_COMPLEMENT(t)   ((t) ~ (t) 0 == (t) -1)
 
#define TYPE_ONES_COMPLEMENT(t)   ((t) ~ (t) 0 == 0)
 
#define TYPE_SIGNED_MAGNITUDE(t)   ((t) ~ (t) 0 < (t) -1)
 
#define _GL_INT_TWOS_COMPLEMENT(e)   (~ _GL_INT_CONVERT (e, 0) == -1)
 
#define TYPE_SIGNED(t)   (! ((t) 0 < (t) -1))
 
#define EXPR_SIGNED(e)   (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
 
#define TYPE_MINIMUM(t)
 
#define TYPE_MAXIMUM(t)
 
#define _GL_INT_MINIMUM(e)
 
#define _GL_INT_MAXIMUM(e)
 
#define _GL_SIGNED_INT_MAXIMUM(e)    (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
 
#define _GL_HAVE___TYPEOF__   0
 
#define _GL_SIGNED_TYPE_OR_EXPR(t)   1
 
#define INT_BITS_STRLEN_BOUND(b)   (((b) * 146 + 484) / 485)
 
#define INT_STRLEN_BOUND(t)
 
#define INT_BUFSIZE_BOUND(t)   (INT_STRLEN_BOUND (t) + 1)
 
#define INT_ADD_RANGE_OVERFLOW(a, b, min, max)
 
#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max)
 
#define INT_NEGATE_RANGE_OVERFLOW(a, min, max)
 
#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max)
 
#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max)    ((min) < 0 && (b) == -1 && (a) < - (max))
 
#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max)    INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
 
#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max)
 
#define _GL_ADD_OVERFLOW(a, b, min, max)
 
#define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
 
#define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
 
#define _GL_DIVIDE_OVERFLOW(a, b, min, max)
 
#define _GL_REMAINDER_OVERFLOW(a, b, min, max)
 
#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max)
 
#define INT_ADD_OVERFLOW(a, b)   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
 
#define INT_SUBTRACT_OVERFLOW(a, b)   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
 
#define INT_NEGATE_OVERFLOW(a)   INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
 
#define INT_MULTIPLY_OVERFLOW(a, b)   _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
 
#define INT_DIVIDE_OVERFLOW(a, b)   _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
 
#define INT_REMAINDER_OVERFLOW(a, b)   _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
 
#define INT_LEFT_SHIFT_OVERFLOW(a, b)
 
#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow)
 
#define INT_ADD_WRAPV(a, b, r)   _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
 
#define INT_SUBTRACT_WRAPV(a, b, r)   _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
 
#define INT_MULTIPLY_WRAPV(a, b, r)   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
 
#define __has_builtin(x)   0
 
#define _GL__GENERIC_BOGUS   0
 
#define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow)
 
#define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)
 
#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax)
 
#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax)
 
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax)
 

Macro Definition Documentation

#define __has_builtin (   x)    0
#define _GL__GENERIC_BOGUS   0
#define _GL_ADD_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
: (a) < 0 ? (b) <= (a) + (b) \
: (b) < 0 ? (a) <= (a) + (b) \
: (a) + (b) < (b))
#define INT_ADD_RANGE_OVERFLOW(a, b, min, max)
Definition: intprops.h:165
#define _GL_BINARY_OP_OVERFLOW (   a,
  b,
  op_result_overflow 
)
Value:
op_result_overflow (a, b, \
_GL_INT_MINIMUM (0 * (b) + (a)), \
_GL_INT_MAXIMUM (0 * (b) + (a)))
#define _GL_INT_MINIMUM(e)
Definition: intprops.h:77
#define _GL_INT_MAXIMUM(e)
Definition: intprops.h:81
#define _GL_DIVIDE_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
: (a) < 0 ? (b) <= (a) + (b) - 1 \
: (b) < 0 && (a) + (b) <= (a))
#define _GL_INT_NEGATE_CONVERT(e, v)
Definition: intprops.h:30
#define _GL_HAVE___TYPEOF__   0
#define _GL_INT_CONVERT (   e,
 
)    (0 * (e) + (v))
#define _GL_INT_MAXIMUM (   e)
Value:
#define _GL_SIGNED_INT_MAXIMUM(e)
Definition: intprops.h:85
#define _GL_INT_NEGATE_CONVERT(e, v)
Definition: intprops.h:30
#define EXPR_SIGNED(e)
Definition: intprops.h:55
#define _GL_INT_MINIMUM (   e)
Value:
: _GL_INT_CONVERT (e, 0))
#define _GL_SIGNED_INT_MAXIMUM(e)
Definition: intprops.h:85
#define _GL_INT_CONVERT(e, v)
Definition: intprops.h:26
#define _GL_INT_TWOS_COMPLEMENT(e)
Definition: intprops.h:48
#define EXPR_SIGNED(e)
Definition: intprops.h:55
#define _GL_INT_NEGATE_CONVERT (   e,
 
)    (0 * (e) - (v))
#define _GL_INT_OP_CALC (   a,
  b,
  r,
  op,
  overflow,
  ut,
  t,
  tmin,
  tmax 
)
Value:
(sizeof ((a) op (b)) < sizeof (t) \
? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
: _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax)
Definition: intprops.h:411
#define _GL_INT_OP_CALC1 (   a,
  b,
  r,
  op,
  overflow,
  ut,
  t,
  tmin,
  tmax 
)
Value:
((overflow (a, b) \
|| (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
|| (tmax) < ((a) op (b))) \
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
#define EXPR_SIGNED(e)
Definition: intprops.h:55
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax)
Definition: intprops.h:423
#define _GL_INT_OP_WRAPV (   a,
  b,
  r,
  op,
  builtin,
  overflow 
)
Value:
(sizeof *(r) == sizeof (signed char) \
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
signed char, SCHAR_MIN, SCHAR_MAX) \
: sizeof *(r) == sizeof (short int) \
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
short int, SHRT_MIN, SHRT_MAX) \
: sizeof *(r) == sizeof (int) \
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
int, INT_MIN, INT_MAX) \
: _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax)
Definition: intprops.h:407
#define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)
Definition: intprops.h:397
#define _GL_INT_OP_WRAPV_LONGISH (   a,
  b,
  r,
  op,
  overflow 
)
Value:
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
long int, LONG_MIN, LONG_MAX))
#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax)
Definition: intprops.h:407
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED (   a,
  b,
  op,
  ut,
  t,
  tmin,
  tmax 
)
Value:
(((ut) (a) op (ut) (b)) <= (tmax) \
? (t) ((ut) (a) op (ut) (b)) \
: ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
#define _GL_INT_TWOS_COMPLEMENT (   e)    (~ _GL_INT_CONVERT (e, 0) == -1)
#define _GL_MULTIPLY_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
(((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \
|| INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max)
Definition: intprops.h:188
#define _GL_REMAINDER_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
: (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \
: (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
#define _GL_INT_NEGATE_CONVERT(e, v)
Definition: intprops.h:30
#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max)
Definition: intprops.h:257
#define _GL_SIGNED_INT_MAXIMUM (   e)    (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
#define _GL_SIGNED_TYPE_OR_EXPR (   t)    1
#define _GL_SUBTRACT_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \
: (a) < 0 ? 1 \
: (b) < 0 ? (a) - (b) <= (a) \
: (a) < (b))
#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max)
Definition: intprops.h:172
#define _GL_UNSIGNED_NEG_MULTIPLE (   a,
  b,
  max 
)
Value:
(((b) < -_GL_SIGNED_INT_MAXIMUM (b) \
? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \
? (a) \
: (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
: (a) % - (b)) \
== 0)
#define _GL_SIGNED_INT_MAXIMUM(e)
Definition: intprops.h:85
#define _GL_INT_CONVERT(e, v)
Definition: intprops.h:26
#define EXPR_SIGNED (   e)    (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
#define INT_ADD_OVERFLOW (   a,
 
)    _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
#define INT_ADD_RANGE_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((b) < 0 \
? (a) < (min) - (b) \
: (max) - (b) < (a))
#define INT_ADD_WRAPV (   a,
  b,
 
)    _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
#define INT_BITS_STRLEN_BOUND (   b)    (((b) * 146 + 484) / 485)
#define INT_BUFSIZE_BOUND (   t)    (INT_STRLEN_BOUND (t) + 1)
#define INT_DIVIDE_OVERFLOW (   a,
 
)    _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
#define INT_DIVIDE_RANGE_OVERFLOW (   a,
  b,
  min,
  max 
)    ((min) < 0 && (b) == -1 && (a) < - (max))
#define INT_LEFT_SHIFT_OVERFLOW (   a,
 
)
Value:
#define _GL_INT_MINIMUM(e)
Definition: intprops.h:77
#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max)
Definition: intprops.h:221
#define _GL_INT_MAXIMUM(e)
Definition: intprops.h:81
#define INT_LEFT_SHIFT_RANGE_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((a) < 0 \
? (a) < (min) >> (b) \
: (max) >> (b) < (a))
#define INT_MULTIPLY_OVERFLOW (   a,
 
)    _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
#define INT_MULTIPLY_RANGE_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((b) < 0 \
? ((a) < 0 \
? (a) < (max) / (b) \
: (b) == -1 \
? 0 \
: (min) / (b) < (a)) \
: (b) == 0 \
? 0 \
: ((a) < 0 \
? (a) < (min) / (b) \
: (max) / (b) < (a)))
#define INT_MULTIPLY_WRAPV (   a,
  b,
 
)    _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
#define INT_NEGATE_OVERFLOW (   a)    INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
#define INT_NEGATE_RANGE_OVERFLOW (   a,
  min,
  max 
)
Value:
((min) < 0 \
? (a) < - (max) \
: 0 < (a))
#define INT_REMAINDER_OVERFLOW (   a,
 
)    _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
#define INT_REMAINDER_RANGE_OVERFLOW (   a,
  b,
  min,
  max 
)    INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
#define INT_STRLEN_BOUND (   t)
Value:
(INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \
#define _GL_SIGNED_TYPE_OR_EXPR(t)
Definition: intprops.h:104
#define INT_BITS_STRLEN_BOUND(b)
Definition: intprops.h:110

Referenced by strerror().

#define INT_SUBTRACT_OVERFLOW (   a,
 
)    _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
#define INT_SUBTRACT_RANGE_OVERFLOW (   a,
  b,
  min,
  max 
)
Value:
((b) < 0 \
? (max) + (b) < (a) \
: (a) < (min) + (b))
#define INT_SUBTRACT_WRAPV (   a,
  b,
 
)    _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
#define TYPE_IS_INTEGER (   t)    ((t) 1.5 == 1)
#define TYPE_MAXIMUM (   t)
Value:
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
#define TYPE_SIGNED(t)
Definition: intprops.h:51
#define TYPE_MINIMUM (   t)
Value:
((t) (! TYPE_SIGNED (t) \
? (t) 0 \
? ~ (t) 0 \
: ~ TYPE_MAXIMUM (t)))
#define TYPE_MAXIMUM(t)
Definition: intprops.h:70
#define TYPE_SIGNED_MAGNITUDE(t)
Definition: intprops.h:45
#define TYPE_SIGNED(t)
Definition: intprops.h:51
#define TYPE_ONES_COMPLEMENT (   t)    ((t) ~ (t) 0 == 0)
#define TYPE_SIGNED (   t)    (! ((t) 0 < (t) -1))
#define TYPE_SIGNED_MAGNITUDE (   t)    ((t) ~ (t) 0 < (t) -1)
#define TYPE_TWOS_COMPLEMENT (   t)    ((t) ~ (t) 0 == (t) -1)