[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 04/05: test_str: made test compatible with non-VLA compi
From: |
gnunet |
Subject: |
[libmicrohttpd] 04/05: test_str: made test compatible with non-VLA compilers |
Date: |
Tue, 14 Jun 2022 20:22:55 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit e4850e5b2c67c2c7f4b925b4eaea0554d67efb91
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jun 14 20:40:43 2022 +0300
test_str: made test compatible with non-VLA compilers
---
src/microhttpd/test_str.c | 144 +++++++++++++++++++++++-----------------------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/src/microhttpd/test_str.c b/src/microhttpd/test_str.c
index f2f4d32c..16b63bd6 100644
--- a/src/microhttpd/test_str.c
+++ b/src/microhttpd/test_str.c
@@ -513,8 +513,8 @@ check_eq_strings (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(eq_strings) / sizeof(eq_strings[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(eq_strings) / sizeof(eq_strings[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -560,8 +560,8 @@ check_neq_strings (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(neq_strings) / sizeof(neq_strings[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(neq_strings) / sizeof(neq_strings[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -607,8 +607,8 @@ check_eq_strings_n (void)
{
size_t t_failed = 0;
size_t i, j, k;
- static const size_t n_checks = sizeof(eq_strings) / sizeof(eq_strings[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(eq_strings) / sizeof(eq_strings[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -660,8 +660,8 @@ check_neq_strings_n (void)
{
size_t t_failed = 0;
size_t i, j, k;
- static const size_t n_checks = sizeof(neq_strings) / sizeof(neq_strings[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(neq_strings) / sizeof(neq_strings[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1125,9 +1125,9 @@ check_str_to_uint64_valid (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(dstrs_w_values)
- / sizeof(dstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(dstrs_w_values)
+ / sizeof(dstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1191,8 +1191,8 @@ check_str_to_uint64_valid (void)
static size_t
check_str_to_uint64_all_chars (void)
{
- static const size_t n_checks = 256; /* from 0 to 255 */
- int c_failed[n_checks];
+ int c_failed[256]; /* from 0 to 255 */
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
size_t t_failed = 0;
size_t j;
@@ -1260,8 +1260,8 @@ check_str_to_uint64_overflow (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_ovflw) / sizeof(str_ovflw[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_ovflw) / sizeof(str_ovflw[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1318,8 +1318,8 @@ check_str_to_uint64_no_val (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_no_num) / sizeof(str_no_num[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1376,9 +1376,9 @@ check_str_to_uint64_n_valid (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(dstrs_w_values)
- / sizeof(dstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(dstrs_w_values)
+ / sizeof(dstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1446,8 +1446,8 @@ check_str_to_uint64_n_valid (void)
static size_t
check_str_to_uint64_n_all_chars (void)
{
- static const size_t n_checks = 256; /* from 0 to 255 */
- int c_failed[n_checks];
+ int c_failed[256]; /* from 0 to 255 */
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
size_t t_failed = 0;
size_t j;
@@ -1525,8 +1525,8 @@ check_str_to_uint64_n_overflow (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_ovflw) / sizeof(str_ovflw[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_ovflw) / sizeof(str_ovflw[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1594,8 +1594,8 @@ check_str_to_uint64_n_no_val (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_no_num) / sizeof(str_no_num[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1662,9 +1662,9 @@ check_strx_to_uint32_valid (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(xdstrs_w_values)
- / sizeof(xdstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(xdstrs_w_values)
+ / sizeof(xdstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1733,8 +1733,8 @@ check_strx_to_uint32_valid (void)
static size_t
check_strx_to_uint32_all_chars (void)
{
- static const size_t n_checks = 256; /* from 0 to 255 */
- int c_failed[n_checks];
+ int c_failed[256]; /* from 0 to 255 */
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
size_t t_failed = 0;
size_t j;
@@ -1808,10 +1808,10 @@ check_strx_to_uint32_overflow (void)
size_t t_failed = 0;
size_t i, j;
static const size_t n_checks1 = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
- static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
- + sizeof(xdstrs_w_values)
- / sizeof(xdstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
+ + sizeof(xdstrs_w_values)
+ / sizeof(xdstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1883,8 +1883,8 @@ check_strx_to_uint32_no_val (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_no_num) / sizeof(str_no_num[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -1942,9 +1942,9 @@ check_strx_to_uint32_n_valid (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(xdstrs_w_values)
- / sizeof(xdstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(xdstrs_w_values)
+ / sizeof(xdstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2017,8 +2017,8 @@ check_strx_to_uint32_n_valid (void)
static size_t
check_strx_to_uint32_n_all_chars (void)
{
- static const size_t n_checks = 256; /* from 0 to 255 */
- int c_failed[n_checks];
+ int c_failed[256]; /* from 0 to 255 */
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
size_t t_failed = 0;
size_t j;
@@ -2102,10 +2102,10 @@ check_strx_to_uint32_n_overflow (void)
size_t t_failed = 0;
size_t i, j;
static const size_t n_checks1 = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
- static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
- + sizeof(xdstrs_w_values)
- / sizeof(xdstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(strx_ovflw) / sizeof(strx_ovflw[0])
+ + sizeof(xdstrs_w_values)
+ / sizeof(xdstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2203,8 +2203,8 @@ check_strx_to_uint32_n_no_val (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_no_num) / sizeof(str_no_num[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2272,9 +2272,9 @@ check_strx_to_uint64_valid (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(xdstrs_w_values)
- / sizeof(xdstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(xdstrs_w_values)
+ / sizeof(xdstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2339,8 +2339,8 @@ check_strx_to_uint64_valid (void)
static size_t
check_strx_to_uint64_all_chars (void)
{
- static const size_t n_checks = 256; /* from 0 to 255 */
- int c_failed[n_checks];
+ int c_failed[256]; /* from 0 to 255 */
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
size_t t_failed = 0;
size_t j;
@@ -2412,8 +2412,8 @@ check_strx_to_uint64_overflow (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(strx_ovflw) / sizeof(strx_ovflw[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2470,8 +2470,8 @@ check_strx_to_uint64_no_val (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_no_num) / sizeof(str_no_num[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2599,8 +2599,8 @@ check_strx_to_uint64_n_valid (void)
static size_t
check_strx_to_uint64_n_all_chars (void)
{
- static const size_t n_checks = 256; /* from 0 to 255 */
- int c_failed[n_checks];
+ int c_failed[256]; /* from 0 to 255 */
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
size_t t_failed = 0;
size_t j;
@@ -2683,8 +2683,8 @@ check_strx_to_uint64_n_overflow (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(strx_ovflw) / sizeof(strx_ovflw[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(strx_ovflw) / sizeof(strx_ovflw[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -2753,8 +2753,8 @@ check_strx_to_uint64_n_no_val (void)
{
size_t t_failed = 0;
size_t i, j;
- static const size_t n_checks = sizeof(str_no_num) / sizeof(str_no_num[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(str_no_num) / sizeof(str_no_num[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -3173,9 +3173,9 @@ check_str_from_uint16 (void)
"-@=sd#+&(pdiren456qwe#@C3S!DAS45AOIPUQWESAdFzxcv1s*()&#$%34`"
"32452d098poiden45SADFFDA3S4D3SDFdfgsdfgsSADFzxdvs$*()द`"
"adsf##$$@&*^%*^&56qwe#3C@S!DAScFAOIP$#%#$Ad1zs3v1$*()ӌ`";
- static const size_t n_checks = sizeof(dstrs_w_values)
- / sizeof(dstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(dstrs_w_values)
+ / sizeof(dstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -3298,9 +3298,9 @@ check_str_from_uint64 (void)
"-@=sd#+&(pdirenDSFGSe#@C&S!DAS*!AOIPUQWESAdFzxcvSs*()&#$%KH`"
"32452d098poiden45SADFFDA3S4D3SDFdfgsdfgsSADFzxdvs$*()द`"
"adsf##$$@&*^%*^&56qwe#3C@S!DAScFAOIP$#%#$Ad1zs3v1$*()ӌ`";
- static const size_t n_checks = sizeof(dstrs_w_values)
- / sizeof(dstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(dstrs_w_values)
+ / sizeof(dstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
@@ -3420,9 +3420,9 @@ check_strx_from_uint32 (void)
"jrlkjssfhjfvrjntJHLJ$@%$#adsfdkj;k$##$%#$%FGDF%$#^FDFG%$#$D`"
";skjdhjflsdkjhdjfalskdjhdfalkjdhf$%##%$$#%FSDGFSDDGDFSSDSDF`"
"#5#$%#$#$DFSFDDFSGSDFSDF354FDDSGFDFfdssfddfswqemn,.zxih,.sx`";
- static const size_t n_checks = sizeof(xdstrs_w_values)
- / sizeof(xdstrs_w_values[0]);
- int c_failed[n_checks];
+ int c_failed[sizeof(xdstrs_w_values)
+ / sizeof(xdstrs_w_values[0])];
+ static const size_t n_checks = sizeof(c_failed) / sizeof(c_failed[0]);
memset (c_failed, 0, sizeof(c_failed));
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (29ff7c68 -> 977d01df), gnunet, 2022/06/14
- [libmicrohttpd] 02/05: websocket_threaded_example: minor fixes, gnunet, 2022/06/14
- [libmicrohttpd] 04/05: test_str: made test compatible with non-VLA compilers,
gnunet <=
- [libmicrohttpd] 01/05: mhd_str: fixed doxy, updated copyright years, gnunet, 2022/06/14
- [libmicrohttpd] 03/05: test_helpers: fixed doxy, gnunet, 2022/06/14
- [libmicrohttpd] 05/05: src/microhttpd/test_*: fixed more compiler warnings, gnunet, 2022/06/14