From: Uwe Hermann Date: Fri, 21 Jul 2017 07:03:05 +0000 (+0200) Subject: drivers: Shorten some unnecessarily long arrays. X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=f8195cb2da3268c89e24071ed32ab9acdded5bc0 drivers: Shorten some unnecessarily long arrays. --- diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c index 1e462a17..b03a9e98 100644 --- a/src/hardware/agilent-dmm/api.c +++ b/src/hardware/agilent-dmm/api.c @@ -51,11 +51,7 @@ static const uint64_t samplerates[] = { }; static const char *data_sources[] = { - "Live", - "Log-Hand", - "Log-Trig", - "Log-Auto", - "Log-Export", + "Live", "Log-Hand", "Log-Trig", "Log-Auto", "Log-Export", }; extern const struct agdmm_job agdmm_jobs_live[]; diff --git a/src/hardware/ftdi-la/api.c b/src/hardware/ftdi-la/api.c index 1341730b..15472f82 100644 --- a/src/hardware/ftdi-la/api.c +++ b/src/hardware/ftdi-la/api.c @@ -50,14 +50,8 @@ static const struct ftdi_chip_desc ft2232h_desc = { .product = 0x6010, .samplerate_div = 20, .channel_names = { - "ADBUS0", - "ADBUS1", - "ADBUS2", - "ADBUS3", - "ADBUS4", - "ADBUS5", - "ADBUS6", - "ADBUS7", + "ADBUS0", "ADBUS1", "ADBUS2", "ADBUS3", + "ADBUS4", "ADBUS5", "ADBUS6", "ADBUS7", /* TODO: BDBUS[0..7] channels. */ NULL } @@ -68,14 +62,7 @@ static const struct ftdi_chip_desc ft232r_desc = { .product = 0x6001, .samplerate_div = 30, .channel_names = { - "TXD", - "RXD", - "RTS#", - "CTS#", - "DTR#", - "DSR#", - "DCD#", - "RI#", + "TXD", "RXD", "RTS#", "CTS#", "DTR#", "DSR#", "DCD#", "RI#", NULL } }; diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index 47563d3e..fb7fecb2 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -91,71 +91,24 @@ static const char *scope_trigger_slopes[] = { }; static const char *compact2_trigger_sources[] = { - "CH1", - "CH2", - "LINE", - "EXT", - "PATT", - "BUS1", - "BUS2", - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", + "CH1", "CH2", + "LINE", "EXT", "PATT", "BUS1", "BUS2", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", NULL, }; static const char *compact4_trigger_sources[] = { - "CH1", - "CH2", - "CH3", - "CH4", - "LINE", - "EXT", - "PATT", - "BUS1", - "BUS2", - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", + "CH1", "CH2", "CH3", "CH4", + "LINE", "EXT", "PATT", "BUS1", "BUS2", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", NULL, }; static const char *compact4_dig16_trigger_sources[] = { - "CH1", - "CH2", - "CH3", - "CH4", - "LINE", - "EXT", - "PATT", - "BUS1", - "BUS2", - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", - "D8", - "D9", - "D10", - "D11", - "D12", - "D13", - "D14", - "D15", + "CH1", "CH2", "CH3", "CH4", + "LINE", "EXT", "PATT", "BUS1", "BUS2", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", + "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15", NULL, }; @@ -219,29 +172,12 @@ static const uint64_t vdivs[][2] = { }; static const char *scope_analog_channel_names[] = { - "CH1", - "CH2", - "CH3", - "CH4", + "CH1", "CH2", "CH3", "CH4", }; static const char *scope_digital_channel_names[] = { - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", - "D8", - "D9", - "D10", - "D11", - "D12", - "D13", - "D14", - "D15", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", + "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15", }; static const struct scope_config scope_models[] = { diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index f00d8b6c..651c0e61 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -144,21 +144,16 @@ static const uint64_t vdivs[][2] = { }; static const char *trigger_sources[] = { - "CH1", - "CH2", - "EXT", + "CH1", "CH2", "EXT", /* TODO: forced */ }; static const char *trigger_slopes[] = { - "r", - "f", + "r", "f", }; static const char *coupling[] = { - "AC", - "DC", - "GND", + "AC", "DC", "GND", }; static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c index dc651325..8f2bea58 100644 --- a/src/hardware/kecheng-kc-330b/api.c +++ b/src/hardware/kecheng-kc-330b/api.c @@ -50,18 +50,15 @@ SR_PRIV const uint64_t kecheng_kc_330b_sample_intervals[][2] = { }; static const char *weight_freq[] = { - "A", - "C", + "A", "C", }; static const char *weight_time[] = { - "F", - "S", + "F", "S", }; static const char *data_sources[] = { - "Live", - "Memory", + "Live", "Memory", }; static int scan_kecheng(struct sr_dev_driver *di, diff --git a/src/hardware/lecroy-xstream/protocol.c b/src/hardware/lecroy-xstream/protocol.c index ce9b24d5..7aebdc59 100644 --- a/src/hardware/lecroy-xstream/protocol.c +++ b/src/hardware/lecroy-xstream/protocol.c @@ -84,19 +84,11 @@ static const char *coupling_options[] = { }; static const char *scope_trigger_slopes[] = { - "POS", - "NEG", - NULL, + "POS", "NEG", NULL, }; static const char *trigger_sources[] = { - "C1", - "C2", - "C3", - "C4", - "LINE", - "EXT", - NULL, + "C1", "C2", "C3", "C4", "LINE", "EXT", NULL, }; static const struct sr_rational timebases[] = { @@ -170,10 +162,7 @@ static const struct sr_rational vdivs[] = { }; static const char *scope_analog_channel_names[] = { - "CH1", - "CH2", - "CH3", - "CH4", + "CH1", "CH2", "CH3", "CH4", }; static const struct scope_config scope_models[] = { diff --git a/src/hardware/link-mso19/protocol.h b/src/hardware/link-mso19/protocol.h index 5097d053..d6eb872b 100644 --- a/src/hardware/link-mso19/protocol.h +++ b/src/hardware/link-mso19/protocol.h @@ -200,12 +200,7 @@ static const struct rate_map rate_map[] = { /* FIXME: Determine corresponding voltages */ static const uint16_t la_threshold_map[] = { - 0x8600, - 0x8770, - 0x88ff, - 0x8c70, - 0x8eff, - 0x8fff, + 0x8600, 0x8770, 0x88ff, 0x8c70, 0x8eff, 0x8fff, }; #endif diff --git a/src/hardware/pce-322a/api.c b/src/hardware/pce-322a/api.c index 1ab19a8d..04a8cfba 100644 --- a/src/hardware/pce-322a/api.c +++ b/src/hardware/pce-322a/api.c @@ -43,13 +43,11 @@ static const uint32_t devopts[] = { }; static const char *weight_freq[] = { - "A", - "C", + "A", "C", }; static const char *weight_time[] = { - "F", - "S", + "F", "S", }; static const uint64_t meas_ranges[][2] = { @@ -60,8 +58,7 @@ static const uint64_t meas_ranges[][2] = { }; static const char *data_sources[] = { - "Live", - "Memory", + "Live", "Memory", }; static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index 272059ae..740e11f7 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -127,52 +127,22 @@ static const uint64_t vdivs[][2] = { }; static const char *trigger_sources[] = { - "CH1", - "CH2", - "CH3", - "CH4", - "EXT", - "AC Line", - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", - "D8", - "D9", - "D10", - "D11", - "D12", - "D13", - "D14", - "D15", + "CH1", "CH2", "CH3", "CH4", + "EXT", "AC Line", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", + "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15", }; static const char *trigger_slopes[] = { - "r", - "f", + "r", "f", }; static const char *coupling[] = { - "AC", - "DC", - "GND", + "AC", "DC", "GND", }; static const uint64_t probe_factor[] = { - 1, - 2, - 5, - 10, - 20, - 50, - 100, - 200, - 500, - 1000, + 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, }; /* Do not change the order of entries */ diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index c6d2ae60..f5124993 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -40,8 +40,7 @@ static const char *channel_names[] = { }; static const char *data_sources[] = { - "Live", - "Memory", + "Live", "Memory", }; static GSList *scan(struct sr_dev_driver *di, GSList *options) diff --git a/src/hardware/yokogawa-dlm/protocol.c b/src/hardware/yokogawa-dlm/protocol.c index 1937a71c..e40066b0 100644 --- a/src/hardware/yokogawa-dlm/protocol.c +++ b/src/hardware/yokogawa-dlm/protocol.c @@ -23,44 +23,26 @@ #include "protocol.h" static const char *coupling_options[] = { - "AC", - "DC", - "DC50", - "GND", + "AC", "DC", "DC50", "GND", NULL, }; static const char *trigger_sources_2ch[] = { - "1", - "2", - "LINE", - "EXT", + "1", "2", "LINE", "EXT", NULL, }; /* TODO: Is BITx handled correctly or is Dx required? */ static const char *trigger_sources_4ch[] = { - "1", - "2", - "3", - "4", - "LINE", - "EXT", - "BIT1", - "BIT2", - "BIT3", - "BIT4", - "BIT5", - "BIT6", - "BIT7", - "BIT8", + "1", "2", "3", "4", + "LINE", "EXT", "BIT1", + "BIT2", "BIT3", "BIT4", "BIT5", "BIT6", "BIT7", "BIT8", NULL, }; /* Note: Values must correlate to the trigger_slopes values. */ const char *dlm_trigger_slopes[3] = { - "r", - "f", + "r", "f", NULL, }; @@ -130,56 +112,18 @@ const uint64_t dlm_vdivs[17][2] = { }; static const char *scope_analog_channel_names[] = { - "1", - "2", - "3", - "4", + "1", "2", "3", "4", }; static const char *scope_digital_channel_names_8[] = { - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", }; static const char *scope_digital_channel_names_32[] = { - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "B0", - "B1", - "B2", - "B3", - "B4", - "B5", - "B6", - "B7", - "C0", - "C1", - "C2", - "C3", - "C4", - "C5", - "C6", - "C7", - "D0", - "D1", - "D2", - "D3", - "D4", - "D5", - "D6", - "D7", + "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", + "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", + "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", }; static const struct scope_config scope_models[] = {