commit 148e953db8bd32788396d43946c3808d6263caf8
parent d1ab7045e989ae27a111fa98f12d117f03a9f0da
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 20 Dec 2025 10:24:18 +0100
try to fix build issue by changing 'restrict => MHD_RESTRICT'
Diffstat:
| M | src/mhd2/mhd_str.h | | | 96 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
1 file changed, 49 insertions(+), 47 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 *restrict inbuff,
- char *restrict outbuff)
+ const char *MHD_RESTRICT inbuff,
+ char *MHD_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 *restrict str)
+ const char *MHD_RESTRICT str)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (2,1);
@@ -199,9 +199,10 @@ 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 *restrict inbuff,
- char *restrict outbuff)
+ const char *MHD_RESTRICT inbuff,
+ char *MHD_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 */
/**
@@ -218,8 +219,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 *restrict str,
- const char *const restrict token,
+mhd_str_has_token_caseless (const char *MHD_RESTRICT str,
+ const char *const MHD_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);
@@ -267,12 +268,12 @@ MHD_FN_PAR_IN_ (1) MHD_FN_PAR_IN_ (2);
* 'false' otherwise.
*/
MHD_INTERNAL bool
-mhd_str_remove_token_caseless (const char *restrict str,
+mhd_str_remove_token_caseless (const char *MHD_RESTRICT str,
size_t str_len,
- const char *const restrict token,
+ const char *const MHD_RESTRICT token,
const size_t token_len,
- char *restrict buf,
- ssize_t *restrict buf_size)
+ char *MHD_RESTRICT buf,
+ ssize_t *MHD_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);
@@ -301,9 +302,9 @@ MHD_FN_PAR_OUT_ (5) MHD_FN_PAR_INOUT_ (6);
* 'false' otherwise.
*/
MHD_INTERNAL bool
-mhd_str_remove_tokens_caseless (char *restrict str,
- size_t *restrict str_len,
- const char *const restrict tkns,
+mhd_str_remove_tokens_caseless (char *MHD_RESTRICT str,
+ size_t *MHD_RESTRICT str_len,
+ const char *const MHD_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);
@@ -323,8 +324,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 *restrict str,
- uint_fast64_t *restrict out_val)
+mhd_str_to_uint64 (const char *MHD_RESTRICT str,
+ uint_fast64_t *MHD_RESTRICT out_val)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1) MHD_FN_PAR_IN_ (1)
MHD_FN_PAR_OUT_ (2);
@@ -342,9 +343,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 *restrict str,
+mhd_str_to_uint64_n (const char *MHD_RESTRICT str,
size_t maxlen,
- uint_fast64_t *restrict out_val)
+ uint_fast64_t *MHD_RESTRICT out_val)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3);
@@ -359,8 +360,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 *restrict str,
- uint_fast32_t *restrict out_val)
+mhd_strx_to_uint32 (const char *MHD_RESTRICT str,
+ uint_fast32_t *MHD_RESTRICT out_val)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1)
MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2);
@@ -379,9 +380,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 *restrict str,
+mhd_strx_to_uint32_n (const char *MHD_RESTRICT str,
size_t maxlen,
- uint_fast32_t *restrict out_val)
+ uint_fast32_t *MHD_RESTRICT out_val)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3);
@@ -396,8 +397,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 *restrict str,
- uint_fast64_t *restrict out_val)
+mhd_strx_to_uint64 (const char *MHD_RESTRICT str,
+ uint_fast64_t *MHD_RESTRICT out_val)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (1)
MHD_FN_PAR_IN_ (1) MHD_FN_PAR_OUT_ (2);
@@ -416,9 +417,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 *restrict str,
+mhd_strx_to_uint64_n (const char *MHD_RESTRICT str,
size_t maxlen,
- uint_fast64_t *restrict out_val)
+ uint_fast64_t *MHD_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 */
@@ -443,9 +444,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 *restrict str,
+mhd_str_to_uvalue_n (const char *MHD_RESTRICT str,
size_t maxlen,
- void *restrict out_val,
+ void *MHD_RESTRICT out_val,
size_t val_size,
uint_fast64_t max_val,
unsigned int base)
@@ -580,9 +581,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 *restrict bin,
+mhd_bin_to_hex (const void *MHD_RESTRICT bin,
size_t size,
- char *restrict hex)
+ char *MHD_RESTRICT hex)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1, 2) MHD_FN_PAR_OUT_ (3);
/**
@@ -595,9 +596,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 *restrict bin,
+mhd_bin_to_hex_z (const void *MHD_RESTRICT bin,
size_t size,
- char *restrict hex)
+ char *MHD_RESTRICT hex)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1, 2) MHD_FN_PAR_OUT_ (3);
/**
@@ -614,9 +615,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 *restrict hex,
+mhd_hex_to_bin (const char *MHD_RESTRICT hex,
size_t len,
- void *restrict bin)
+ void *MHD_RESTRICT bin)
MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_IN_SIZE_ (1,2) MHD_FN_PAR_OUT_ (3);
/**
@@ -671,7 +672,7 @@ mhd_str_pct_decode_lenient_n (const char *pct_encoded,
size_t pct_encoded_len,
char *decoded,
size_t buf_size,
- bool *restrict broken_encoding)
+ bool *MHD_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);
@@ -713,13 +714,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 *restrict str,
- bool *restrict broken_encoding)
+mhd_str_pct_decode_in_place_lenient (char *MHD_RESTRICT str,
+ bool *MHD_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 *restrict str)
+ char *MHD_RESTRICT str)
MHD_FN_PAR_NONNULL_ (2) MHD_FN_PAR_INOUT_SIZE_ (2,1);
@@ -924,8 +925,9 @@ 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 *restrict str,
- const struct MHD_String *restrict token)
+mhd_str_starts_with_token_opt_param (const struct MHD_String *MHD_RESTRICT str,
+ const struct MHD_String *MHD_RESTRICT token
+ )
MHD_FN_PURE_ MHD_FN_PAR_NONNULL_ALL_;
@@ -976,13 +978,13 @@ enum MHD_FIXED_ENUM_ mhd_StingStartsWithTokenResult
*/
MHD_INTERNAL enum mhd_StingStartsWithTokenResult
mhd_str_starts_with_token_req_param (
- 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)
+ 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)
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 */