From: Gerhard Sittig Date: Fri, 30 Dec 2016 12:11:59 +0000 (+0100) Subject: scpi: Minor style nits X-Git-Tag: libsigrok-0.5.0~155 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d3de86f3ca50a55773c6974f0c336e942030b0bd;p=libsigrok.git scpi: Minor style nits Drop an initial assignment to a variable which never takes effect. Add braces around the body of a more complex if block. Separate routines from each other by exactly one empty line. --- diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index e4346e5d..222201ce 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -419,12 +419,13 @@ SR_PRIV int sr_scpi_get_data(struct sr_scpi_dev_inst *scpi, GString *response; gint64 laststart; unsigned int elapsed_ms; - unsigned int offset = 0; + unsigned int offset; int space; - if (command) + if (command) { if (sr_scpi_send(scpi, command) != SR_OK) return SR_ERR; + } if (sr_scpi_read_begin(scpi) != SR_OK) return SR_ERR; @@ -723,6 +724,7 @@ SR_PRIV int sr_scpi_get_uint8v(struct sr_scpi_dev_inst *scpi, return ret; } + /** * Send a SCPI command, read the reply, parse it as binary data with a * "definite length block" header and store the as an result in scpi_response. @@ -796,7 +798,6 @@ SR_PRIV int sr_scpi_get_block(struct sr_scpi_dev_inst *scpi, return ret; } - /** * Send the *IDN? SCPI command, receive the reply, parse it and store the * reply as a sr_scpi_hw_info structure in the supplied scpi_response pointer.