]> sigrok.org Git - libsigrok.git/commitdiff
scpi_serial: Convert 'got_newline' variable to gboolean.
authorUwe Hermann <redacted>
Sat, 21 Jan 2017 14:17:35 +0000 (15:17 +0100)
committerUwe Hermann <redacted>
Sat, 21 Jan 2017 14:17:35 +0000 (15:17 +0100)
src/scpi/scpi_serial.c

index 6811ad3688345ad81a5d93b81732d6ab5d761df1..6c4e63c7b9122756c7bfaaf2983d9e80203f4489 100644 (file)
@@ -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;
                }
        }