gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xsize.h File Reference
#include <stddef.h>
#include <limits.h>
#include "attribute.h"
Include dependency graph for xsize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XSIZE_INLINE   _GL_INLINE
 
#define xcast_size_t(N)    ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
 
#define xtimes(N, ELSIZE)    ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
 
#define size_overflow_p(SIZE)    ((SIZE) == SIZE_MAX)
 
#define size_in_bounds_p(SIZE)    ((SIZE) != SIZE_MAX)
 

Functions

_GL_INLINE size_t _GL_ATTRIBUTE_PURE xsum (size_t size1, size_t size2)
 
_GL_INLINE size_t _GL_ATTRIBUTE_PURE xsum3 (size_t size1, size_t size2, size_t size3)
 
_GL_INLINE size_t _GL_ATTRIBUTE_PURE xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
 
_GL_INLINE size_t _GL_ATTRIBUTE_PURE xmax (size_t size1, size_t size2)
 

Macro Definition Documentation

◆ size_in_bounds_p

#define size_in_bounds_p (   SIZE)     ((SIZE) != SIZE_MAX)

Definition at line 103 of file xsize.h.

◆ size_overflow_p

#define size_overflow_p (   SIZE)     ((SIZE) == SIZE_MAX)

Definition at line 100 of file xsize.h.

◆ xcast_size_t

#define xcast_size_t (   N)     ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)

Definition at line 58 of file xsize.h.

◆ XSIZE_INLINE

#define XSIZE_INLINE   _GL_INLINE

Definition at line 38 of file xsize.h.

◆ xtimes

#define xtimes (   N,
  ELSIZE 
)     ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)

Definition at line 96 of file xsize.h.

Function Documentation

◆ xmax()

_GL_INLINE size_t _GL_ATTRIBUTE_PURE xmax ( size_t  size1,
size_t  size2 
)

Definition at line 85 of file xsize.h.

Referenced by vasnprintf().

◆ xsum()

_GL_INLINE size_t _GL_ATTRIBUTE_PURE xsum ( size_t  size1,
size_t  size2 
)

Definition at line 63 of file xsize.h.

References SIZE_MAX.

Referenced by max_room_needed(), printf_parse(), vasnprintf(), xsum3(), and xsum4().

◆ xsum3()

_GL_INLINE size_t _GL_ATTRIBUTE_PURE xsum3 ( size_t  size1,
size_t  size2,
size_t  size3 
)

Definition at line 71 of file xsize.h.

References xsum().

Referenced by vasnprintf().

◆ xsum4()

_GL_INLINE size_t _GL_ATTRIBUTE_PURE xsum4 ( size_t  size1,
size_t  size2,
size_t  size3,
size_t  size4 
)

Definition at line 78 of file xsize.h.

References xsum().

Referenced by vasnprintf().