From: Andreas Sandberg Date: Sun, 13 Oct 2024 15:52:04 +0000 (+0100) Subject: fluke-dmm: Declare tables as constants X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=562aacd44ca3a63dfa1112fe72cb23a2f0b96937;p=libsigrok.git fluke-dmm: Declare tables as constants There is no need to modify the various lookup tables at runtime. Declare these as const to avoid surprises. Signed-off-by: Andreas Sandberg --- diff --git a/src/hardware/fluke-dmm/fluke-28x.c b/src/hardware/fluke-dmm/fluke-28x.c index ec8678dc..e4383fbe 100644 --- a/src/hardware/fluke-dmm/fluke-28x.c +++ b/src/hardware/fluke-dmm/fluke-28x.c @@ -41,7 +41,7 @@ struct state_mapping { enum measurement_state state; }; -static struct state_mapping state_map[] = { +static const struct state_mapping state_map[] = { { "INVALID", MEAS_S_INVALID }, { "NORMAL", MEAS_S_NORMAL }, { "BLANK", MEAS_S_BLANK }, @@ -69,7 +69,7 @@ struct attribute_mapping { enum measurement_attribute attribute; }; -static struct attribute_mapping attribute_map[] = { +static const struct attribute_mapping attribute_map[] = { { "NONE", MEAS_A_NONE }, { "OPEN_CIRCUIT", MEAS_A_OPEN_CIRCUIT }, { "SHORT_CIRCUIT", MEAS_A_SHORT_CIRCUIT }, @@ -88,7 +88,7 @@ struct unit_mapping { enum sr_mqflag mqflags; }; -static struct unit_mapping unit_map[] = { +static const struct unit_mapping unit_map[] = { { "VDC", SR_MQ_VOLTAGE, SR_UNIT_VOLT, SR_MQFLAG_DC }, { "VAC", SR_MQ_VOLTAGE, SR_UNIT_VOLT, SR_MQFLAG_AC | SR_MQFLAG_RMS }, { "ADC", SR_MQ_CURRENT, SR_UNIT_AMPERE, SR_MQFLAG_DC },