VSF Documented
Macros
stddef.h File Reference
#include "shell/sys/linux/include/simple_libc/stddef.h"

Go to the source code of this file.

Macros

#define offsetof   vsf_offset_of
 
#define clamp(v, a, b)   min(max(a, v), b)
 
#define ifloor(x)   ((x) > 0 ? (int)(x) : (int)((x) - 0.9999999999))
 
#define iround(x)   ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5))
 
#define iceil(x)   ((x) > 0 ? (int)((x) + 0.9999999999) : (int)(x))
 
#define idiv255(x)   ((((int)(x) + 1) * 257) >> 16)
 

Macro Definition Documentation

◆ offsetof

#define offsetof   vsf_offset_of

◆ clamp

#define clamp (   v,
  a,
 
)    min(max(a, v), b)

◆ ifloor

#define ifloor (   x)    ((x) > 0 ? (int)(x) : (int)((x) - 0.9999999999))

◆ iround

#define iround (   x)    ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5))

◆ iceil

#define iceil (   x)    ((x) > 0 ? (int)((x) + 0.9999999999) : (int)(x))

◆ idiv255

#define idiv255 (   x)    ((((int)(x) + 1) * 257) >> 16)