diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-09 17:19:41 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-12 09:19:02 +0000 |
commit | 37f8f566d53a3e2603467aa0bbe1e29581ddd561 (patch) | |
tree | ed49d6b26816a47b37cf3a691909cdf5178d2b6f /toxcore/friend_requests.h | |
parent | 0b7e29e0197f18ea38a62f8f89a1fe60edb462a0 (diff) |
Fix style in some header files.
* Enums must by typedef'd.
* Comments at end of `#define` must be `//` comments.
* Typedef structs must not be anonymous.
* `;` at the end of a `#define` is invalid.
* Callback typedefs must list their parameter names.
* No nested structs.
* No inline use of function pointer types. Only typedef'd callback types
are allowed.
* Enum types are spelled in Camelsnake_Case.
* The argument to `#error` must be a string literal.
Diffstat (limited to 'toxcore/friend_requests.h')
-rw-r--r-- | toxcore/friend_requests.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toxcore/friend_requests.h b/toxcore/friend_requests.h index 97cd3164..77c3af68 100644 --- a/toxcore/friend_requests.h +++ b/toxcore/friend_requests.h | |||
@@ -41,14 +41,15 @@ uint32_t get_nospam(const Friend_Requests *fr); | |||
41 | */ | 41 | */ |
42 | int remove_request_received(Friend_Requests *fr, const uint8_t *real_pk); | 42 | int remove_request_received(Friend_Requests *fr, const uint8_t *real_pk); |
43 | 43 | ||
44 | typedef void fr_friend_request_cb(void *, const uint8_t *, const uint8_t *, size_t, void *); | 44 | typedef void fr_friend_request_cb(void *object, const uint8_t *public_key, const uint8_t *message, size_t length, |
45 | void *user_data); | ||
45 | 46 | ||
46 | /* Set the function that will be executed when a friend request for us is received. | 47 | /* Set the function that will be executed when a friend request for us is received. |
47 | * Function format is function(uint8_t * public_key, uint8_t * data, size_t length, void * userdata) | 48 | * Function format is function(uint8_t * public_key, uint8_t * data, size_t length, void * userdata) |
48 | */ | 49 | */ |
49 | void callback_friendrequest(Friend_Requests *fr, fr_friend_request_cb *function, void *object); | 50 | void callback_friendrequest(Friend_Requests *fr, fr_friend_request_cb *function, void *object); |
50 | 51 | ||
51 | typedef int filter_function_cb(const uint8_t *, void *); | 52 | typedef int filter_function_cb(const uint8_t *public_key, void *user_data); |
52 | 53 | ||
53 | /* Set the function used to check if a friend request should be displayed to the user or not. | 54 | /* Set the function used to check if a friend request should be displayed to the user or not. |
54 | * Function format is int function(uint8_t * public_key, void * userdata) | 55 | * Function format is int function(uint8_t * public_key, void * userdata) |