csnip  0.1
Macros | Functions
util.h File Reference
#include <string.h>
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define csnip_Tswap(type, a, b)
 Swap two variables, type explicitly specified.
 
#define csnip_Swap(a, b)
 Swap two variables. More...
 
#define csnip_Cswap(a, b)
 Swap two variables using memcpy(). More...
 
#define csnip_Min(a, b)    ((a) < (b) ? (a) : (b))
 Minimum of 2 values.
 
#define csnip_Max(a, b)    ((a) > (b) ? (a) : (b))
 Maximum of 2 values.
 
#define csnip_Static_len(a)   (sizeof(a) / sizeof(*(a)))
 Length of a C static array.
 
#define csnip_Fill_n(dest, len, val)
 Fill a range with values. More...
 
#define csnip_Fill(dest_begin, dest_end, val)    csnip_Fill_n(dest_begin, (dest_end) - (dest_begin), val)
 Fill a range with values. More...
 
#define csnip_Copy_n(src, len, dest)
 Copy a range from src to dest. More...
 
#define csnip_Copy(src_begin, src_end, dest)    csnip_Copy_n(src_begin, (src_end) - (src_begin), dest)
 Copy a range from src to dest. More...
 

Functions

size_t csnip_next_pow_of_2 (size_t a)
 Compute the next power of 2 of a number.