m) Fix: compile test_rechist error (#425)

error: 'for' loop initial declarations are only allowed in C99 mode

Co-authored-by: wangfuyu <ivanfywang@gmail.com>
This commit is contained in:
wangfuyu 2022-09-29 21:04:15 +08:00 committed by GitHub
parent a5b89b62b5
commit 5c669eea50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,31 +205,32 @@ test6 (void)
lsquic_rechist_t rechist; lsquic_rechist_t rechist;
char buf[256]; char buf[256];
long int time = 12087061905875; long int time = 12087061905875;
unsigned i;
lsquic_rechist_init(&rechist, 0, 0); lsquic_rechist_init(&rechist, 0, 0);
for (int i = 0; i <= 3; i++) for (i = 0; i <= 3; i++)
lsquic_rechist_received(&rechist, i, (time += (i*10))); lsquic_rechist_received(&rechist, i, (time += (i * 10)));
lsquic_rechist_stop_wait(&rechist, 2); lsquic_rechist_stop_wait(&rechist, 2);
lsquic_rechist_received(&rechist, 4, (time += 10)); lsquic_rechist_received(&rechist, 4, (time += 10));
lsquic_rechist_stop_wait(&rechist, 3); lsquic_rechist_stop_wait(&rechist, 3);
lsquic_rechist_received(&rechist, 5, (time += 10)); lsquic_rechist_received(&rechist, 5, (time += 10));
lsquic_rechist_stop_wait(&rechist, 3); lsquic_rechist_stop_wait(&rechist, 3);
lsquic_rechist_received(&rechist, 6, (time += 10)); lsquic_rechist_received(&rechist, 6, (time += 10));
lsquic_rechist_stop_wait(&rechist, 9); lsquic_rechist_stop_wait(&rechist, 9);
lsquic_rechist_received(&rechist, 7, (time += 10)); lsquic_rechist_received(&rechist, 7, (time += 10));
lsquic_rechist_received(&rechist, 8, (time += 10)); lsquic_rechist_received(&rechist, 8, (time += 10));
lsquic_rechist_received(&rechist, 9, (time += 10)); lsquic_rechist_received(&rechist, 9, (time += 10));
rechist2str(&rechist, buf, sizeof(buf)); rechist2str(&rechist, buf, sizeof(buf));
lsquic_rechist_cleanup(&rechist); lsquic_rechist_cleanup(&rechist);
} }