31 #ifndef WALTHAM_UTIL_H 32 #define WALTHAM_UTIL_H 44 #if defined(__GNUC__) && __GNUC__ >= 4 45 #define WTH_EXPORT __attribute__ ((visibility("default"))) 51 #if defined(__GNUC__) && __GNUC__ >= 4 52 #define WTH_DEPRECATED __attribute__ ((deprecated)) 54 #define WTH_DEPRECATED 58 #if defined(__GNUC__) && __GNUC__ >= 4 59 #define WTH_PRINTF(x, y) __attribute__((__format__(__printf__, x, y))) 61 #define WTH_PRINTF(x, y) 70 #define wth_array_for_each(pos, array) \ 71 for (pos = (array)->data; \ 72 (const char *) pos < ((const char *) (array)->data + (array)->size); \ 79 wth_array_release(
struct wth_array *array);
82 wth_array_add(
struct wth_array *array,
size_t size);
87 typedef int32_t wth_fixed_t;
90 wth_fixed_to_double (wth_fixed_t f)
97 u.i = ((1023LL + 44LL) << 52) + (1LL << 51) + f;
99 return u.d - (3LL << 43);
102 static inline wth_fixed_t
103 wth_fixed_from_double(
double d)
110 u.d = d + (3LL << (51 - 8));
116 wth_fixed_to_int(wth_fixed_t f)
121 static inline wth_fixed_t
122 wth_fixed_from_int(
int i)
Continue the iteration.
Definition: waltham-util.h:135
Definition: waltham-util.h:64
wth_iterator_result
This enum represents the return value of an iterator function.
Definition: waltham-util.h:131
Stop the iteration.
Definition: waltham-util.h:133