From 53a0dabcd40800f4ddf6593be4ef7ecf8f5b2225 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sat, 23 Sep 2023 08:57:36 +0200 Subject: BUILD: Silence int/enum mismatch compiler warnings and curl deprecated defines --- src/include/gnunet_bio_lib.h | 37 +++++++++++++++++++------------------ src/include/gnunet_container_lib.h | 13 +++++++------ src/include/gnunet_crypto_lib.h | 2 +- src/include/gnunet_curl_lib.h | 2 +- src/include/gnunet_gnsrecord_lib.h | 7 ++++--- src/include/gnunet_mq_lib.h | 3 ++- src/include/gnunet_mst_lib.h | 4 ++-- src/include/gnunet_network_lib.h | 3 ++- src/include/gnunet_plugin_lib.h | 2 +- 9 files changed, 39 insertions(+), 34 deletions(-) (limited to 'src/include') diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 48a1a512d..73550db7e 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h @@ -33,6 +33,7 @@ * @{ */ +#include "gnunet_common.h" #if !defined (__GNUNET_UTIL_LIB_H_INSIDE__) #error "Only can be included directly." #endif @@ -88,7 +89,7 @@ GNUNET_BIO_read_open_buffer (void *buffer, size_t size); * @param emsg set to the error message * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); /** @@ -110,7 +111,7 @@ GNUNET_BIO_read_set_error (struct GNUNET_BIO_ReadHandle *h, const char* emsg); * @param len the number of bytes to read * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, void *result, @@ -127,7 +128,7 @@ GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, * @param max_length maximum allowed length for the string * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, char **result, @@ -142,7 +143,7 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, * @param what describes what is being read (for error message creation) * @param f address of float to read */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, const char *what, float *f); @@ -155,7 +156,7 @@ GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, * @param what describes what is being read (for error message creation) * @param f address of double to read */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, const char *what, double *f); @@ -169,7 +170,7 @@ GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, * @param i where to store the data * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, const char *what, int32_t *i); @@ -183,7 +184,7 @@ GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, * @param i where to store the data * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h, const char *what, int64_t *i); @@ -224,7 +225,7 @@ GNUNET_BIO_write_open_buffer (void); * @return #GNUNET_OK upon success. Upon failure #GNUNET_SYSERR is returned * and the file is closed */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); @@ -240,7 +241,7 @@ GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); * @param size where to store the size of @e contents * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, char **emsg, void **contents, @@ -256,7 +257,7 @@ GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, * if the handle has an error message, the return value is #GNUNET_SYSERR * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg); @@ -269,7 +270,7 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg); * @param n number of bytes to write * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const char *what, const void *buffer, @@ -284,7 +285,7 @@ GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, * @param s string to write (can be NULL) * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *what, const char *s); @@ -298,7 +299,7 @@ GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, * @param what what is being written (for error message creation) * @param f float to write (must be a variable) */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, const char *what, float f); @@ -310,7 +311,7 @@ GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, * @param what what is being written (for error message creation) * @param f double to write (must be a variable) */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, const char *what, double f); @@ -324,7 +325,7 @@ GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, * @param i 32-bit integer to write * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, const char *what, int32_t i); @@ -338,7 +339,7 @@ GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, * @param i 64-bit integer to write * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, const char *what, int64_t i); @@ -489,7 +490,7 @@ GNUNET_BIO_read_spec_double (const char *what, double *f); * the last element must be #GNUNET_BIO_read_spec_end * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h, struct GNUNET_BIO_ReadSpec *rs); @@ -635,7 +636,7 @@ GNUNET_BIO_write_spec_double (const char *what, double *f); * the last element must be #GNUNET_BIO_write_spec_end * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ -int +enum GNUNET_GenericReturnValue GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h, struct GNUNET_BIO_WriteSpec *ws); diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index ce1b8f296..df38317ca 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h @@ -52,6 +52,7 @@ * @} */ +#include "gnunet_common.h" #if !defined (__GNUNET_UTIL_LIB_H_INSIDE__) #error "Only can be included directly." #endif @@ -177,7 +178,7 @@ GNUNET_CONTAINER_bloomfilter_init (const char *data, * @param size the size of the given @a data array * @return #GNUNET_SYSERR if the data array of the wrong size */ -int +enum GNUNET_GenericReturnValue GNUNET_CONTAINER_bloomfilter_get_raw_data ( const struct GNUNET_CONTAINER_BloomFilter *bf, char *data, @@ -291,7 +292,7 @@ GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf); * @param size size of @a data * @return #GNUNET_OK on success */ -int +enum GNUNET_GenericReturnValue GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, const char *data, size_t size); @@ -307,7 +308,7 @@ GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, * @param to_or the bloomfilter to or-in * @return #GNUNET_OK on success */ -int +enum GNUNET_GenericReturnValue GNUNET_CONTAINER_bloomfilter_or2 ( struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_CONTAINER_BloomFilter *to_or); @@ -577,7 +578,7 @@ GNUNET_CONTAINER_multihashmap_size ( * @return the number of key value pairs processed, * #GNUNET_SYSERR if it aborted iteration */ -int +enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_iterate ( struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, @@ -646,7 +647,7 @@ GNUNET_CONTAINER_multihashmap_iterator_destroy ( * @return the number of key value pairs processed, * #GNUNET_SYSERR if it aborted iteration */ -int +enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_get_multiple ( struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, @@ -1423,7 +1424,7 @@ GNUNET_CONTAINER_multiuuidmap_size ( * @return the number of key value pairs processed, * #GNUNET_SYSERR if it aborted iteration */ -int +enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multiuuidmap_iterate ( struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 289aa5649..44dfb4e44 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -2817,7 +2817,7 @@ GNUNET_CRYPTO_rsa_public_key_cmp (const struct GNUNET_CRYPTO_RsaPublicKey *p1, * @param[out] buf_size number of bytes stored in @a buf * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious */ -int +enum GNUNET_GenericReturnValue GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, struct GNUNET_CRYPTO_RsaPublicKey *pkey, diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index bdf3843b1..967170085 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -433,7 +433,7 @@ GNUNET_CURL_enable_async_scope_header (struct GNUNET_CURL_Context *ctx, * * @returns #GNUNET_YES iff given a valid scope ID */ -int +enum GNUNET_GenericReturnValue GNUNET_CURL_is_valid_scope_id (const char *scope_id); diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index 3aee30117..338f22223 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h @@ -38,6 +38,7 @@ #define GNUNET_GNSRECORD_LIB_H +#include "gnunet_common.h" #include "gnunet_identity_service.h" #ifdef __cplusplus @@ -653,7 +654,7 @@ GNUNET_GNSRECORD_block_create2 (const struct GNUNET_IDENTITY_PrivateKey *key, * @param block block to verify * @return #GNUNET_OK if the signature is valid */ -int +enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); @@ -668,7 +669,7 @@ GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block); * @return #GNUNET_OK on success, #GNUNET_SYSERR if the block was * not well-formed */ -int +enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_block_decrypt ( const struct GNUNET_GNSRECORD_Block *block, const struct GNUNET_IDENTITY_PublicKey *zone_key, const char *label, @@ -682,7 +683,7 @@ GNUNET_GNSRECORD_block_decrypt ( * @param b another record * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not. */ -int +enum GNUNET_GenericReturnValue GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a, const struct GNUNET_GNSRECORD_Data *b); diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index f424c49c2..3eca71f0f 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h @@ -18,6 +18,7 @@ SPDX-License-Identifier: AGPL3.0-or-later */ +#include "gnunet_common.h" #if !defined (__GNUNET_UTIL_LIB_H_INSIDE__) #error "Only can be included directly." #endif @@ -691,7 +692,7 @@ struct GNUNET_MQ_MessageHandler * @return #GNUNET_OK on success, #GNUNET_NO if no handler matched, * #GNUNET_SYSERR if message was rejected by check function */ -int +enum GNUNET_GenericReturnValue GNUNET_MQ_handle_message (const struct GNUNET_MQ_MessageHandler *handlers, const struct GNUNET_MessageHeader *mh); diff --git a/src/include/gnunet_mst_lib.h b/src/include/gnunet_mst_lib.h index af2dd3353..5b848bbd6 100644 --- a/src/include/gnunet_mst_lib.h +++ b/src/include/gnunet_mst_lib.h @@ -127,7 +127,7 @@ GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, * #GNUNET_NO if one_shot was set and we have another message ready * #GNUNET_SYSERR if the data stream is corrupt */ -int +enum GNUNET_GenericReturnValue GNUNET_MST_read (struct GNUNET_MessageStreamTokenizer *mst, struct GNUNET_NETWORK_Handle *sock, int purge, @@ -145,7 +145,7 @@ GNUNET_MST_read (struct GNUNET_MessageStreamTokenizer *mst, * #GNUNET_NO if one_shot was set and we have another message ready * #GNUNET_SYSERR if the data stream is corrupt */ -int +enum GNUNET_GenericReturnValue GNUNET_MST_next (struct GNUNET_MessageStreamTokenizer *mst, int one_shot); diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 8d71d7764..764b7b29d 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -39,6 +39,7 @@ #ifndef GNUNET_NETWORK_LIB_H #define GNUNET_NETWORK_LIB_H +#include "gnunet_common.h" #ifdef __cplusplus extern "C" { @@ -157,7 +158,7 @@ GNUNET_NETWORK_socket_box_native (int fd); * @param doBlock blocking mode * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ -int +enum GNUNET_GenericReturnValue GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, int doBlock); diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h index a3135e2cf..2a9cde47f 100644 --- a/src/include/gnunet_plugin_lib.h +++ b/src/include/gnunet_plugin_lib.h @@ -70,7 +70,7 @@ typedef void * * @param library_name name of the plugin to test if it is installed * @return #GNUNET_YES if the plugin exists, #GNUNET_NO if not */ -int +enum GNUNET_GenericReturnValue GNUNET_PLUGIN_test (const char *library_name); -- cgit v1.2.3