From 308cf5da6d6f3cccc7834e9a5c8e433c69d6cfdc Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 18 Feb 2015 18:29:32 -0500 Subject: [PATCH] use bool in is typing callback. --- toxcore/Messenger.c | 4 ++-- toxcore/Messenger.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 4a173de7..fd97c33d 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -929,7 +929,7 @@ void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t m->friend_userstatuschange_userdata = userdata; } -void m_callback_typingchange(Messenger *m, void(*function)(Messenger *m, uint32_t, uint8_t, void *), void *userdata) +void m_callback_typingchange(Messenger *m, void(*function)(Messenger *m, uint32_t, _Bool, void *), void *userdata) { m->friend_typingchange = function; m->friend_typingchange_userdata = userdata; @@ -2043,7 +2043,7 @@ static int handle_packet(void *object, int i, uint8_t *temp, uint16_t len) if (data_length != 1) break; - uint8_t typing = data[0]; + _Bool typing = !!data[0]; set_friend_typing(m, i, typing); diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index db0777cb..9a5044cd 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h @@ -280,7 +280,7 @@ struct Messenger { void *friend_statusmessagechange_userdata; void (*friend_userstatuschange)(struct Messenger *m, uint32_t, uint8_t, void *); void *friend_userstatuschange_userdata; - void (*friend_typingchange)(struct Messenger *m, uint32_t, uint8_t, void *); + void (*friend_typingchange)(struct Messenger *m, uint32_t, _Bool, void *); void *friend_typingchange_userdata; void (*read_receipt)(struct Messenger *m, uint32_t, uint32_t, void *); void *read_receipt_userdata; @@ -664,7 +664,7 @@ void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t /* Set the callback for typing changes. * Function(uint32_t friendnumber, uint8_t is_typing) */ -void m_callback_typingchange(Messenger *m, void(*function)(Messenger *m, uint32_t, uint8_t, void *), void *userdata); +void m_callback_typingchange(Messenger *m, void(*function)(Messenger *m, uint32_t, _Bool, void *), void *userdata); /* Set the callback for read receipts. * Function(uint32_t friendnumber, uint32_t receipt)