From: Bert Vermeulen Date: Wed, 4 Dec 2013 23:09:34 +0000 (+0100) Subject: scpi/serial: Use stubs for all SCPI functions. X-Git-Tag: libsigrok-0.3.0~481 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=bc03a7cc2ccadeb5951525fae708bd3f840836b0;p=libsigrok.git scpi/serial: Use stubs for all SCPI functions. Avoids some gcc warnings, since the SCPI prototypes don't exactly match serial_*. --- diff --git a/hardware/common/scpi_serial.c b/hardware/common/scpi_serial.c index c56e524f..e89e7f71 100644 --- a/hardware/common/scpi_serial.c +++ b/hardware/common/scpi_serial.c @@ -138,6 +138,20 @@ SR_PRIV int scpi_serial_receive(void *priv, char **scpi_response) return ret; } +/* Some stubs to keep the compiler from whining. */ +static int scpi_serial_read(void *priv, char *buf, int maxlen) +{ + return serial_read(priv, buf, maxlen); +} +static int scpi_serial_close(void *priv) +{ + return serial_close(priv); +} +static void scpi_serial_free(void *priv) +{ + return sr_serial_dev_inst_free(priv); +} + SR_PRIV struct sr_scpi_dev_inst *scpi_serial_dev_inst_new(const char *port, const char *serialcomm) { @@ -157,9 +171,9 @@ SR_PRIV struct sr_scpi_dev_inst *scpi_serial_dev_inst_new(const char *port, scpi->source_remove = scpi_serial_source_remove; scpi->send = scpi_serial_send; scpi->receive = scpi_serial_receive; - scpi->read = serial_read; - scpi->close = serial_close; - scpi->free = sr_serial_dev_inst_free; + scpi->read = scpi_serial_read; + scpi->close = scpi_serial_close; + scpi->free = scpi_serial_free; scpi->priv = serial; return scpi;