]> sigrok.org Git - libsigrok.git/commitdiff
drivers: Shorten some unnecessarily long arrays.
authorUwe Hermann <redacted>
Fri, 21 Jul 2017 07:03:05 +0000 (09:03 +0200)
committerUwe Hermann <redacted>
Fri, 21 Jul 2017 15:06:40 +0000 (17:06 +0200)
src/hardware/agilent-dmm/api.c
src/hardware/ftdi-la/api.c
src/hardware/hameg-hmo/protocol.c
src/hardware/hantek-dso/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/lecroy-xstream/protocol.c
src/hardware/link-mso19/protocol.h
src/hardware/pce-322a/api.c
src/hardware/rigol-ds/api.c
src/hardware/uni-t-ut32x/api.c
src/hardware/yokogawa-dlm/protocol.c

index 1e462a170f6bab8019d3965950c9f7df4171d953..b03a9e986508332c91afbfbbe8f078745c273f00 100644 (file)
@@ -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[];
index 1341730bf36dcfc7ab574a260c972ad6058b99ad..15472f8262250b5ba48f5231c696e333d19aaa47 100644 (file)
@@ -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
        }
 };
index 47563d3e92f0ab2efc6437f56264bc2bd7c5d057..fb7fecb271f2fcef0c90f5dc80ded8df221176c3 100644 (file)
@@ -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[] = {
index f00d8b6c9bbb248eb065f06651434b3e9d4a6fd3..651c0e6125ee8dba068c85be9308ca5d7c7c5c1a 100644 (file)
@@ -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)
index dc6513252e0af051a6433849fb3b1eadbdb4e391..8f2bea58cefc1e195926783fd2ca215bc6dc517a 100644 (file)
@@ -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,
index ce9b24d5acb168d5b3d4527a7d25be5d288f25f2..7aebdc59004e8b940de06e39686b079f10362022 100644 (file)
@@ -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[] = {
index 5097d053d4b8ead07182e1de37ac71fb866da6d3..d6eb872b8a9d14f7dd2f0aef89e5e7524cbb4907 100644 (file)
@@ -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
index 1ab19a8d6f212e2a76794562ffe84cfb014cc6d1..04a8cfba407c98ad4f2a8c6757c6cbc88f6f20e9 100644 (file)
@@ -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)
index 272059aeeb97ebd68b00b25b33dfa6f169e31ec8..740e11f7f1f13dac681f2e3f83d7a24f842d94a5 100644 (file)
@@ -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 */
index c6d2ae6018cbdce0c0dbfc79c6c9e5fe7accb6af..f51249931c211360ffd755a00bb6178c68d70c37 100644 (file)
@@ -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)
index 1937a71c996929d262a1cb4161e15ce1c37cc64a..e40066b0c0eeb9ed16bfc9e03f012c181ba629c3 100644 (file)
 #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[] = {