summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.c
diff options
context:
space:
mode:
authorMarc Schütz <schuetzm@gmx.net>2014-06-10 20:54:48 +0200
committerMarc Schütz <schuetzm@gmx.net>2014-06-10 20:54:48 +0200
commit99d594014014a37fdee9e83575a8895400c9cd60 (patch)
tree55152fcfb850511b17ae2af9c77bf30778b465d2 /toxcore/friend_requests.c
parent8bdf487d199b82db85883b613e86deeba15f9b32 (diff)
Const correctness in various interdependent files
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r--toxcore/friend_requests.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c
index eb2a791c..4bf95a44 100644
--- a/toxcore/friend_requests.c
+++ b/toxcore/friend_requests.c
@@ -72,7 +72,7 @@ uint32_t get_nospam(Friend_Requests *fr)
72 72
73 73
74/* Set the function that will be executed when a friend request is received. */ 74/* Set the function that will be executed when a friend request is received. */
75void callback_friendrequest(Friend_Requests *fr, void (*function)(void *, uint8_t *, uint8_t *, uint16_t, void *), 75void callback_friendrequest(Friend_Requests *fr, void (*function)(void *, const uint8_t *, const uint8_t *, uint16_t, void *),
76 void *object, void *userdata) 76 void *object, void *userdata)
77{ 77{
78 fr->handle_friendrequest = function; 78 fr->handle_friendrequest = function;
@@ -81,14 +81,14 @@ void callback_friendrequest(Friend_Requests *fr, void (*function)(void *, uint8_
81 fr->handle_friendrequest_userdata = userdata; 81 fr->handle_friendrequest_userdata = userdata;
82} 82}
83/* Set the function used to check if a friend request should be displayed to the user or not. */ 83/* Set the function used to check if a friend request should be displayed to the user or not. */
84void set_filter_function(Friend_Requests *fr, int (*function)(uint8_t *, void *), void *userdata) 84void set_filter_function(Friend_Requests *fr, int (*function)(const uint8_t *, void *), void *userdata)
85{ 85{
86 fr->filter_function = function; 86 fr->filter_function = function;
87 fr->filter_function_userdata = userdata; 87 fr->filter_function_userdata = userdata;
88} 88}
89 89
90/* Add to list of received friend requests. */ 90/* Add to list of received friend requests. */
91static void addto_receivedlist(Friend_Requests *fr, uint8_t *client_id) 91static void addto_receivedlist(Friend_Requests *fr, const uint8_t *client_id)
92{ 92{
93 if (fr->received_requests_index >= MAX_RECEIVED_STORED) 93 if (fr->received_requests_index >= MAX_RECEIVED_STORED)
94 fr->received_requests_index = 0; 94 fr->received_requests_index = 0;
@@ -102,7 +102,7 @@ static void addto_receivedlist(Friend_Requests *fr, uint8_t *client_id)
102 * return 0 if it did not. 102 * return 0 if it did not.
103 * return 1 if it did. 103 * return 1 if it did.
104 */ 104 */
105static int request_received(Friend_Requests *fr, uint8_t *client_id) 105static int request_received(Friend_Requests *fr, const uint8_t *client_id)
106{ 106{
107 uint32_t i; 107 uint32_t i;
108 108
@@ -133,7 +133,7 @@ int remove_request_received(Friend_Requests *fr, uint8_t *client_id)
133} 133}
134 134
135 135
136static int friendreq_handlepacket(void *object, uint8_t *source_pubkey, uint8_t *packet, uint32_t length) 136static int friendreq_handlepacket(void *object, const uint8_t *source_pubkey, const uint8_t *packet, uint32_t length)
137{ 137{
138 Friend_Requests *fr = object; 138 Friend_Requests *fr = object;
139 139