commit 416b828bb0390245f33e73545b6155e3ed830db1
parent e581a7e62cecf75ec0f6535e438250ff6a5557a8
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Sun, 21 Dec 2025 15:35:53 +0100
h2_huffman_codec: fixed clang++ error
Diffstat:
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/src/mhd2/h2/hpack/h2_huffman_codec.c b/src/mhd2/h2/hpack/h2_huffman_codec.c
@@ -71,6 +71,10 @@
# endif
#endif
+/* Broken IDEs compatibility */
+#ifdef __CDT_PARSER__
+# define mhd_ALIGNED_8 /* empty */
+#endif
/**
* HTTP/2 static Huffman codes from RFC 7541
@@ -810,8 +814,8 @@ static bool h2huff_decode_inited = false;
'X' ( 88) 11111100 [ 8]
'Z' ( 90) 11111101 [ 8]
*/
-static mhd_ALIGNED_64
-uint_least16_t mhd_h2huff_SL_by_code_0p8c[HUFF_DTBL_SIZE (0, 8, 7)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_0p8c mhd_ALIGNED_64[HUFF_DTBL_SIZE (0, 8, 7)];
/* Decode table for prefix 7 bits, table width 6 bits.
Codes:
@@ -824,8 +828,8 @@ uint_least16_t mhd_h2huff_SL_by_code_0p8c[HUFF_DTBL_SIZE (0, 8, 7)];
']' ( 93) 1111111 111100 [13]
'~' (126) 1111111 111101 [13]
*/
-static mhd_ALIGNED_64
-uint_least16_t mhd_h2huff_SL_by_code_7p6c[HUFF_DTBL_SIZE (7, 6, 12)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_7p6c mhd_ALIGNED_64[HUFF_DTBL_SIZE (7, 6, 12)];
/* Decode table for prefix 12 bits, table width 3 bits.
Codes:
@@ -835,8 +839,8 @@ uint_least16_t mhd_h2huff_SL_by_code_7p6c[HUFF_DTBL_SIZE (7, 6, 12)];
'`' ( 96) 111111111111 101 [15]
'{' (123) 111111111111 110 [15]
*/
-static mhd_ALIGNED_8
-uint_least16_t mhd_h2huff_SL_by_code_12p3c[HUFF_DTBL_SIZE (12,3,15)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_12p3c mhd_ALIGNED_8[HUFF_DTBL_SIZE (12,3,15)];
/* Decode table for prefix 15 bits, table width 7 bits.
Codes:
@@ -849,8 +853,8 @@ uint_least16_t mhd_h2huff_SL_by_code_12p3c[HUFF_DTBL_SIZE (12,3,15)];
(170) 111111111111111 1011110 [22]
(173) 111111111111111 1011111 [22]
*/
-static mhd_ALIGNED_16
-uint_least16_t mhd_h2huff_SL_by_code_15p7c[HUFF_DTBL_SIZE (15,7,17)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_15p7c mhd_ALIGNED_16[HUFF_DTBL_SIZE (15,7,17)];
/* Decode table for prefix 17 bits, table width 6 bits.
Codes:
@@ -863,8 +867,8 @@ uint_least16_t mhd_h2huff_SL_by_code_15p7c[HUFF_DTBL_SIZE (15,7,17)];
(234) 1111111111111111111 101110 [25]
(235) 1111111111111111111 101111 [25]
*/
-static mhd_ALIGNED_16
-uint_least16_t mhd_h2huff_SL_by_code_17p6c[HUFF_DTBL_SIZE (17,6,19)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_17p6c mhd_ALIGNED_16[HUFF_DTBL_SIZE (17,6,19)];
/* Decode table for prefix 19 bits, table width 6 bits.
Codes:
@@ -877,8 +881,8 @@ uint_least16_t mhd_h2huff_SL_by_code_17p6c[HUFF_DTBL_SIZE (17,6,19)];
(252) 111111111111111111111 101110 [27]
(253) 111111111111111111111 101111 [27]
*/
-static mhd_ALIGNED_16
-uint_least16_t mhd_h2huff_SL_by_code_19p6c[HUFF_DTBL_SIZE (19,6,21)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_19p6c mhd_ALIGNED_16[HUFF_DTBL_SIZE (19,6,21)];
/* Decode table for prefix 21 bits, table width 6 bits.
Codes:
@@ -891,8 +895,8 @@ uint_least16_t mhd_h2huff_SL_by_code_19p6c[HUFF_DTBL_SIZE (19,6,21)];
(252) 111111111111111111111 101110 [27]
(253) 111111111111111111111 101111 [27]
*/
-static mhd_ALIGNED_16
-uint_least16_t mhd_h2huff_SL_by_code_21p6c[HUFF_DTBL_SIZE (21,6,23)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_21p6c mhd_ALIGNED_16[HUFF_DTBL_SIZE (21,6,23)];
/* Decode table for prefix 23 bits, table width 5 bits.
Codes:
@@ -905,8 +909,8 @@ uint_least16_t mhd_h2huff_SL_by_code_21p6c[HUFF_DTBL_SIZE (21,6,23)];
(220) 11111111111111111111111 11101 [28]
(249) 11111111111111111111111 11110 [28]
*/
-static mhd_ALIGNED_16
-uint_least16_t mhd_h2huff_SL_by_code_23p5c[HUFF_DTBL_SIZE (23,5,28)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_23p5c mhd_ALIGNED_16[HUFF_DTBL_SIZE (23,5,28)];
/* Decode table for prefix 28 bits, table width 2 bits.
Codes:
@@ -914,8 +918,8 @@ uint_least16_t mhd_h2huff_SL_by_code_23p5c[HUFF_DTBL_SIZE (23,5,28)];
( 13) 1111111111111111111111111111 01 [30]
( 22) 1111111111111111111111111111 10 [30]
*/
-static mhd_ALIGNED_8
-uint_least16_t mhd_h2huff_SL_by_code_28p2c[HUFF_DTBL_SIZE (28,2,30)];
+static uint_least16_t
+mhd_h2huff_SL_by_code_28p2c mhd_ALIGNED_8[HUFF_DTBL_SIZE (28,2,30)];
/**