From: Uwe Hermann Date: Fri, 21 Jul 2017 06:44:20 +0000 (+0200) Subject: rigol-ds: Drop two unneeded #defines. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=396cdca0c3edbf619a9f03379486bbedc56cfdac;p=libsigrok.git rigol-ds: Drop two unneeded #defines. --- diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index 72f41b4c..dd535eda 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -126,9 +126,6 @@ static const uint64_t vdivs[][2] = { { 100, 1 }, }; -#define NUM_TIMEBASE ARRAY_SIZE(timebases) -#define NUM_VDIV ARRAY_SIZE(vdivs) - static const char *trigger_sources[] = { "CH1", "CH2", @@ -397,18 +394,18 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) devc->digital_group); } - for (i = 0; i < NUM_TIMEBASE; i++) { + for (i = 0; i < ARRAY_SIZE(timebases); i++) { if (!memcmp(&devc->model->min_timebase, &timebases[i], sizeof(uint64_t[2]))) devc->timebases = &timebases[i]; if (!memcmp(&devc->model->series->max_timebase, &timebases[i], sizeof(uint64_t[2]))) devc->num_timebases = &timebases[i] - devc->timebases + 1; } - for (i = 0; i < NUM_VDIV; i++) { + for (i = 0; i < ARRAY_SIZE(vdivs); i++) { if (!memcmp(&devc->model->series->min_vdiv, &vdivs[i], sizeof(uint64_t[2]))) { devc->vdivs = &vdivs[i]; - devc->num_vdivs = NUM_VDIV - i; + devc->num_vdivs = ARRAY_SIZE(vdivs) - i; } }