]> sigrok.org Git - libsigrok.git/commitdiff
es519xx.c: Fix a few compiler warnings (clang).
authorUwe Hermann <redacted>
Tue, 31 Dec 2013 18:20:51 +0000 (19:20 +0100)
committerUwe Hermann <redacted>
Tue, 31 Dec 2013 18:20:51 +0000 (19:20 +0100)
  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.

hardware/common/dmm/es519xx.c

index 510fd4f314688bdb405fe604707172c14f8d087a..5861a6feb4eb370354e0694e606a04c17b1f4dfa 100644 (file)
@@ -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;