From: Aurelien Jacobs Date: Tue, 14 Jan 2014 22:16:55 +0000 (+0100) Subject: change a bunch of functions from SR_PRIV to static X-Git-Tag: libsigrok-0.3.0~284 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d87c1766f2968d121cea9d913b06dc3493adfd9e;p=libsigrok.git change a bunch of functions from SR_PRIV to static None of those functions are called across compilation units. --- diff --git a/hardware/cem-dt-885x/protocol.c b/hardware/cem-dt-885x/protocol.c index e0e9f8b7..78b02f6a 100644 --- a/hardware/cem-dt-885x/protocol.c +++ b/hardware/cem-dt-885x/protocol.c @@ -440,7 +440,7 @@ static int wait_for_token(const struct sr_dev_inst *sdi, int8_t *tokens, int tim /* cmd is the command to send, tokens are the tokens that denote the state * which the command affects. The first token is the desired state. */ -SR_PRIV int cem_dt_885x_toggle(const struct sr_dev_inst *sdi, uint8_t cmd, +static int cem_dt_885x_toggle(const struct sr_dev_inst *sdi, uint8_t cmd, int8_t *tokens, int timeout) { struct dev_context *devc; diff --git a/hardware/common/scpi_serial.c b/hardware/common/scpi_serial.c index d4c3add2..052d6c1e 100644 --- a/hardware/common/scpi_serial.c +++ b/hardware/common/scpi_serial.c @@ -47,7 +47,7 @@ static int scpi_serial_dev_inst_new(void *priv, const char *resource, return SR_OK; } -SR_PRIV int scpi_serial_open(void *priv) +static int scpi_serial_open(void *priv) { struct scpi_serial *sscpi = priv; struct sr_serial_dev_inst *serial = sscpi->serial; @@ -61,7 +61,7 @@ SR_PRIV int scpi_serial_open(void *priv) return SR_OK; } -SR_PRIV int scpi_serial_source_add(void *priv, int events, int timeout, +static int scpi_serial_source_add(void *priv, int events, int timeout, sr_receive_data_callback_t cb, void *cb_data) { struct scpi_serial *sscpi = priv; @@ -70,7 +70,7 @@ SR_PRIV int scpi_serial_source_add(void *priv, int events, int timeout, return serial_source_add(serial, events, timeout, cb, cb_data); } -SR_PRIV int scpi_serial_source_remove(void *priv) +static int scpi_serial_source_remove(void *priv) { struct scpi_serial *sscpi = priv; struct sr_serial_dev_inst *serial = sscpi->serial; @@ -78,7 +78,7 @@ SR_PRIV int scpi_serial_source_remove(void *priv) return serial_source_remove(serial); } -SR_PRIV int scpi_serial_send(void *priv, const char *command) +static int scpi_serial_send(void *priv, const char *command) { int len, result, written; gchar *terminated_command; @@ -105,7 +105,7 @@ SR_PRIV int scpi_serial_send(void *priv, const char *command) return SR_OK; } -SR_PRIV int scpi_serial_receive(void *priv, char **scpi_response) +static int scpi_serial_receive(void *priv, char **scpi_response) { int len, ret; char buf[256]; @@ -159,7 +159,7 @@ SR_PRIV int scpi_serial_receive(void *priv, char **scpi_response) return ret; } -SR_PRIV int scpi_serial_read_begin(void *priv) +static int scpi_serial_read_begin(void *priv) { struct scpi_serial *sscpi = priv; @@ -168,7 +168,7 @@ SR_PRIV int scpi_serial_read_begin(void *priv) return SR_OK; } -SR_PRIV int scpi_serial_read_data(void *priv, char *buf, int maxlen) +static int scpi_serial_read_data(void *priv, char *buf, int maxlen) { struct scpi_serial *sscpi = priv; int ret; @@ -187,7 +187,7 @@ SR_PRIV int scpi_serial_read_data(void *priv, char *buf, int maxlen) return ret; } -SR_PRIV int scpi_serial_read_complete(void *priv) +static int scpi_serial_read_complete(void *priv) { struct scpi_serial *sscpi = priv; diff --git a/hardware/common/scpi_tcp.c b/hardware/common/scpi_tcp.c index 86972f06..796ea9a8 100644 --- a/hardware/common/scpi_tcp.c +++ b/hardware/common/scpi_tcp.c @@ -71,7 +71,7 @@ static int scpi_tcp_dev_inst_new(void *priv, const char *resource, return SR_OK; } -SR_PRIV int scpi_tcp_open(void *priv) +static int scpi_tcp_open(void *priv) { struct scpi_tcp *tcp = priv; struct addrinfo hints; @@ -114,7 +114,7 @@ SR_PRIV int scpi_tcp_open(void *priv) return SR_OK; } -SR_PRIV int scpi_tcp_source_add(void *priv, int events, int timeout, +static int scpi_tcp_source_add(void *priv, int events, int timeout, sr_receive_data_callback_t cb, void *cb_data) { struct scpi_tcp *tcp = priv; @@ -122,14 +122,14 @@ SR_PRIV int scpi_tcp_source_add(void *priv, int events, int timeout, return sr_source_add(tcp->socket, events, timeout, cb, cb_data); } -SR_PRIV int scpi_tcp_source_remove(void *priv) +static int scpi_tcp_source_remove(void *priv) { struct scpi_tcp *tcp = priv; return sr_source_remove(tcp->socket); } -SR_PRIV int scpi_tcp_send(void *priv, const char *command) +static int scpi_tcp_send(void *priv, const char *command) { struct scpi_tcp *tcp = priv; int len, out; @@ -155,7 +155,7 @@ SR_PRIV int scpi_tcp_send(void *priv, const char *command) return SR_OK; } -SR_PRIV int scpi_tcp_read_begin(void *priv) +static int scpi_tcp_read_begin(void *priv) { struct scpi_tcp *tcp = priv; @@ -165,7 +165,7 @@ SR_PRIV int scpi_tcp_read_begin(void *priv) return SR_OK; } -SR_PRIV int scpi_tcp_raw_read_data(void *priv, char *buf, int maxlen) +static int scpi_tcp_raw_read_data(void *priv, char *buf, int maxlen) { struct scpi_tcp *tcp = priv; int len; @@ -184,7 +184,7 @@ SR_PRIV int scpi_tcp_raw_read_data(void *priv, char *buf, int maxlen) return len; } -SR_PRIV int scpi_tcp_rigol_read_data(void *priv, char *buf, int maxlen) +static int scpi_tcp_rigol_read_data(void *priv, char *buf, int maxlen) { struct scpi_tcp *tcp = priv; int len; @@ -220,7 +220,7 @@ SR_PRIV int scpi_tcp_rigol_read_data(void *priv, char *buf, int maxlen) return len; } -SR_PRIV int scpi_tcp_read_complete(void *priv) +static int scpi_tcp_read_complete(void *priv) { struct scpi_tcp *tcp = priv; @@ -228,7 +228,7 @@ SR_PRIV int scpi_tcp_read_complete(void *priv) tcp->response_bytes_read >= tcp->response_length); } -SR_PRIV int scpi_tcp_close(void *priv) +static int scpi_tcp_close(void *priv) { struct scpi_tcp *tcp = priv; @@ -238,7 +238,7 @@ SR_PRIV int scpi_tcp_close(void *priv) return SR_OK; } -SR_PRIV void scpi_tcp_free(void *priv) +static void scpi_tcp_free(void *priv) { struct scpi_tcp *tcp = priv; diff --git a/hardware/common/scpi_usbtmc.c b/hardware/common/scpi_usbtmc.c index c734890a..3c98c06b 100644 --- a/hardware/common/scpi_usbtmc.c +++ b/hardware/common/scpi_usbtmc.c @@ -51,7 +51,7 @@ static int scpi_usbtmc_dev_inst_new(void *priv, const char *resource, return SR_OK; } -SR_PRIV int scpi_usbtmc_open(void *priv) +static int scpi_usbtmc_open(void *priv) { struct usbtmc_scpi *uscpi = priv; struct sr_usbtmc_dev_inst *usbtmc = uscpi->usbtmc; @@ -62,7 +62,7 @@ SR_PRIV int scpi_usbtmc_open(void *priv) return SR_OK; } -SR_PRIV int scpi_usbtmc_source_add(void *priv, int events, int timeout, +static int scpi_usbtmc_source_add(void *priv, int events, int timeout, sr_receive_data_callback_t cb, void *cb_data) { struct usbtmc_scpi *uscpi = priv; @@ -71,7 +71,7 @@ SR_PRIV int scpi_usbtmc_source_add(void *priv, int events, int timeout, return sr_source_add(usbtmc->fd, events, timeout, cb, cb_data); } -SR_PRIV int scpi_usbtmc_source_remove(void *priv) +static int scpi_usbtmc_source_remove(void *priv) { struct usbtmc_scpi *uscpi = priv; struct sr_usbtmc_dev_inst *usbtmc = uscpi->usbtmc; @@ -79,7 +79,7 @@ SR_PRIV int scpi_usbtmc_source_remove(void *priv) return sr_source_remove(usbtmc->fd); } -SR_PRIV int scpi_usbtmc_send(void *priv, const char *command) +static int scpi_usbtmc_send(void *priv, const char *command) { struct usbtmc_scpi *uscpi = priv; struct sr_usbtmc_dev_inst *usbtmc = uscpi->usbtmc; @@ -103,7 +103,7 @@ SR_PRIV int scpi_usbtmc_send(void *priv, const char *command) return SR_OK; } -SR_PRIV int scpi_usbtmc_read_begin(void *priv) +static int scpi_usbtmc_read_begin(void *priv) { struct usbtmc_scpi *uscpi = priv; struct sr_usbtmc_dev_inst *usbtmc = uscpi->usbtmc; @@ -122,7 +122,7 @@ SR_PRIV int scpi_usbtmc_read_begin(void *priv) return SR_OK; } -SR_PRIV int scpi_usbtmc_read_data(void *priv, char *buf, int maxlen) +static int scpi_usbtmc_read_data(void *priv, char *buf, int maxlen) { struct usbtmc_scpi *uscpi = priv; int read_length; @@ -147,7 +147,7 @@ SR_PRIV int scpi_usbtmc_read_data(void *priv, char *buf, int maxlen) return read_length; } -SR_PRIV int scpi_usbtmc_read_complete(void *priv) +static int scpi_usbtmc_read_complete(void *priv) { struct usbtmc_scpi *uscpi = priv; @@ -158,7 +158,7 @@ SR_PRIV int scpi_usbtmc_read_complete(void *priv) return (uscpi->response_bytes_read >= uscpi->response_length); } -SR_PRIV int scpi_usbtmc_close(void *priv) +static int scpi_usbtmc_close(void *priv) { struct usbtmc_scpi *uscpi = priv; diff --git a/hardware/hameg-hmo/protocol.c b/hardware/hameg-hmo/protocol.c index 397497de..9d5e1773 100644 --- a/hardware/hameg-hmo/protocol.c +++ b/hardware/hameg-hmo/protocol.c @@ -426,7 +426,7 @@ SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV struct scope_state *scope_state_new(struct scope_config *config) +static struct scope_state *scope_state_new(struct scope_config *config) { struct scope_state *state; diff --git a/hardware/hantek-dso/dso.c b/hardware/hantek-dso/dso.c index 8a28a57b..da5eb121 100644 --- a/hardware/hantek-dso/dso.c +++ b/hardware/hantek-dso/dso.c @@ -66,7 +66,7 @@ static int send_bulkcmd(const struct sr_dev_inst *sdi, uint8_t *cmdstring, int c return SR_OK; } -SR_PRIV int dso_getmps(libusb_device *dev) +static int dso_getmps(libusb_device *dev) { struct libusb_device_descriptor des; struct libusb_config_descriptor *conf_dsc; @@ -256,7 +256,7 @@ static int get_channel_offsets(const struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV int dso_set_trigger_samplerate(const struct sr_dev_inst *sdi) +static int dso_set_trigger_samplerate(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_usb_dev_inst *usb; @@ -373,7 +373,7 @@ SR_PRIV int dso_set_trigger_samplerate(const struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV int dso_set_filters(const struct sr_dev_inst *sdi) +static int dso_set_filters(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_usb_dev_inst *usb; @@ -415,7 +415,7 @@ SR_PRIV int dso_set_filters(const struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV int dso_set_voltage(const struct sr_dev_inst *sdi) +static int dso_set_voltage(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_usb_dev_inst *usb; @@ -485,7 +485,7 @@ SR_PRIV int dso_set_voltage(const struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV int dso_set_relays(const struct sr_dev_inst *sdi) +static int dso_set_relays(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_usb_dev_inst *usb; @@ -542,7 +542,7 @@ SR_PRIV int dso_set_relays(const struct sr_dev_inst *sdi) return SR_OK; } -SR_PRIV int dso_set_voffsets(const struct sr_dev_inst *sdi) +static int dso_set_voffsets(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_usb_dev_inst *usb; diff --git a/hardware/kecheng-kc-330b/protocol.c b/hardware/kecheng-kc-330b/protocol.c index c6263cde..1e12f0fd 100644 --- a/hardware/kecheng-kc-330b/protocol.c +++ b/hardware/kecheng-kc-330b/protocol.c @@ -337,7 +337,7 @@ SR_PRIV int kecheng_kc_330b_log_info_get(const struct sr_dev_inst *sdi, return SR_OK; } -SR_PRIV int kecheng_kc_330b_log_date_time_get(const struct sr_dev_inst *sdi, +static int kecheng_kc_330b_log_date_time_get(const struct sr_dev_inst *sdi, gboolean *tmp) { diff --git a/hardware/lascar-el-usb/protocol.c b/hardware/lascar-el-usb/protocol.c index 032db07e..b1f39ccd 100644 --- a/hardware/lascar-el-usb/protocol.c +++ b/hardware/lascar-el-usb/protocol.c @@ -55,7 +55,7 @@ static const struct elusb_profile profiles[] = { }; -SR_PRIV libusb_device_handle *lascar_open(struct libusb_device *dev) +static libusb_device_handle *lascar_open(struct libusb_device *dev) { libusb_device_handle *dev_hdl; int ret; @@ -202,7 +202,7 @@ cleanup: return *configlen ? SR_OK : SR_ERR; } -SR_PRIV int lascar_save_config(libusb_device_handle *dev_hdl, +static int lascar_save_config(libusb_device_handle *dev_hdl, unsigned char *config, int configlen) { struct drv_context *drvc; diff --git a/hardware/zeroplus-logic-cube/protocol.c b/hardware/zeroplus-logic-cube/protocol.c index 20adc389..ce20ccf4 100644 --- a/hardware/zeroplus-logic-cube/protocol.c +++ b/hardware/zeroplus-logic-cube/protocol.c @@ -30,7 +30,7 @@ SR_PRIV unsigned int get_memory_size(int type) return 0; } -SR_PRIV int clz(unsigned int x) +static int clz(unsigned int x) { int n = 0; if (x == 0)