diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-02-23 02:22:38 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-02-24 22:20:22 +0000 |
commit | d3b286cb434ed228e7b62cc70cb293e7a5554bfa (patch) | |
tree | 9ab3dd66f9dba2ca861ba8c6e098fb96754aa80b /toxcore/Messenger.c | |
parent | afc80922e720f5d2a93bdfb3745da058e5ddf81b (diff) |
Fix a bunch of compiler warnings and remove suppressions.
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 5542ee1b..2bebae92 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <assert.h> | 34 | #include <assert.h> |
35 | 35 | ||
36 | static void set_friend_status(Messenger *m, int32_t friendnumber, uint8_t status, void *userdata); | ||
37 | static int write_cryptpacket_id(const Messenger *m, int32_t friendnumber, uint8_t packet_id, const uint8_t *data, | 36 | static int write_cryptpacket_id(const Messenger *m, int32_t friendnumber, uint8_t packet_id, const uint8_t *data, |
38 | uint32_t length, uint8_t congestion_control); | 37 | uint32_t length, uint8_t congestion_control); |
39 | 38 | ||
@@ -949,7 +948,7 @@ static void check_friend_connectionstatus(Messenger *m, int32_t friendnumber, ui | |||
949 | } | 948 | } |
950 | } | 949 | } |
951 | 950 | ||
952 | void set_friend_status(Messenger *m, int32_t friendnumber, uint8_t status, void *userdata) | 951 | static void set_friend_status(Messenger *m, int32_t friendnumber, uint8_t status, void *userdata) |
953 | { | 952 | { |
954 | check_friend_connectionstatus(m, friendnumber, status, userdata); | 953 | check_friend_connectionstatus(m, friendnumber, status, userdata); |
955 | m->friendlist[friendnumber].status = status; | 954 | m->friendlist[friendnumber].status = status; |
@@ -1825,13 +1824,13 @@ static int m_handle_custom_lossy_packet(void *object, int friend_num, const uint | |||
1825 | return 1; | 1824 | return 1; |
1826 | } | 1825 | } |
1827 | 1826 | ||
1828 | void custom_lossy_packet_registerhandler(Messenger *m, void (*packet_handler_callback)(Messenger *m, | 1827 | void custom_lossy_packet_registerhandler(Messenger *m, void (*lossy_packethandler)(Messenger *m, |
1829 | uint32_t friendnumber, const uint8_t *data, size_t len, void *object)) | 1828 | uint32_t friendnumber, const uint8_t *data, size_t len, void *object)) |
1830 | { | 1829 | { |
1831 | m->lossy_packethandler = packet_handler_callback; | 1830 | m->lossy_packethandler = lossy_packethandler; |
1832 | } | 1831 | } |
1833 | 1832 | ||
1834 | int m_callback_rtp_packet(Messenger *m, int32_t friendnumber, uint8_t byte, int (*packet_handler_callback)(Messenger *m, | 1833 | int m_callback_rtp_packet(Messenger *m, int32_t friendnumber, uint8_t byte, int (*function)(Messenger *m, |
1835 | uint32_t friendnumber, const uint8_t *data, uint16_t len, void *object), void *object) | 1834 | uint32_t friendnumber, const uint8_t *data, uint16_t len, void *object), void *object) |
1836 | { | 1835 | { |
1837 | if (friend_not_valid(m, friendnumber)) { | 1836 | if (friend_not_valid(m, friendnumber)) { |
@@ -1846,8 +1845,7 @@ int m_callback_rtp_packet(Messenger *m, int32_t friendnumber, uint8_t byte, int | |||
1846 | return -1; | 1845 | return -1; |
1847 | } | 1846 | } |
1848 | 1847 | ||
1849 | m->friendlist[friendnumber].lossy_rtp_packethandlers[byte % PACKET_LOSSY_AV_RESERVED].function = | 1848 | m->friendlist[friendnumber].lossy_rtp_packethandlers[byte % PACKET_LOSSY_AV_RESERVED].function = function; |
1850 | packet_handler_callback; | ||
1851 | m->friendlist[friendnumber].lossy_rtp_packethandlers[byte % PACKET_LOSSY_AV_RESERVED].object = object; | 1849 | m->friendlist[friendnumber].lossy_rtp_packethandlers[byte % PACKET_LOSSY_AV_RESERVED].object = object; |
1852 | return 0; | 1850 | return 0; |
1853 | } | 1851 | } |
@@ -1907,10 +1905,10 @@ static int handle_custom_lossless_packet(void *object, int friend_num, const uin | |||
1907 | return 1; | 1905 | return 1; |
1908 | } | 1906 | } |
1909 | 1907 | ||
1910 | void custom_lossless_packet_registerhandler(Messenger *m, void (*packet_handler_callback)(Messenger *m, | 1908 | void custom_lossless_packet_registerhandler(Messenger *m, void (*lossless_packethandler)(Messenger *m, |
1911 | uint32_t friendnumber, const uint8_t *data, size_t len, void *object)) | 1909 | uint32_t friendnumber, const uint8_t *data, size_t len, void *object)) |
1912 | { | 1910 | { |
1913 | m->lossless_packethandler = packet_handler_callback; | 1911 | m->lossless_packethandler = lossless_packethandler; |
1914 | } | 1912 | } |
1915 | 1913 | ||
1916 | int send_custom_lossless_packet(const Messenger *m, int32_t friendnumber, const uint8_t *data, uint32_t length) | 1914 | int send_custom_lossless_packet(const Messenger *m, int32_t friendnumber, const uint8_t *data, uint32_t length) |
@@ -2765,7 +2763,7 @@ struct SAVED_FRIEND { | |||
2765 | uint64_t last_seen_time; | 2763 | uint64_t last_seen_time; |
2766 | }; | 2764 | }; |
2767 | 2765 | ||
2768 | static uint32_t friend_size() | 2766 | static uint32_t friend_size(void) |
2769 | { | 2767 | { |
2770 | uint32_t data = 0; | 2768 | uint32_t data = 0; |
2771 | const struct SAVED_FRIEND *const temp = nullptr; | 2769 | const struct SAVED_FRIEND *const temp = nullptr; |