diff options
author | 2019-05-21 17:41:21 +0300 | |
---|---|---|
committer | 2019-05-21 17:41:21 +0300 | |
commit | cabb90c1240015ee5cd17d91573588527bcc2482 (patch) | |
tree | 0e3b07fa887ca25a12e32f5c126407d149483a21 /src/common/utils.c | |
parent | bb70fccb66f55e9cc2b9ed0bf366479828f41346 (diff) | |
download | usurpation-cabb90c1240015ee5cd17d91573588527bcc2482.tar.gz usurpation-cabb90c1240015ee5cd17d91573588527bcc2482.tar.bz2 usurpation-cabb90c1240015ee5cd17d91573588527bcc2482.zip |
Protocol: changes to interface and some re-implementation.
Most functions exposed in protocol.h take a connection descriptor
(cd_t) as first argument. This allows for multiple connections. Device
gets only one connection which means that cd_t is effectively 0 all
the time.
Additionaly, any function that actually does anything with a
connection descriptor instead of just passing it to another function
must be implemented separately in device and daemon.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src/common/utils.c')
-rw-r--r-- | src/common/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/utils.c b/src/common/utils.c index 956ef1b..0619517 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -6,22 +6,22 @@ int cmp_uuid(uuid_t *first, uuid_t *second) return memcmp(first, second, sizeof(*first)); } -fpi1_t add(fpi1_t a, fpi1_t b) +fpi1_t fpi1_add(fpi1_t a, fpi1_t b) { return a + b; } -fpi1_t sub(fpi1_t a, fpi1_t b) +fpi1_t fpi1_sub(fpi1_t a, fpi1_t b) { return a - b; } -fpi1_t mul(fpi1_t a, fpi1_t b) +fpi1_t fpi1_mul(fpi1_t a, fpi1_t b) { return (fpi1_t)(((long)a * (long)b) / 100); } -fpi1_t div(fpi1_t a, fpi1_t b) +fpi1_t fpi1_div(fpi1_t a, fpi1_t b) { return (fpi1_t)(((long)a * 10) / ((long)b * 10)); } |