Shorten probe_names[] arrays everywhere.

Also, NULL-terminate all of them.
This commit is contained in:
Uwe Hermann 2012-12-26 00:12:52 +01:00
parent df36acb36a
commit 7869340103
12 changed files with 17 additions and 96 deletions

View File

@ -41,8 +41,7 @@ static const int hwcaps[] = {
}; };
static const char *probe_names[] = { static const char *probe_names[] = {
"Channel 0", "Channel 0", "Channel 1",
"Channel 1",
NULL, NULL,
}; };

View File

@ -64,22 +64,8 @@ static const uint64_t supported_samplerates[] = {
* (the cable has two additional GND pins, and a TI and TO pin) * (the cable has two additional GND pins, and a TI and TO pin)
*/ */
static const char *probe_names[NUM_PROBES + 1] = { static const char *probe_names[NUM_PROBES + 1] = {
"1", "1", "2", "3", "4", "5", "6", "7", "8",
"2", "9", "10", "11", "12", "13", "14", "15", "16",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
NULL, NULL,
}; };

View File

@ -26,14 +26,7 @@
/* Probes are numbered 0-7. */ /* Probes are numbered 0-7. */
SR_PRIV const char *probe_names[NUM_PROBES + 1] = { SR_PRIV const char *probe_names[NUM_PROBES + 1] = {
"0", "0", "1", "2", "3", "4", "5", "6", "7",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
NULL, NULL,
}; };

View File

@ -111,14 +111,7 @@ static const char *pattern_strings[] = {
/* We name the probes 0-7 on our demo driver. */ /* We name the probes 0-7 on our demo driver. */
static const char *probe_names[NUM_PROBES + 1] = { static const char *probe_names[NUM_PROBES + 1] = {
"0", "0", "1", "2", "3", "4", "5", "6", "7",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
NULL, NULL,
}; };

View File

@ -93,7 +93,8 @@ static const int hwcaps[] = {
static const char *probe_names[] = { static const char *probe_names[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15", NULL, "8", "9", "10", "11", "12", "13", "14", "15",
NULL,
}; };
static const uint64_t supported_samplerates[] = { static const uint64_t supported_samplerates[] = {

View File

@ -53,8 +53,7 @@ static const int hwcaps[] = {
}; };
static const char *probe_names[] = { static const char *probe_names[] = {
"CH1", "CH1", "CH2",
"CH2",
NULL, NULL,
}; };

View File

@ -42,9 +42,9 @@ static const int hwcaps[] = {
static const char *probe_names[] = { static const char *probe_names[] = {
"P1", "P1",
NULL,
}; };
/* Properly close and free all devices. */ /* Properly close and free all devices. */
static int clear_instances(void) static int clear_instances(void)
{ {

View File

@ -54,14 +54,7 @@ static const int hwcaps[] = {
* See also: http://www.linkinstruments.com/images/mso19_1113.gif * See also: http://www.linkinstruments.com/images/mso19_1113.gif
*/ */
static const char *probe_names[NUM_PROBES + 1] = { static const char *probe_names[NUM_PROBES + 1] = {
"0", "0", "1", "2", "3", "4", "5", "6", "7",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
NULL, NULL,
}; };

View File

@ -92,8 +92,7 @@ static const struct sr_rational timebases[] = {
}; };
static const char *probe_names[] = { static const char *probe_names[] = {
"CHA", "CHA", "CHB",
"CHB",
NULL, NULL,
}; };

View File

@ -32,38 +32,9 @@ static const int hwcaps[] = {
/* Probes are numbered 0-31 (on the PCB silkscreen). */ /* Probes are numbered 0-31 (on the PCB silkscreen). */
SR_PRIV const char *ols_probe_names[NUM_PROBES + 1] = { SR_PRIV const char *ols_probe_names[NUM_PROBES + 1] = {
"0", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
"1", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23",
"2", "24", "25", "26", "27", "28", "29", "30", "31",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
NULL, NULL,
}; };

View File

@ -46,6 +46,7 @@ static const int hwcaps[] = {
static const char *probe_names[] = { static const char *probe_names[] = {
"P1", "P1",
NULL,
}; };
/* Properly close and free all devices. */ /* Properly close and free all devices. */

View File

@ -85,22 +85,8 @@ static const int hwcaps[] = {
* We currently ignore other untested/unsupported devices here. * We currently ignore other untested/unsupported devices here.
*/ */
static const char *probe_names[NUM_PROBES + 1] = { static const char *probe_names[NUM_PROBES + 1] = {
"A0", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
"A1", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7",
"A2",
"A3",
"A4",
"A5",
"A6",
"A7",
"B0",
"B1",
"B2",
"B3",
"B4",
"B5",
"B6",
"B7",
NULL, NULL,
}; };