refactor: Refactor OMEMO error handling and add non-null attributes

Add __attribute__((nonnull) hints to omemo_receive_message and
omemo_on_message_recv declarations to catch NULL arguments at
compiletime.
So we can set the error state unconditionally in the functions.
This commit is contained in:
Michael Vetter
2026-03-09 08:13:51 +01:00
parent 3e2673aad2
commit e39ffd981f
5 changed files with 24 additions and 62 deletions

View File

@@ -135,18 +135,14 @@ omemo_on_message_recv(const char* const from, uint32_t sid,
GList* keys, const unsigned char* const payload,
size_t payload_len, gboolean muc, gboolean* trusted, omemo_error_t* error)
{
if (error) {
*error = OMEMO_ERR_NONE;
}
*error = OMEMO_ERR_NONE;
return NULL;
}
char*
omemo_receive_message(xmpp_stanza_t* const stanza, gboolean* trusted, omemo_error_t* error)
{
if (error) {
*error = OMEMO_ERR_NONE;
}
*error = OMEMO_ERR_NONE;
return NULL;
}