From: Uwe Hermann Date: Sat, 21 Jan 2017 14:17:35 +0000 (+0100) Subject: scpi_serial: Convert 'got_newline' variable to gboolean. X-Git-Tag: libsigrok-0.5.0~132 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=35bb2fcef95d23bda27c5b3ec3a014d4e1c22713;p=libsigrok.git scpi_serial: Convert 'got_newline' variable to gboolean. --- diff --git a/src/scpi/scpi_serial.c b/src/scpi/scpi_serial.c index 6811ad36..6c4e63c7 100644 --- a/src/scpi/scpi_serial.c +++ b/src/scpi/scpi_serial.c @@ -30,7 +30,7 @@ struct scpi_serial { struct sr_serial_dev_inst *serial; - char got_newline; + gboolean got_newline; }; static const struct { @@ -93,7 +93,7 @@ static int scpi_serial_open(struct sr_scpi_dev_inst *scpi) if (serial_flush(serial) != SR_OK) return SR_ERR; - sscpi->got_newline = 0; + sscpi->got_newline = FALSE; return SR_OK; } @@ -141,7 +141,7 @@ static int scpi_serial_send(void *priv, const char *command) static int scpi_serial_read_begin(void *priv) { struct scpi_serial *sscpi = priv; - sscpi->got_newline = 0; + sscpi->got_newline = FALSE; return SR_OK; } @@ -161,10 +161,10 @@ static int scpi_serial_read_data(void *priv, char *buf, int maxlen) sr_spew("Read %d bytes into buffer.", ret); if (buf[ret - 1] == '\n') { - sscpi->got_newline = 1; + sscpi->got_newline = TRUE; sr_spew("Received terminator"); } else { - sscpi->got_newline = 0; + sscpi->got_newline = FALSE; } }