NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
utils.h File Reference
#include <stddef.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARRAYLEN(x)   (sizeof(x) / sizeof((x)[0]))
 
#define ARRAYEND(x)   (&(x)[ARRAYLEN(x)])
 
#define CONCAT_HELPER(x, y)   x ## y
 
#define CONCAT(x, y)   CONCAT_HELPER(x, y)
 
#define STR_HELPER(x)   #x
 
#define STR(x)   STR_HELPER(x)
 
#define BITCOUNT(x)   (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
 
#define BX_(x)   ((x) - (((x)>>1)&0x77777777) - (((x)>>2)&0x33333333) - (((x)>>3)&0x11111111))
 
#define UNUSED(x)   (void)(x)
 
#define container_of(ptr, type, member)
 

Macro Definition Documentation

#define ARRAYEND (   x)    (&(x)[ARRAYLEN(x)])
#define ARRAYLEN (   x)    (sizeof(x) / sizeof((x)[0]))
#define BITCOUNT (   x)    (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
#define BX_ (   x)    ((x) - (((x)>>1)&0x77777777) - (((x)>>2)&0x33333333) - (((x)>>3)&0x11111111))
#define CONCAT (   x,
 
)    CONCAT_HELPER(x, y)
#define CONCAT_HELPER (   x,
 
)    x ## y
#define container_of (   ptr,
  type,
  member 
)
Value:
(\
(type *)( (char *)((const typeof( ((type *)0)->member )*)ptr) - offsetof(type,member) ))
uint8_t type
Definition: fat_standard.h:67
#define STR (   x)    STR_HELPER(x)
#define STR_HELPER (   x)    #x
#define UNUSED (   x)    (void)(x)