mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Const correctness for toxcore/util.c
This commit is contained in:
parent
890472886c
commit
9e028b243a
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user