From: Uwe Hermann Date: Tue, 31 Dec 2013 18:20:51 +0000 (+0100) Subject: es519xx.c: Fix a few compiler warnings (clang). X-Git-Tag: libsigrok-0.3.0~357 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=35b904a7924472522b1675427e9a630c2189a94f;p=libsigrok.git es519xx.c: Fix a few compiler warnings (clang). CC libsigrok_hw_common_dmm_la-es519xx.lo es519xx.c:632:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ es519xx.c:659:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ es519xx.c:688:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ es519xx.c:717:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ es519xx.c:746:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ es519xx.c:773:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ es519xx.c:800:33: warning: missing field 'is_voltage' initializer [-Wmissing-field-initializers] struct es519xx_info info = { 0 }; ^ 7 warnings generated. --- diff --git a/hardware/common/dmm/es519xx.c b/hardware/common/dmm/es519xx.c index 510fd4f3..5861a6fe 100644 --- a/hardware/common/dmm/es519xx.c +++ b/hardware/common/dmm/es519xx.c @@ -629,8 +629,9 @@ static int sr_es519xx_parse(const uint8_t *buf, float *floatval, */ SR_PRIV gboolean sr_es519xx_2400_11b_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 2400; info.packet_size = 11; @@ -656,8 +657,9 @@ SR_PRIV int sr_es519xx_2400_11b_parse(const uint8_t *buf, float *floatval, */ SR_PRIV gboolean sr_es519xx_2400_11b_altfn_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 2400; info.packet_size = 11; info.alt_functions = TRUE; @@ -685,8 +687,9 @@ SR_PRIV int sr_es519xx_2400_11b_altfn_parse(const uint8_t *buf, */ SR_PRIV gboolean sr_es519xx_19200_11b_5digits_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 19200; info.packet_size = 11; info.fivedigits = TRUE; @@ -714,8 +717,9 @@ SR_PRIV int sr_es519xx_19200_11b_5digits_parse(const uint8_t *buf, */ SR_PRIV gboolean sr_es519xx_19200_11b_clamp_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 19200; info.packet_size = 11; info.clampmeter = TRUE; @@ -743,8 +747,9 @@ SR_PRIV int sr_es519xx_19200_11b_clamp_parse(const uint8_t *buf, */ SR_PRIV gboolean sr_es519xx_19200_11b_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 19200; info.packet_size = 11; @@ -770,8 +775,9 @@ SR_PRIV int sr_es519xx_19200_11b_parse(const uint8_t *buf, float *floatval, */ SR_PRIV gboolean sr_es519xx_19200_14b_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 19200; info.packet_size = 14; @@ -797,8 +803,9 @@ SR_PRIV int sr_es519xx_19200_14b_parse(const uint8_t *buf, float *floatval, */ SR_PRIV gboolean sr_es519xx_19200_14b_sel_lpf_packet_valid(const uint8_t *buf) { - struct es519xx_info info = { 0 }; + struct es519xx_info info; + memset(&info, 0, sizeof(struct es519xx_info)); info.baudrate = 19200; info.packet_size = 14; info.selectable_lpf = TRUE;