From 8465a76fd29fff03cccad88c5fd9657723588f86 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 16 Jun 2019 23:14:46 +0100 Subject: [PATCH] Ensure compilation works with a pre C11 compiler --- icom/icom.c | 5 +++-- tests/dumpcaps.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/icom/icom.c b/icom/icom.c index a3a666ab8..0b4154bd6 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -1692,9 +1692,10 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_AGC: if (priv_caps->agc_levels_present) { - int found = 0; + int found = 0; + int i; - for (int i = 0; i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level >= 0; i++) { + for (i = 0; i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level >= 0; i++) { if (priv_caps->agc_levels[i].icom_level == icom_val) { val->i = priv_caps->agc_levels[i].level; found = 1; diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 364ace842..858a3298f 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -723,6 +723,7 @@ int dumpcaps(RIG *rig, FILE *fout) static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) { + int i; fprintf((FILE *)ptr, "\t%s\n", cfp->name); fprintf((FILE *)ptr, "\t\tType: %s\n", get_rig_conf_type(cfp->type)); fprintf((FILE *)ptr, "\t\tDefault: %s\n", cfp->dflt != NULL ? cfp->dflt : ""); @@ -736,7 +737,7 @@ static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) case RIG_CONF_COMBO: fprintf((FILE *)ptr, "\t\tValues:"); if (cfp->u.c.combostr != NULL) { - for (int i = 0; i < RIG_COMBO_MAX && cfp->u.c.combostr[i] != NULL; i++) { + for (i = 0; i < RIG_COMBO_MAX && cfp->u.c.combostr[i] != NULL; i++) { fprintf((FILE *)ptr, " %d=\"%s\"", i, cfp->u.c.combostr[i]); } }