Const correctness for toxcore/util.c

This commit is contained in:
Marc Schütz 2014-06-10 18:27:05 +02:00
parent 890472886c
commit 9e028b243a
2 changed files with 4 additions and 4 deletions

View File

@ -58,12 +58,12 @@ int is_timeout(uint64_t timestamp, uint64_t timeout)
/* id functions */
bool id_equal(uint8_t *dest, uint8_t *src)
bool id_equal(const uint8_t *dest, const uint8_t *src)
{
return memcmp(dest, src, CLIENT_ID_SIZE) == 0;
}
uint32_t id_copy(uint8_t *dest, uint8_t *src)
uint32_t id_copy(uint8_t *dest, const uint8_t *src)
{
memcpy(dest, src, CLIENT_ID_SIZE);
return CLIENT_ID_SIZE;

View File

@ -36,8 +36,8 @@ int is_timeout(uint64_t timestamp, uint64_t timeout);
/* id functions */
bool id_equal(uint8_t *dest, uint8_t *src);
uint32_t id_copy(uint8_t *dest, uint8_t *src); /* return value is CLIENT_ID_SIZE */
bool id_equal(const uint8_t *dest, const uint8_t *src);
uint32_t id_copy(uint8_t *dest, const uint8_t *src); /* return value is CLIENT_ID_SIZE */
void host_to_net(uint8_t *num, uint16_t numbytes);
#define net_to_host(x, y) host_to_net(x, y)