From: Gerhard Sittig Date: Wed, 22 Dec 2021 12:51:02 +0000 (+0100) Subject: rdtech-tc/um: silence "missing field identifier" compiler warning X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=0988d4ae2d7a47258b1ec3278381a973aa12831e;ds=sidebyside rdtech-tc/um: silence "missing field identifier" compiler warning There are rather conservative build setups which complain about missing fields in initializers. Rephrase the profile sentinels in the rdtech-tc and rdtech-um drivers for maximum portability across toolchain setups. src/hardware/rdtech-um/protocol.c:45:10: warning: missing field 'spec' initializer [-Wmissing-field-initializers] { NULL, }, ^ --- diff --git a/src/hardware/rdtech-tc/protocol.c b/src/hardware/rdtech-tc/protocol.c index 456681ea..3b94890d 100644 --- a/src/hardware/rdtech-tc/protocol.c +++ b/src/hardware/rdtech-tc/protocol.c @@ -71,7 +71,7 @@ static const struct binary_analog_channel rdtech_tc_channels[] = { { "D-", { 64 + 36, BVT_LE_UINT32, 1e-2, }, 2, SR_MQ_VOLTAGE, SR_UNIT_VOLT }, { "E0", { 64 + 12, BVT_LE_UINT32, 1e-3, }, 3, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR }, { "E1", { 64 + 20, BVT_LE_UINT32, 1e-3, }, 3, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR }, - { NULL, }, + ALL_ZERO, }; static int check_pac_crc(uint8_t *data) diff --git a/src/hardware/rdtech-um/protocol.c b/src/hardware/rdtech-um/protocol.c index 25bad0df..04de7687 100644 --- a/src/hardware/rdtech-um/protocol.c +++ b/src/hardware/rdtech-um/protocol.c @@ -42,7 +42,7 @@ static const struct binary_analog_channel rdtech_default_channels[] = { { "T", { 10, BVT_BE_UINT16, 1.0, }, 0, SR_MQ_TEMPERATURE, SR_UNIT_CELSIUS }, /* Threshold-based recording (mWh) */ { "E", { 106, BVT_BE_UINT32, 0.001, }, 3, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR }, - { NULL, }, + ALL_ZERO, }; static const struct binary_analog_channel rdtech_um25c_channels[] = { @@ -53,7 +53,7 @@ static const struct binary_analog_channel rdtech_um25c_channels[] = { { "T", { 10, BVT_BE_UINT16, 1.0, }, 0, SR_MQ_TEMPERATURE, SR_UNIT_CELSIUS }, /* Threshold-based recording (mWh) */ { "E", { 106, BVT_BE_UINT32, 0.001, }, 3, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR }, - { NULL, }, + ALL_ZERO, }; static int poll_csum_fff1(char buf[], int len)