libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit 9c0c27b1a8c5162f38eec67f0a75713add057920
parent cb6d74c412ec697a379842f9d653dc351a0b6d5e
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Sun, 21 Dec 2025 18:15:07 +0100

Revert "try to fix build issue by changing 'restrict => MHD_RESTRICT'"

This reverts commit 148e953db8bd32788396d43946c3808d6263caf8.

Diffstat:
Msrc/mhd2/mhd_str.h | 96+++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 47 insertions(+), 49 deletions(-)

diff --git a/src/mhd2/mhd_str.h b/src/mhd2/mhd_str.h @@ -170,8 +170,8 @@ MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_ (1) MHD_FN_PAR_IN_ (2); */ MHD_INTERNAL void mhd_str_to_lowercase_bin_n (size_t size, - const char *MHD_RESTRICT inbuff, - char *MHD_RESTRICT outbuff) + const char *restrict inbuff, + char *restrict outbuff) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1) MHD_FN_PAR_OUT_SIZE_ (3,1); /** @@ -183,7 +183,7 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1) MHD_FN_PAR_OUT_SIZE_ (3,1); */ MHD_INTERNAL bool mhd_str_is_lowercase_bin_n (size_t len, - const char *MHD_RESTRICT str) + const char *restrict str) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1); @@ -199,10 +199,9 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1); */ MHD_INTERNAL void mhd_str_to_uppercase_bin_n (size_t size, - const char *MHD_RESTRICT inbuff, - char *MHD_RESTRICT outbuff) + const char *restrict inbuff, + char *restrict outbuff) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1) MHD_FN_PAR_OUT_SIZE_ (3,1); - #endif /* mhd_HAVE_STR_TO_UPPER */ /** @@ -219,8 +218,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1) MHD_FN_PAR_OUT_SIZE_ (3,1); * @return non-zero if two strings are equal, zero otherwise. */ MHD_INTERNAL bool -mhd_str_has_token_caseless (const char *MHD_RESTRICT str, - const char *const MHD_RESTRICT token, +mhd_str_has_token_caseless (const char *restrict str, + const char *const restrict token, size_t token_len) MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1) MHD_FN_PAR_IN_ (1) MHD_FN_PAR_IN_ (2); @@ -268,12 +267,12 @@ MHD_FN_PAR_IN_ (1) MHD_FN_PAR_IN_ (2); * 'false' otherwise. */ MHD_INTERNAL bool -mhd_str_remove_token_caseless (const char *MHD_RESTRICT str, +mhd_str_remove_token_caseless (const char *restrict str, size_t str_len, - const char *const MHD_RESTRICT token, + const char *const restrict token, const size_t token_len, - char *MHD_RESTRICT buf, - ssize_t *MHD_RESTRICT buf_size) + char *restrict buf, + ssize_t *restrict buf_size) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_IN_SIZE_ (3,4) MHD_FN_PAR_OUT_ (5) MHD_FN_PAR_INOUT_ (6); @@ -302,9 +301,9 @@ MHD_FN_PAR_OUT_ (5) MHD_FN_PAR_INOUT_ (6); * 'false' otherwise. */ MHD_INTERNAL bool -mhd_str_remove_tokens_caseless (char *MHD_RESTRICT str, - size_t *MHD_RESTRICT str_len, - const char *const MHD_RESTRICT tkns, +mhd_str_remove_tokens_caseless (char *restrict str, + size_t *restrict str_len, + const char *const restrict tkns, const size_t tkns_len) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_INOUT_ (1) MHD_FN_PAR_INOUT_ (2) MHD_FN_PAR_IN_SIZE_ (3,4); @@ -324,8 +323,8 @@ MHD_FN_PAR_IN_SIZE_ (3,4); * then possible to store in uint_fast64_t */ MHD_INTERNAL size_t -mhd_str_to_uint64 (const char *MHD_RESTRICT str, - uint_fast64_t *MHD_RESTRICT out_val) +mhd_str_to_uint64 (const char *restrict str, + uint_fast64_t *restrict out_val) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1) MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2); @@ -343,9 +342,9 @@ MHD_FN_PAR_OUT_ (2); * then possible to store in uint_fast64_t */ MHD_INTERNAL size_t -mhd_str_to_uint64_n (const char *MHD_RESTRICT str, +mhd_str_to_uint64_n (const char *restrict str, size_t maxlen, - uint_fast64_t *MHD_RESTRICT out_val) + uint_fast64_t *restrict out_val) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); @@ -360,8 +359,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); * then possible to store in uint_fast32_t */ MHD_INTERNAL size_t -mhd_strx_to_uint32 (const char *MHD_RESTRICT str, - uint_fast32_t *MHD_RESTRICT out_val) +mhd_strx_to_uint32 (const char *restrict str, + uint_fast32_t *restrict out_val) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1) MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2); @@ -380,9 +379,9 @@ MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2); * then possible to store in uint_fast32_t */ MHD_INTERNAL size_t -mhd_strx_to_uint32_n (const char *MHD_RESTRICT str, +mhd_strx_to_uint32_n (const char *restrict str, size_t maxlen, - uint_fast32_t *MHD_RESTRICT out_val) + uint_fast32_t *restrict out_val) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); @@ -397,8 +396,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); * then possible to store in uint_fast64_t */ MHD_INTERNAL size_t -mhd_strx_to_uint64 (const char *MHD_RESTRICT str, - uint_fast64_t *MHD_RESTRICT out_val) +mhd_strx_to_uint64 (const char *restrict str, + uint_fast64_t *restrict out_val) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1) MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2); @@ -417,9 +416,9 @@ MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2); * then possible to store in uint_fast64_t */ MHD_INTERNAL size_t -mhd_strx_to_uint64_n (const char *MHD_RESTRICT str, +mhd_strx_to_uint64_n (const char *restrict str, size_t maxlen, - uint_fast64_t *MHD_RESTRICT out_val) + uint_fast64_t *restrict out_val) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); #else /* MHD_FAVOR_SMALL_CODE */ @@ -444,9 +443,9 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); * or @a base is not 10 or 16 */ MHD_INTERNAL size_t -mhd_str_to_uvalue_n (const char *MHD_RESTRICT str, +mhd_str_to_uvalue_n (const char *restrict str, size_t maxlen, - void *MHD_RESTRICT out_val, + void *restrict out_val, size_t val_size, uint_fast64_t max_val, unsigned int base) @@ -581,9 +580,9 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_OUT_SIZE_ (3,4); * @return The number of characters written to the output buffer. */ MHD_INTERNAL size_t -mhd_bin_to_hex (const void *MHD_RESTRICT bin, +mhd_bin_to_hex (const void *restrict bin, size_t size, - char *MHD_RESTRICT hex) + char *restrict hex) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1, 2) MHD_FN_PAR_OUT_ (3); /** @@ -596,9 +595,9 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1, 2) MHD_FN_PAR_OUT_ (3); * not including terminating zero. */ MHD_INTERNAL size_t -mhd_bin_to_hex_z (const void *MHD_RESTRICT bin, +mhd_bin_to_hex_z (const void *restrict bin, size_t size, - char *MHD_RESTRICT hex) + char *restrict hex) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1, 2) MHD_FN_PAR_OUT_ (3); /** @@ -615,9 +614,9 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1, 2) MHD_FN_PAR_OUT_ (3); * zero if found any character which is not hexadecimal digits */ MHD_INTERNAL size_t -mhd_hex_to_bin (const char *MHD_RESTRICT hex, +mhd_hex_to_bin (const char *restrict hex, size_t len, - void *MHD_RESTRICT bin) + void *restrict bin) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3); /** @@ -672,7 +671,7 @@ mhd_str_pct_decode_lenient_n (const char *pct_encoded, size_t pct_encoded_len, char *decoded, size_t buf_size, - bool *MHD_RESTRICT broken_encoding) + bool *restrict broken_encoding) MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_SIZE_ (3,4); @@ -714,13 +713,13 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1); * @return the number of character in decoded string */ MHD_INTERNAL size_t -mhd_str_pct_decode_in_place_lenient (char *MHD_RESTRICT str, - bool *MHD_RESTRICT broken_encoding) +mhd_str_pct_decode_in_place_lenient (char *restrict str, + bool *restrict broken_encoding) MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_CSTR_ (1); MHD_INTERNAL size_t mhd_str_dec_norm_uri_path (size_t str_len, - char *MHD_RESTRICT str) + char *restrict str) MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_INOUT_SIZE_ (2,1); @@ -925,9 +924,8 @@ MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_SIZE_ (3,4); * 'false' otherwise */ MHD_INTERNAL bool -mhd_str_starts_with_token_opt_param (const struct MHD_String *MHD_RESTRICT str, - const struct MHD_String *MHD_RESTRICT token - ) +mhd_str_starts_with_token_opt_param (const struct MHD_String *restrict str, + const struct MHD_String *restrict token) MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_; @@ -978,13 +976,13 @@ enum MHD_FIXED_ENUM_ mhd_StingStartsWithTokenResult */ MHD_INTERNAL enum mhd_StingStartsWithTokenResult mhd_str_starts_with_token_req_param ( - const struct MHD_String *MHD_RESTRICT str, - const struct MHD_String *MHD_RESTRICT token, - const struct MHD_String *MHD_RESTRICT par, - struct mhd_BufferConst *MHD_RESTRICT par_value, - bool *MHD_RESTRICT par_value_needs_unquote) + const struct MHD_String *restrict str, + const struct MHD_String *restrict token, + const struct MHD_String *restrict par, + struct mhd_BufferConst *restrict par_value, + bool *restrict par_value_needs_unquote) MHD_FN_PAR_NONNULL_ALL_ -MHD_FN_PAR_IN_ (1) MHD_FN_PAR_IN_ (2) MHD_FN_PAR_IN_ (3) -MHD_FN_PAR_OUT_ (4) MHD_FN_PAR_OUT_ (5); +MHD_FN_PAR_IN_(1) MHD_FN_PAR_IN_(2) MHD_FN_PAR_IN_(3) +MHD_FN_PAR_OUT_(4) MHD_FN_PAR_OUT_ (5); #endif /* MHD_STR_H */