libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

commit 6b24ccab0ffb551226477633943afbe76bc434c2
parent c479813a3665f6bef2fddbed4137f744d192ab38
Author: Jacki <jacki@thejackimonster.de>
Date:   Sun, 19 Jul 2026 23:10:52 +0200

Fix warnings and errors from clangd

Signed-off-by: Jacki <jacki@thejackimonster.de>

Diffstat:
M.gitignore | 1+
Msrc/gnunet_chat_contact_intern.c | 1-
Msrc/gnunet_chat_context_intern.c | 6++++--
Msrc/gnunet_chat_discourse.h | 8++++----
Msrc/gnunet_chat_discourse_intern.c | 6+++++-
Msrc/gnunet_chat_file.c | 1-
Msrc/gnunet_chat_group.c | 3+--
Msrc/gnunet_chat_group_intern.c | 1+
Msrc/gnunet_chat_lib_intern.c | 27++++++++++++++-------------
Msrc/gnunet_chat_lobby_intern.c | 1+
Msrc/gnunet_chat_ticket_intern.c | 10++++++----
Msrc/gnunet_chat_uri.h | 8++++----
Mtests/file/test_gnunet_chat_file_send.c | 9++++-----
Mtests/test_gnunet_chat.h | 3+--
14 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -21,6 +21,7 @@ Makefile .project .settings/ .vscode/ +.zed/ # Binary files: *.o diff --git a/src/gnunet_chat_contact_intern.c b/src/gnunet_chat_contact_intern.c @@ -29,7 +29,6 @@ #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_messenger_service.h> #include <gnunet/gnunet_util_lib.h> -#include <stdlib.h> #define GNUNET_UNUSED __attribute__ ((unused)) diff --git a/src/gnunet_chat_context_intern.c b/src/gnunet_chat_context_intern.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021--2024 GNUnet e.V. + Copyright (C) 2021--2024, 2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -22,7 +22,9 @@ * @file gnunet_chat_context_intern.c */ +#include "gnunet_chat_context.h" #include "gnunet_chat_discourse.h" +#include "gnunet_chat_handle.h" #include "gnunet_chat_invitation.h" #include "gnunet_chat_message.h" @@ -79,7 +81,7 @@ it_destroy_context_invites (void *cls, struct GNUNET_CHAT_Context *context = cls; struct GNUNET_CHAT_Invitation *invitation = value; - + struct GNUNET_CHAT_Handle *handle = context->handle; GNUNET_CONTAINER_multihashmap_remove( diff --git a/src/gnunet_chat_discourse.h b/src/gnunet_chat_discourse.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2024 GNUnet e.V. + Copyright (C) 2024, 2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -25,13 +25,13 @@ #ifndef GNUNET_CHAT_DISCOURSE_H_ #define GNUNET_CHAT_DISCOURSE_H_ -#include "gnunet_chat_util.h" - #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_messenger_service.h> #include <gnunet/gnunet_time_lib.h> #include <gnunet/gnunet_util_lib.h> +#include "gnunet_chat_lib.h" + struct GNUNET_CHAT_Contact; struct GNUNET_CHAT_Context; @@ -104,7 +104,7 @@ discourse_subscribe (struct GNUNET_CHAT_Discourse *discourse, /** * Ends the subscription of a specific chat <i>contact</i> - * to a given chat <i>discourse</i> at a selected + * to a given chat <i>discourse</i> at a selected * <i>timestamp</i> with a potential <i>delay</i>. * * @param[in,out] discourse Chat discourse diff --git a/src/gnunet_chat_discourse_intern.c b/src/gnunet_chat_discourse_intern.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2024 GNUnet e.V. + Copyright (C) 2024, 2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -23,6 +23,10 @@ */ #include "gnunet_chat_context.h" +#include "gnunet_chat_discourse.h" +#include "gnunet_chat_util.h" + +#include <unistd.h> #define GNUNET_UNUSED __attribute__ ((unused)) diff --git a/src/gnunet_chat_file.c b/src/gnunet_chat_file.c @@ -26,7 +26,6 @@ #include "gnunet_chat_context.h" #include "gnunet_chat_handle.h" -#include "gnunet_chat_util.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_fs_service.h> diff --git a/src/gnunet_chat_group.c b/src/gnunet_chat_group.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021--2024 GNUnet e.V. + Copyright (C) 2021--2024, 2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -23,7 +23,6 @@ */ #include "gnunet_chat_group.h" -#include "gnunet_chat_util.h" #include "gnunet_chat_group_intern.c" #include <gnunet/gnunet_scheduler_lib.h> diff --git a/src/gnunet_chat_group_intern.c b/src/gnunet_chat_group_intern.c @@ -23,6 +23,7 @@ */ #include "gnunet_chat_context.h" +#include "gnunet_chat_group.h" #include "gnunet_chat_handle.h" #include <gnunet/gnunet_messenger_service.h> diff --git a/src/gnunet_chat_lib_intern.c b/src/gnunet_chat_lib_intern.c @@ -24,6 +24,8 @@ #include "gnunet_chat_account.h" #include "gnunet_chat_contact.h" +#include "gnunet_chat_context.h" +#include "gnunet_chat_group.h" #include "gnunet_chat_handle.h" #include <gnunet/gnunet_common.h> @@ -32,7 +34,6 @@ #include <gnunet/gnunet_reclaim_service.h> #include <gnunet/gnunet_time_lib.h> #include <stdint.h> -#include <stdlib.h> #include <string.h> #define GNUNET_UNUSED __attribute__ ((unused)) @@ -292,7 +293,7 @@ it_contact_iterate_contexts (void *cls, struct GNUNET_CHAT_Handle *handle = it->contact->handle; struct GNUNET_CHAT_Context *context = GNUNET_CONTAINER_multihashmap_get( handle->contexts, key); - + if (! context) return GNUNET_YES; @@ -599,7 +600,7 @@ cont_update_attribute_with_status (void *cls, handle, account, NULL, - GNUNET_CHAT_KIND_WARNING, + GNUNET_CHAT_FLAG_WARNING, emsg, GNUNET_YES ); @@ -612,7 +613,7 @@ cont_update_attribute_with_status (void *cls, attribute_name, GNUNET_YES ); - + internal_attributes_destroy(attributes); } @@ -651,7 +652,7 @@ cb_task_finish_iterate_attribute (void *cls) cont_update_attribute_with_status, attributes ); - + if (attributes->data) GNUNET_free(attributes->data); @@ -815,7 +816,7 @@ cb_iterate_attribute (void *cls, if (value) GNUNET_free (value); - + if (GNUNET_YES != result) internal_attributes_stop_iter(attributes); else @@ -879,7 +880,7 @@ attribute_list_from_attribute (const struct GNUNET_RECLAIM_Attribute *attribute) if (!attrs) return NULL; - + le = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry); if (!le) @@ -932,7 +933,7 @@ cb_share_attribute (void *cls, internal_attributes_next_iter(attributes); return; } - + internal_attributes_stop_iter(attributes); GNUNET_free(attributes->name); @@ -968,7 +969,7 @@ cb_share_attribute (void *cls, cb_issue_ticket, attributes ); - + GNUNET_RECLAIM_attribute_list_destroy(attrs); cleanup: @@ -1082,7 +1083,7 @@ cb_consume_ticket_check (void *cls, cont_revoke_ticket, tickets ); - + if (tickets->ticket) { GNUNET_free(tickets->ticket); @@ -1096,7 +1097,7 @@ cb_consume_ticket_check (void *cls, return; } - if ((!attribute) || (! tickets->name) || + if ((!attribute) || (! tickets->name) || (0 != strcmp(tickets->name, attribute->name))) return; @@ -1143,7 +1144,7 @@ cb_iterate_ticket_check (void *cls, struct GNUNET_CHAT_Handle *handle = tickets->handle; - if ((!rp_uri) || (!(tickets->contact)) || + if ((!rp_uri) || (!(tickets->contact)) || (GNUNET_YES != is_contact_ticket_audience(tickets->contact, rp_uri))) { internal_tickets_next_iter(tickets); @@ -1229,7 +1230,7 @@ cb_iterate_ticket (void *cls, struct GNUNET_CHAT_Handle *handle = tickets->handle; - if ((!rp_uri) || (!(tickets->contact)) || + if ((!rp_uri) || (!(tickets->contact)) || (GNUNET_YES != is_contact_ticket_audience(tickets->contact, rp_uri))) { internal_tickets_next_iter(tickets); diff --git a/src/gnunet_chat_lobby_intern.c b/src/gnunet_chat_lobby_intern.c @@ -23,6 +23,7 @@ */ #include "gnunet_chat_context.h" +#include "gnunet_chat_handle.h" void cont_lobby_write_records (void *cls, diff --git a/src/gnunet_chat_ticket_intern.c b/src/gnunet_chat_ticket_intern.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2024--2025 GNUnet e.V. + Copyright (C) 2024--2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -22,15 +22,17 @@ * @file gnunet_chat_ticket_intern.c */ +#include "gnunet_chat_ticket.h" + #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_reclaim_lib.h> #define GNUNET_UNUSED __attribute__ ((unused)) void -cb_ticket_consume_attribute (void *cls, - const struct GNUNET_CRYPTO_BlindablePublicKey *identity, - const struct GNUNET_RECLAIM_Attribute *attribute, +cb_ticket_consume_attribute (void *cls, + const struct GNUNET_CRYPTO_BlindablePublicKey *identity, + const struct GNUNET_RECLAIM_Attribute *attribute, const struct GNUNET_RECLAIM_Presentation *presentation) { GNUNET_assert(cls); diff --git a/src/gnunet_chat_uri.h b/src/gnunet_chat_uri.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2022--2025 GNUnet e.V. + Copyright (C) 2022--2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -25,11 +25,11 @@ #ifndef GNUNET_CHAT_URI_H_ #define GNUNET_CHAT_URI_H_ +#include "gnunet_chat_lib.h" + #include <gnunet/gnunet_fs_service.h> #include <gnunet/gnunet_util_lib.h> -#include "gnunet_chat_util.h" - struct GNUNET_CHAT_UriChat { struct GNUNET_CRYPTO_BlindablePublicKey zone; @@ -82,7 +82,7 @@ void uri_destroy (struct GNUNET_CHAT_Uri *uri); /** - * Parses an UTF-8 string to a chat URI which will + * Parses an UTF-8 string to a chat URI which will * be newly allocated. * * @param[in] string UTF-8 string to parse diff --git a/tests/file/test_gnunet_chat_file_send.c b/tests/file/test_gnunet_chat_file_send.c @@ -48,7 +48,7 @@ on_gnunet_chat_file_send_upload(void *cls, if (completed > size) return; - + ck_assert_uint_eq(completed, size); } @@ -66,7 +66,7 @@ on_gnunet_chat_file_send_unindex(void *cls, if (completed > size) return; - + ck_assert_uint_eq(completed, size); GNUNET_CHAT_context_send_text(context, TEST_SEND_TEXT); @@ -100,7 +100,6 @@ on_gnunet_chat_file_send_msg(void *cls, break; case GNUNET_CHAT_KIND_REFRESH: ck_assert_ptr_null(context); - ck_assert_ptr_null(account); if (file_stage == 0) { @@ -190,8 +189,8 @@ on_gnunet_chat_file_send_msg(void *cls, ck_assert_ptr_nonnull(file); ck_assert_int_eq(GNUNET_CHAT_file_unindex( - file, - on_gnunet_chat_file_send_unindex, + file, + on_gnunet_chat_file_send_unindex, context ), GNUNET_OK); diff --git a/tests/test_gnunet_chat.h b/tests/test_gnunet_chat.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021--2024 GNUnet e.V. + Copyright (C) 2021--2024, 2026 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -25,7 +25,6 @@ #ifndef TEST_GNUNET_CHAT_H_ #define TEST_GNUNET_CHAT_H_ -#include <stdio.h> #include <stdlib.h> #include <check.h>