core: Allow for older compilers.

* tests/run-verify.c (main): Remove C99-only syntax.
* tests/run-threaded.c (start_keylistings): Ditto.
--

Older gcc's do not grok this and there is no real need for it.

  run-verify.c:324: error: ‘for’ loop initial declarations are only
  allowed in C99 mode
  run-verify.c:324: note: use option -std=c99 or -std=gnu99 to compile
  your code

Reported-by: Lars Hecking
This commit is contained in:
Werner Koch 2021-05-12 08:47:40 +02:00
parent 88db69e1a9
commit aa98081356
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 4 additions and 2 deletions

View File

@ -627,6 +627,7 @@ void
start_keylistings (void) start_keylistings (void)
{ {
static struct keylist_args_s args[4]; static struct keylist_args_s args[4];
int i;
args[0].proto = GPGME_PROTOCOL_OpenPGP; args[0].proto = GPGME_PROTOCOL_OpenPGP;
args[0].secret = 0; args[0].secret = 0;
@ -640,7 +641,7 @@ start_keylistings (void)
args[3].proto = GPGME_PROTOCOL_CMS; args[3].proto = GPGME_PROTOCOL_CMS;
args[3].secret = 1; args[3].secret = 1;
for (int i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
thread_cnt--; thread_cnt--;
create_thread (do_keylist, &args[i]); create_thread (do_keylist, &args[i]);

View File

@ -251,6 +251,7 @@ main (int argc, char **argv)
int auto_key_retrieve = 0; int auto_key_retrieve = 0;
int auto_key_import = 0; int auto_key_import = 0;
int repeats = 1; int repeats = 1;
int i;
if (argc) if (argc)
{ argc--; argv++; } { argc--; argv++; }
@ -321,7 +322,7 @@ main (int argc, char **argv)
init_gpgme (protocol); init_gpgme (protocol);
for (int i = 0; i < repeats; i++) for (i = 0; i < repeats; i++)
{ {
gpgme_error_t err; gpgme_error_t err;
gpgme_ctx_t ctx; gpgme_ctx_t ctx;