blob: 956ef1bba87e86524f1dc058673346482b3d619c (
plain)
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
|
#include "utils.h"
#include "string.h"
int cmp_uuid(uuid_t *first, uuid_t *second)
{
return memcmp(first, second, sizeof(*first));
}
fpi1_t add(fpi1_t a, fpi1_t b)
{
return a + b;
}
fpi1_t sub(fpi1_t a, fpi1_t b)
{
return a - b;
}
fpi1_t mul(fpi1_t a, fpi1_t b)
{
return (fpi1_t)(((long)a * (long)b) / 100);
}
fpi1_t div(fpi1_t a, fpi1_t b)
{
return (fpi1_t)(((long)a * 10) / ((long)b * 10));
}
|