From 32afb6b1e45bd1828214a1f8f5d0f51af9e17bab Mon Sep 17 00:00:00 2001 From: Jman012 Date: Sun, 16 Feb 2014 17:06:11 -0800 Subject: [PATCH] Typing: Changed all return values to int for consistency and the -1 error. --- toxcore/Messenger.c | 2 +- toxcore/Messenger.h | 2 +- toxcore/tox.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 292ed990..42c8544a 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -632,7 +632,7 @@ int m_set_usertyping(Messenger *m, int friendnumber, uint8_t is_typing) return 0; } -uint8_t m_get_istyping(Messenger *m, int friendnumber) +int m_get_istyping(Messenger *m, int friendnumber) { if (friend_not_valid(m, friendnumber)) return -1; diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index 42f0738c..d931dfb5 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h @@ -417,7 +417,7 @@ int m_set_usertyping(Messenger *m, int friendnumber, uint8_t is_typing); * returns 0 if friend is not typing. * returns 1 if friend is typing. */ -uint8_t m_get_istyping(Messenger *m, int friendnumber); +int m_get_istyping(Messenger *m, int friendnumber); /* Sets whether we send read receipts for friendnumber. * This function is not lazy, and it will fail if yesno is not (0 or 1). diff --git a/toxcore/tox.c b/toxcore/tox.c index 362724fc..8ec98cc8 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -279,7 +279,7 @@ TOX_USERSTATUS tox_get_self_user_status(Tox *tox) int tox_set_user_is_typing(Tox *tox, int friendnumber, uint8_t is_typing) { Messenger *m = tox; - return (int)m_set_usertyping(m, friendnumber, is_typing); + return m_set_usertyping(m, friendnumber, is_typing); } /* Get the typing status of a friend. @@ -290,7 +290,7 @@ int tox_set_user_is_typing(Tox *tox, int friendnumber, uint8_t is_typing) int tox_get_is_typing(Tox *tox, int friendnumber) { Messenger *m = tox; - return (int)m_get_istyping(m, friendnumber); + return m_get_istyping(m, friendnumber); }