diff options
author | iphydf <iphydf@users.noreply.github.com> | 2019-01-12 21:28:21 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-03-05 22:56:26 +0000 |
commit | e35d70af1822095b7b273f1cec16878645b90078 (patch) | |
tree | 143241b035976125cfb7fee241e3fde9ad02195b /toxcore/util.c | |
parent | cbc26d9b165277e3c450806e1da1e6904a9dcedb (diff) |
Use net_pack/unpack instead of host_to_net.
The latter is doing pretty much the same thing but in a confusing way (it
doesn't change the type of the variable, but does change the semantics).
Diffstat (limited to 'toxcore/util.c')
-rw-r--r-- | toxcore/util.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/toxcore/util.c b/toxcore/util.c index 73e16c45..3625f3d1 100644 --- a/toxcore/util.c +++ b/toxcore/util.c | |||
@@ -52,25 +52,6 @@ uint32_t id_copy(uint8_t *dest, const uint8_t *src) | |||
52 | return CRYPTO_PUBLIC_KEY_SIZE; | 52 | return CRYPTO_PUBLIC_KEY_SIZE; |
53 | } | 53 | } |
54 | 54 | ||
55 | void host_to_net(uint8_t *num, uint16_t numbytes) | ||
56 | { | ||
57 | #ifndef WORDS_BIGENDIAN | ||
58 | uint32_t i; | ||
59 | VLA(uint8_t, buff, numbytes); | ||
60 | |||
61 | for (i = 0; i < numbytes; ++i) { | ||
62 | buff[i] = num[numbytes - i - 1]; | ||
63 | } | ||
64 | |||
65 | memcpy(num, buff, numbytes); | ||
66 | #endif | ||
67 | } | ||
68 | |||
69 | void net_to_host(uint8_t *num, uint16_t numbytes) | ||
70 | { | ||
71 | host_to_net(num, numbytes); | ||
72 | } | ||
73 | |||
74 | int create_recursive_mutex(pthread_mutex_t *mutex) | 55 | int create_recursive_mutex(pthread_mutex_t *mutex) |
75 | { | 56 | { |
76 | pthread_mutexattr_t attr; | 57 | pthread_mutexattr_t attr; |