aboutsummaryrefslogtreecommitdiff
path: root/src/chat/messenger.c
diff options
context:
space:
mode:
authorJacki <jacki@thejackimonster.de>2024-02-14 13:44:06 +0100
committerJacki <jacki@thejackimonster.de>2024-02-14 13:44:06 +0100
commit17392fe6169d39a75645728f44aa117f67b5331d (patch)
treecd9df10fc8a58c8104a494dcc6e1e44c09ccf8ca /src/chat/messenger.c
parent9ff0f0e2e8d554f465d7aad51ce7fb33e61a749c (diff)
downloadmessenger-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.c18
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 @@
30static void 30static 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)
51static void 53static 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
66static int 70static 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
185void 191void
186chat_messenger_run(void *cls, 192chat_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