From: Uwe Hermann Date: Sun, 6 Aug 2017 14:42:35 +0000 (+0200) Subject: drivers: Random whitespace fixes. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8ebad343709aad6ef4d5aa83a2633690ef313de5;p=libsigrok.git drivers: Random whitespace fixes. --- diff --git a/src/hardware/agilent-dmm/protocol.c b/src/hardware/agilent-dmm/protocol.c index 8778c711..23768a6a 100644 --- a/src/hardware/agilent-dmm/protocol.c +++ b/src/hardware/agilent-dmm/protocol.c @@ -77,7 +77,7 @@ static const struct agdmm_job *job_next(struct dev_context *devc) devc->current_job++; if (!job_current(devc)->send) devc->current_job = 0; - } while(job_in_interval(devc) && devc->current_job != current_job); + } while (job_in_interval(devc) && devc->current_job != current_job); return job_current(devc); } @@ -626,7 +626,7 @@ static int recv_conf_u123x(const struct sr_dev_inst *sdi, GMatchInfo *match) } else if (!strcmp(mstr, "DC")) { devc->cur_mqflags[i] |= SR_MQFLAG_DC; } else { - sr_dbg("Unknown first argument '%s'.", mstr); + sr_dbg("Unknown first argument '%s'.", mstr); } g_free(mstr); } else diff --git a/src/hardware/asix-sigma/protocol.c b/src/hardware/asix-sigma/protocol.c index 41c6dc87..e2c34e5c 100644 --- a/src/hardware/asix-sigma/protocol.c +++ b/src/hardware/asix-sigma/protocol.c @@ -78,12 +78,11 @@ static int sigma_write(void *buf, size_t size, struct dev_context *devc) int ret; ret = ftdi_write_data(&devc->ftdic, (unsigned char *)buf, size); - if (ret < 0) { + if (ret < 0) sr_err("ftdi_write_data failed: %s", ftdi_get_error_string(&devc->ftdic)); - } else if ((size_t) ret != size) { + else if ((size_t) ret != size) sr_err("ftdi_write_data did not complete write."); - } return ret; } @@ -646,16 +645,13 @@ SR_PRIV int sigma_convert_trigger(const struct sr_dev_inst *sdi) if (match->match == SR_TRIGGER_ONE) { devc->trigger.simplevalue |= channelbit; devc->trigger.simplemask |= channelbit; - } - else if (match->match == SR_TRIGGER_ZERO) { + } else if (match->match == SR_TRIGGER_ZERO) { devc->trigger.simplevalue &= ~channelbit; devc->trigger.simplemask |= channelbit; - } - else if (match->match == SR_TRIGGER_FALLING) { + } else if (match->match == SR_TRIGGER_FALLING) { devc->trigger.fallingmask |= channelbit; trigger_set++; - } - else if (match->match == SR_TRIGGER_RISING) { + } else if (match->match == SR_TRIGGER_RISING) { devc->trigger.risingmask |= channelbit; trigger_set++; } diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index a6ff339b..17ae5b90 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -310,11 +310,11 @@ static int read_probe_eeprom(unsigned int addr, struct probe_eeprom *eeprom) static int revB_addr_to_num(unsigned int addr) { switch (addr) { - case 0x44: return 5; - case 0x45: return 6; - case 0x42: return 3; - case 0x43: return 4; - default: return addr - 0x3f; + case 0x44: return 5; + case 0x45: return 6; + case 0x42: return 3; + case 0x43: return 4; + default: return addr - 0x3f; } } diff --git a/src/hardware/demo/protocol.c b/src/hardware/demo/protocol.c index 8b89d354..9969abf9 100644 --- a/src/hardware/demo/protocol.c +++ b/src/hardware/demo/protocol.c @@ -273,9 +273,8 @@ static void logic_generator(struct sr_dev_inst *sdi, uint64_t size) break; case PATTERN_INC: for (i = 0; i < size; i++) { - for (j = 0; j < devc->logic_unitsize; j++) { + for (j = 0; j < devc->logic_unitsize; j++) devc->logic_data[i + j] = devc->step; - } devc->step++; } break; diff --git a/src/hardware/gmc-mh-1x-2x/protocol.c b/src/hardware/gmc-mh-1x-2x/protocol.c index 53efdf42..7d06b071 100644 --- a/src/hardware/gmc-mh-1x-2x/protocol.c +++ b/src/hardware/gmc-mh-1x-2x/protocol.c @@ -755,8 +755,7 @@ static void process_msg_inf_10(struct sr_dev_inst *sdi) dgt = bc(devc->buf[5 + cnt]); if (dgt == 11) { /* Empty digit */ dgt = 0; - } - else if (dgt >= 12) { /* Overload */ + } else if (dgt >= 12) { /* Overload */ devc->value = NAN; devc->scale = 0; break; @@ -953,8 +952,7 @@ static int chk_msg14(struct sr_dev_inst *sdi) sr_err("Device: Unknown error code!"); } retc = SR_ERR_ARG; - } - else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) { + } else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) { sr_err("process_msg_14(): byte 1/2 unexpected!"); retc = SR_ERR_ARG; } @@ -1055,11 +1053,9 @@ SR_PRIV int process_msg14(struct sr_dev_inst *sdi) devc->value = NAN; devc->scale = 0; break; - } - else if (dgt == 13) { /* FUSE */ + } else if (dgt == 13) { /* FUSE */ sr_err("FUSE!"); - } - else if (dgt == 14) { /* Function recognition mode, OPEN */ + } else if (dgt == 14) { /* Function recognition mode, OPEN */ sr_info("Function recognition mode, OPEN!"); devc->value = NAN; devc->scale = 0; @@ -1135,8 +1131,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data) process_msg_inf_10(sdi); devc->buflen = 0; continue; - } - else if ((devc->buflen >= 5) && + } else if ((devc->buflen >= 5) && (devc->buf[devc->buflen - 1] & MSGID_MASK) != MSGID_DATA) { /* @@ -1144,8 +1139,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data) * of next message. */ process_msg_inf_5(sdi); - devc->buf[0] = - devc->buf[devc->buflen - 1]; + devc->buf[0] = devc->buf[devc->buflen - 1]; devc->buflen = 1; continue; } @@ -1223,8 +1217,7 @@ SR_PRIV int gmc_mh_2x_receive_data(int fd, int revents, void *cb_data) if (devc->cmd_seq % 10 == 0) { if (req_stat14(sdi, FALSE) != SR_OK) return FALSE; - } - else if (req_meas14(sdi) != SR_OK) + } else if (req_meas14(sdi) != SR_OK) return FALSE; } } diff --git a/src/hardware/teleinfo/protocol.c b/src/hardware/teleinfo/protocol.c index d42da22b..c87ea8a1 100644 --- a/src/hardware/teleinfo/protocol.c +++ b/src/hardware/teleinfo/protocol.c @@ -96,35 +96,34 @@ static void teleinfo_handle_measurement(struct sr_dev_inst *sdi, return; } - if (!strcmp(label, "ADCO")) { + if (!strcmp(label, "ADCO")) sr_sw_limits_update_samples_read(&devc->sw_limits, 1); - } else if (!strcmp(label, "BASE")) { + else if (!strcmp(label, "BASE")) teleinfo_send_value(sdi, "BASE", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "HCHP")) { + else if (!strcmp(label, "HCHP")) teleinfo_send_value(sdi, "HP" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "HCHC")) { + else if (!strcmp(label, "HCHC")) teleinfo_send_value(sdi, "HC" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "EJPHN")) { + else if (!strcmp(label, "EJPHN")) teleinfo_send_value(sdi, "HN" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "EJPHPM")) { + else if (!strcmp(label, "EJPHPM")) teleinfo_send_value(sdi, "HPM" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHPJB")) { + else if (!strcmp(label, "BBRHPJB")) teleinfo_send_value(sdi, "HPJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHPJW")) { + else if (!strcmp(label, "BBRHPJW")) teleinfo_send_value(sdi, "HPJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHPJR")) { + else if (!strcmp(label, "BBRHPJR")) teleinfo_send_value(sdi, "HPJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHCJB")) { + else if (!strcmp(label, "BBRHCJB")) teleinfo_send_value(sdi, "HCJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHCJW")) { + else if (!strcmp(label, "BBRHCJW")) teleinfo_send_value(sdi, "HCJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHCJR")) { + else if (!strcmp(label, "BBRHCJR")) teleinfo_send_value(sdi, "HCJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "IINST")) { + else if (!strcmp(label, "IINST")) teleinfo_send_value(sdi, "IINST", v, SR_MQ_CURRENT, SR_UNIT_AMPERE); - } else if (!strcmp(label, "PAPP")) { + else if (!strcmp(label, "PAPP")) teleinfo_send_value(sdi, "PAPP", v, SR_MQ_POWER, SR_UNIT_VOLT_AMPERE); - } } static gboolean teleinfo_parse_group(struct sr_dev_inst *sdi,