diff options
author | Jacki <jacki@thejackimonster.de> | 2024-02-14 13:44:06 +0100 |
---|---|---|
committer | Jacki <jacki@thejackimonster.de> | 2024-02-14 13:44:06 +0100 |
commit | 17392fe6169d39a75645728f44aa117f67b5331d (patch) | |
tree | cd9df10fc8a58c8104a494dcc6e1e44c09ccf8ca /src/chat/messenger.c | |
parent | 9ff0f0e2e8d554f465d7aad51ce7fb33e61a749c (diff) | |
download | messenger-gtk-17392fe6169d39a75645728f44aa117f67b5331d.tar.gz messenger-gtk-17392fe6169d39a75645728f44aa117f67b5331d.zip |
Add asserts to verify reliability
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat (limited to 'src/chat/messenger.c')
-rw-r--r-- | src/chat/messenger.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/chat/messenger.c b/src/chat/messenger.c index 1d6fa33..4f242af 100644 --- a/src/chat/messenger.c +++ b/src/chat/messenger.c | |||
@@ -30,6 +30,8 @@ | |||
30 | static void | 30 | static void |
31 | _chat_messenger_quit(void *cls) | 31 | _chat_messenger_quit(void *cls) |
32 | { | 32 | { |
33 | g_assert(cls); | ||
34 | |||
33 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | 35 | MESSENGER_Application *app = (MESSENGER_Application*) cls; |
34 | 36 | ||
35 | if (app->chat.messenger.idle) | 37 | if (app->chat.messenger.idle) |
@@ -51,6 +53,8 @@ _chat_messenger_quit(void *cls) | |||
51 | static void | 53 | static void |
52 | _chat_messenger_idle(void *cls) | 54 | _chat_messenger_idle(void *cls) |
53 | { | 55 | { |
56 | g_assert(cls); | ||
57 | |||
54 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | 58 | MESSENGER_Application *app = (MESSENGER_Application*) cls; |
55 | 59 | ||
56 | // Idling until the application shuts down | 60 | // Idling until the application shuts down |
@@ -65,9 +69,11 @@ _chat_messenger_idle(void *cls) | |||
65 | 69 | ||
66 | static int | 70 | static int |
67 | _chat_messenger_message(void *cls, | 71 | _chat_messenger_message(void *cls, |
68 | struct GNUNET_CHAT_Context *context, | 72 | struct GNUNET_CHAT_Context *context, |
69 | const struct GNUNET_CHAT_Message *message) | 73 | const struct GNUNET_CHAT_Message *message) |
70 | { | 74 | { |
75 | g_assert((cls) && (message)); | ||
76 | |||
71 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | 77 | MESSENGER_Application *app = (MESSENGER_Application*) cls; |
72 | 78 | ||
73 | // Locking the mutex for synchronization | 79 | // Locking the mutex for synchronization |
@@ -184,10 +190,12 @@ _chat_messenger_message(void *cls, | |||
184 | 190 | ||
185 | void | 191 | void |
186 | chat_messenger_run(void *cls, | 192 | chat_messenger_run(void *cls, |
187 | UNUSED char *const *args, | 193 | UNUSED char *const *args, |
188 | UNUSED const char *cfgfile, | 194 | UNUSED const char *cfgfile, |
189 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 195 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
190 | { | 196 | { |
197 | g_assert((cls) && (cfg)); | ||
198 | |||
191 | MESSENGER_Application *app = (MESSENGER_Application*) cls; | 199 | MESSENGER_Application *app = (MESSENGER_Application*) cls; |
192 | 200 | ||
193 | // Start libgnunetchat handle | 201 | // Start libgnunetchat handle |