diff options
Diffstat (limited to 'toxcore/util.h')
-rw-r--r-- | toxcore/util.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/toxcore/util.h b/toxcore/util.h index 4c5023cf..76951fff 100644 --- a/toxcore/util.h +++ b/toxcore/util.h | |||
@@ -36,20 +36,18 @@ | |||
36 | extern "C" { | 36 | extern "C" { |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #define MIN(a,b) (((a)<(b))?(a):(b)) | ||
40 | #define PAIR(TYPE1__, TYPE2__) struct { TYPE1__ first; TYPE2__ second; } | ||
41 | |||
42 | /* id functions */ | 39 | /* id functions */ |
43 | bool id_equal(const uint8_t *dest, const uint8_t *src); | 40 | bool id_equal(const uint8_t *dest, const uint8_t *src); |
44 | uint32_t id_copy(uint8_t *dest, const uint8_t *src); /* return value is CLIENT_ID_SIZE */ | 41 | uint32_t id_copy(uint8_t *dest, const uint8_t *src); /* return value is CLIENT_ID_SIZE */ |
45 | 42 | ||
46 | void host_to_net(uint8_t *num, uint16_t numbytes); | 43 | void host_to_net(uint8_t *num, uint16_t numbytes); |
47 | #define net_to_host(x, y) host_to_net(x, y) | 44 | void net_to_host(uint8_t *num, uint16_t numbytes); |
48 | 45 | ||
49 | /* Returns -1 if failed or 0 if success */ | 46 | /* Returns -1 if failed or 0 if success */ |
50 | int create_recursive_mutex(pthread_mutex_t *mutex); | 47 | int create_recursive_mutex(pthread_mutex_t *mutex); |
51 | 48 | ||
52 | int32_t max_s32(int32_t a, int32_t b); | 49 | int32_t max_s32(int32_t a, int32_t b); |
50 | uint32_t min_u32(uint32_t a, uint32_t b); | ||
53 | uint64_t min_u64(uint64_t a, uint64_t b); | 51 | uint64_t min_u64(uint64_t a, uint64_t b); |
54 | 52 | ||
55 | #ifdef __cplusplus | 53 | #ifdef __cplusplus |