[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 149/335: microhttpd2.h: fixed all GCC warnings and error
From: |
gnunet |
Subject: |
[libmicrohttpd] 149/335: microhttpd2.h: fixed all GCC warnings and errors |
Date: |
Sat, 27 Jul 2024 22:00:45 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.
commit 1e538fb80b20d3f9eb2d6c97c849806efb128c70
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Apr 8 23:53:34 2024 +0200
microhttpd2.h: fixed all GCC warnings and errors
---
src/include/microhttpd2.h | 95 ++++++++++++++++++++++++++++++++---------------
1 file changed, 65 insertions(+), 30 deletions(-)
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
index 675b5b8a..295baca9 100644
--- a/src/include/microhttpd2.h
+++ b/src/include/microhttpd2.h
@@ -865,7 +865,7 @@ typedef SOCKET MHD_socket;
* that must not be modified by the function
*/
# define MHD_FN_PAR_IN_(param_num) \
- __attribute__ ((access (read_only,pram_num)))
+ __attribute__ ((access (read_only,param_num)))
# endif /* !MHD_FN_PAR_IN_ */
/* Override detected value of MHD_FN_PAR_IN_SIZE_ by defining it before
@@ -877,7 +877,7 @@ typedef SOCKET MHD_socket;
* modified by the function
*/
# define MHD_FN_PAR_IN_SIZE_(param_num,size_num) \
- __attribute__ ((access (read_only,pram_num,size_num)))
+ __attribute__ ((access (read_only,param_num,size_num)))
# endif /* !MHD_FN_PAR_IN_SIZE_ */
/* Override detected value of MHD_FN_PAR_OUT_ by defining it before
@@ -888,7 +888,7 @@ typedef SOCKET MHD_socket;
* that could be written by the function, but not read.
*/
# define MHD_FN_PAR_OUT_(param_num) \
- __attribute__ ((access (write_only,pram_num)))
+ __attribute__ ((access (write_only,param_num)))
# endif /* !MHD_FN_PAR_OUT_ */
/* Override detected value of MHD_FN_PAR_OUT_SIZE_ by defining it before
@@ -900,7 +900,7 @@ typedef SOCKET MHD_socket;
* written by the function, but not read.
*/
# define MHD_FN_PAR_OUT_SIZE_(param_num,size_num) \
- __attribute__ ((access (write_only,pram_num,size_num)))
+ __attribute__ ((access (write_only,param_num,size_num)))
# endif /* !MHD_FN_PAR_OUT_SIZE_ */
/* Override detected value of MHD_FN_PAR_INOUT_ by defining it before
@@ -911,7 +911,7 @@ typedef SOCKET MHD_socket;
* that could be both read and written by the function.
*/
# define MHD_FN_PAR_INOUT_(param_num) \
- __attribute__ ((access (read_write,pram_num)))
+ __attribute__ ((access (read_write,param_num)))
# endif /* !MHD_FN_PAR_INOUT_ */
/* Override detected value of MHD_FN_PAR_INOUT_SIZE_ by defining it before
@@ -923,7 +923,7 @@ typedef SOCKET MHD_socket;
* both read and written by the function.
*/
# define MHD_FN_PAR_INOUT_SIZE_(param_num,size_num) \
- __attribute__ ((access (read_write,pram_num,size_num)))
+ __attribute__ ((access (read_write,param_num,size_num)))
# endif /* !MHD_FN_PAR_INOUT_SIZE_ */
# endif /* access */
@@ -2486,6 +2486,23 @@ enum MHD_FIXED_ENUM_MHD_APP_SET_ MHD_HTTP_PostEncoding
/* Obsoleted. W3C Mobile Web Best Practices Working Group */
#define MHD_HTTP_HEADER_X_DEVICE_USER_AGENT "X-Device-User-Agent"
+
+/**
+ * Predefined list of headers
+ */
+enum MHD_PredefinedHeader;
+
+/**
+ * Get text version of the predefined header.
+ * @param stk the code of the predefined header
+ * @return the pointer to the text version,
+ * NULL if method is MHD_HTTP_METHOD_OTHER
+ * or not known.
+ */
+MHD_EXTERN_ const struct MHD_String *
+MHD_predef_header_to_string (enum MHD_PredefinedHeader stk)
+MHD_FN_PURE_;
+
/** @} */ /* end of group headers */
/**
@@ -2530,7 +2547,7 @@ typedef const struct MHD_Action *
MHD_EXTERN_ struct MHD_Daemon *
MHD_daemon_create (MHD_RequestCallback req_cb,
void *req_cb_cls)
-MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_IN_ (1);
+MHD_FN_MUST_CHECK_RESULT_;
/**
@@ -2548,7 +2565,7 @@ MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_IN_ (1);
*/
MHD_EXTERN_ enum MHD_StatusCode
MHD_daemon_start (struct MHD_Daemon *daemon)
-MHD_FN_PAR_NONNULL_ (1);
+MHD_FN_PAR_NONNULL_ (1) MHD_FN_MUST_CHECK_RESULT_;
/**
@@ -6673,7 +6690,7 @@ MHD_daemon_add_connection (struct MHD_Daemon *daemon,
const struct sockaddr *addr,
void *connection_cntx)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_IN_SIZE_ (4,3);
+MHD_FN_PAR_IN_ (4);
/* ********************* connection options ************** */
@@ -7064,7 +7081,7 @@ MHD_request_get_values_list (
size_t num_elements,
struct MHD_NameValueKind elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)])
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_ (4);
+MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_SIZE_ (4,3);
/**
@@ -8424,6 +8441,24 @@ MHD_response_from_buffer_copy (
MHD_FN_PAR_IN_SIZE_ (3,2);
+/**
+ * I/O vector type. Provided for use with #MHD_response_from_iovec().
+ * @ingroup response
+ */
+struct MHD_IoVec
+{
+ /**
+ * The pointer to the memory region for I/O.
+ */
+ const void *iov_base;
+
+ /**
+ * The size in bytes of the memory region for I/O.
+ */
+ size_t iov_len;
+};
+
+
/**
* Create a response object with an array of memory buffers
* used as the response body.
@@ -8604,7 +8639,7 @@ MHD_action_continue (struct MHD_Request *req);
* @ingroup action
*/
typedef const struct MHD_Action *
-(MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_NONNULL_ (3)
+(MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_IN_SIZE_ (4,3)
*MHD_UploadCallback)(void *upload_cls,
struct MHD_Request *request,
size_t content_data_size,
@@ -8754,7 +8789,7 @@ MHD_action_post_processor (struct MHD_Request *request,
void *reader_cls,
MHD_PostDataFinished done_cb,
void *done_cb_cls)
-MHD_FN_PAR_NONNULL_ (2);
+MHD_FN_PAR_NONNULL_ (1);
/**
@@ -8848,7 +8883,7 @@ MHD_request_get_post_data_list (
size_t num_elements,
struct MHD_PostData elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)])
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_SIZE_ (3,2);
/* ***************** (c) WebSocket support ********** */
@@ -9313,7 +9348,7 @@ MHD_digest_auth_calc_userhash (enum MHD_DigestAuthAlgo
algo,
size_t bin_buf_size,
void *userhash_bin)
MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (2)
-MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (4,3);
+MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (5,4);
/**
@@ -9361,7 +9396,7 @@ MHD_digest_auth_calc_userhash_hex (
size_t hex_buf_size,
char userhash_hex[MHD_FN_PAR_DYN_ARR_SIZE_ (hex_buf_size)])
MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (2)
-MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (4,3);
+MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (5,4);
/**
@@ -9574,7 +9609,7 @@ struct MHD_DigestAuthInfo
* The 'realm' parameter value, as specified by client.
* If not specified by client then string pointer is NULL.
*/
- struct MHD_StringNull realm;
+ struct MHD_StringNullable realm;
/**
* The 'qop' parameter value.
@@ -10460,7 +10495,7 @@ MHD_EXTERN_ enum MHD_StatusCode
MHD_lib_get_info_fixed_sz (enum MHD_LibInfoFixed info_type,
union MHD_LibInfoFixedData *return_data,
size_t return_data_size)
-MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_SIZE_ (2,3)
+MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_ (2)
MHD_FN_PURE_;
/**
@@ -10540,10 +10575,10 @@ union MHD_LibInfoDynamicData
* @ingroup specialized
*/
MHD_EXTERN_ enum MHD_StatusCode
-MHD_lib_get_info_dynamic_sz (enum MHD_LibDynamicInfo info_type,
- union MHD_LibDynamicInfoData *return_data,
+MHD_lib_get_info_dynamic_sz (enum MHD_LibInfoDynamic info_type,
+ union MHD_LibInfoDynamicData *return_data,
size_t return_data_size)
-MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_SIZE_ (2,3);
+MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_OUT_ (2);
/**
* Get dynamic information about MHD that may be changed at run-time.
@@ -10653,7 +10688,7 @@ MHD_daemon_get_info_fixed_sz (struct MHD_Daemon *daemon,
union MHD_DaemonInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
/**
@@ -10711,7 +10746,7 @@ enum MHD_DaemonInfoDynamicType
* This value enforces specific underlying integer type for the enum.
* Do not use.
*/
- MHD_DAEMON_INFO_FIXED_SENTINEL = 65535
+ MHD_DAEMON_INFO_DYNAMIC_SENTINEL = 65535
};
@@ -10760,7 +10795,7 @@ MHD_daemon_get_info_dynamic_sz (struct MHD_Daemon
*daemon,
union MHD_DaemonInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
/**
* Obtain dynamic information about the given daemon.
@@ -10861,7 +10896,7 @@ MHD_connection_get_info_fixed_sz (
union MHD_ConnectionInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
@@ -11050,7 +11085,7 @@ MHD_connection_get_info_dynamic_sz (
union MHD_ConnectionInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
/**
@@ -11139,7 +11174,7 @@ MHD_stream_get_info_fixed_sz (
union MHD_StreamInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
@@ -11219,7 +11254,7 @@ MHD_stream_get_info_dynamic_sz (
union MHD_StreamInfoDynamicData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4);
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (3);
/**
@@ -11314,7 +11349,7 @@ union MHD_RequestInfoFixedData
/**
* The HTTP version type.
*/
- enum MHD_HTTP_Version v_http_ver;
+ enum MHD_HTTP_ProtocolVersion v_http_ver;
/**
* The HTTP method type.
@@ -11343,7 +11378,7 @@ MHD_request_get_info_fixed_sz (struct MHD_Request
*request,
union MHD_RequestInfoFixedData *return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
@@ -11591,7 +11626,7 @@ MHD_request_get_info_dynamic_sz (struct MHD_Request
*request,
union MHD_RequestInfoDynamicData
*return_value,
size_t return_value_size)
MHD_FN_PAR_NONNULL_ (1)
-MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_INOUT_SIZE_ (3,4)
+MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_(3)
MHD_FN_PURE_;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 132/335: Unified enum formatting, (continued)
- [libmicrohttpd] 132/335: Unified enum formatting, gnunet, 2024/07/27
- [libmicrohttpd] 140/335: Tmp: add doxy-config, gnunet, 2024/07/27
- [libmicrohttpd] 148/335: Fixed all doxygen warnings, gnunet, 2024/07/27
- [libmicrohttpd] 162/335: configure: check for more optional headers, gnunet, 2024/07/27
- [libmicrohttpd] 150/335: microhttpd2.h: fixed all g++ warnings and errors, gnunet, 2024/07/27
- [libmicrohttpd] 146/335: microhttpd2.h: more fixes, gnunet, 2024/07/27
- [libmicrohttpd] 163/335: configure: use more headers when checking for calloc(), gnunet, 2024/07/27
- [libmicrohttpd] 151/335: spellcheck, gnunet, 2024/07/27
- [libmicrohttpd] 166/335: renamed mhd_sys_options.h -> mhd_sys_options.h, gnunet, 2024/07/27
- [libmicrohttpd] 164/335: configure: reworked _MHD_EXTERN definition, gnunet, 2024/07/27
- [libmicrohttpd] 149/335: microhttpd2.h: fixed all GCC warnings and errors,
gnunet <=
- [libmicrohttpd] 153/335: say it is STF-funded, gnunet, 2024/07/27
- [libmicrohttpd] 169/335: mhd_sys_options.h: added support for more attributes for functions, gnunet, 2024/07/27
- [libmicrohttpd] 158/335: add response option generation;, gnunet, 2024/07/27
- [libmicrohttpd] 156/335: generator v1, gnunet, 2024/07/27
- [libmicrohttpd] 170/335: mhd_sys_options.h: renamed _MHD_EXTERN -> MHD_EXTERN_, gnunet, 2024/07/27
- [libmicrohttpd] 167/335: mhd_sys_options.h: formatting, gnunet, 2024/07/27
- [libmicrohttpd] 159/335: remove dependency on recutils and libjansson, gnunet, 2024/07/27
- [libmicrohttpd] 160/335: This API is TERRIBLE., gnunet, 2024/07/27
- [libmicrohttpd] 174/335: sys_socket_types.h: new internal header, gnunet, 2024/07/27
- [libmicrohttpd] 176/335: mhd_public_api.h: new internal header, gnunet, 2024/07/27