aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-01-21 15:17:35 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2017-01-21 15:17:35 +0100
commit35bb2fcef95d23bda27c5b3ec3a014d4e1c22713 (patch)
tree27f01d2344b1d42bc50a29a4eaa149527a5c3a66
parentd64be25be4b315bceb7f6d87b1c414a3c94c31c5 (diff)
scpi_serial: Convert 'got_newline' variable to gboolean.
-rw-r--r--src/scpi/scpi_serial.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scpi/scpi_serial.c b/src/scpi/scpi_serial.c
index 6811ad3..6c4e63c 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;
}
}