forked from sleepybishop/nanorq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
30 lines (22 loc) · 804 Bytes
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef NANORQ_UTIL_H
#define NANORQ_UTIL_H
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <octmat.h>
#include "kvec.h"
#define div_ceil(A, B) ((A) / (B) + ((A) % (B) ? 1 : 0))
#define div_floor(A, B) ((A) / (B))
#define TMPSWAP(type, a, b) \
do { \
type __tmp = a; \
a = b; \
b = __tmp; \
} while (0)
typedef struct {
uint32_t esi;
octmat row;
} repair_sym;
typedef kvec_t(repair_sym) repair_vec;
typedef kvec_t(unsigned) uint_vec;
#endif