From 964c3a3b9acf4fb9c8fe1de0ff1a23a4f2dcf3fa Mon Sep 17 00:00:00 2001 From: nekobit Date: Thu, 25 Aug 2022 00:08:51 +0000 Subject: [PATCH] Undo the compatibility stuffs FossilOrigin-Name: 25826622c5bfb79fc9d937adc455e258a72991a4f41737ce3888980b841fa4e7 --- include/mastodont_chats.h | 4 ++-- include/mastodont_emoji.h | 1 - src/chats.c | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/mastodont_chats.h b/include/mastodont_chats.h index 528c07a..0bb3ce0 100644 --- a/include/mastodont_chats.h +++ b/include/mastodont_chats.h @@ -79,7 +79,7 @@ int mastodont_get_chat(mastodont_t* data, struct mstdnt_storage* storage, struct mstdnt_chat* chat); -void mstdnt_cleanup_chats(struct mstdnt_chat* chats, size_t chats_len); -void mstdnt_cleanup_messages(struct mstdnt_message* chats, size_t messages_len); +void mstdnt_cleanup_chats(struct mstdnt_chat* chats); +void mstdnt_cleanup_messages(struct mstdnt_message* chats); #endif // MASTODONT_CHATS_H diff --git a/include/mastodont_emoji.h b/include/mastodont_emoji.h index 708bcd3..99fc2a2 100644 --- a/include/mastodont_emoji.h +++ b/include/mastodont_emoji.h @@ -47,7 +47,6 @@ void _mstdnt_val_emojis_call(cJSON* v, void* _type); void _mstdnt_val_emoji_reactions_call(cJSON* v, void* _type); void cleanup_emoji_reaction(struct mstdnt_emoji_reaction* reactions); void cleanup_emoji_reactions(struct mstdnt_emoji_reaction* reactions, size_t s); -// TODO add length for compatibility void cleanup_emojis(struct mstdnt_emoji* emo); #endif /* MASTODONT_EMOJI */ diff --git a/src/chats.c b/src/chats.c index 5af0e40..4663afb 100644 --- a/src/chats.c +++ b/src/chats.c @@ -198,17 +198,14 @@ int mastodont_get_chat(mastodont_t* data, return mastodont_request(data, m_args, &req_args); } -void mstdnt_cleanup_chats(struct mstdnt_chat* chats, size_t chats_len) +void mstdnt_cleanup_chats(struct mstdnt_chat* chats) { - // Unused for compatibility - (void)chats_len; if (!chats) return; free(chats); } -void mstdnt_cleanup_messages(struct mstdnt_message* messages, size_t messages_len) +void mstdnt_cleanup_messages(struct mstdnt_message* messages) { - (void)messages_len; - if (!chats) return; + if (!messages) return; mstdnt_cleanup_emojis(messages->emojis); }