X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=device.c;h=6e9a30086b610a590ac9c3190ff5698751758166;hb=2f5c8c9696f4a4a8ca7e3c7e6e7d2766a4927026;hp=bf87e811e90c6ffb9530214b0fcf381215bde610;hpb=ee4b6342afe8e42c0be481109b9b97e27cbb846a;p=libsigrok.git diff --git a/device.c b/device.c index bf87e811..6e9a3008 100644 --- a/device.c +++ b/device.c @@ -20,6 +20,7 @@ #include #include #include +#include extern struct sr_global *global; @@ -48,7 +49,7 @@ int sr_device_plugin_init(struct sr_device_plugin *plugin) { int num_devices, num_probes, i; - g_message("initializing %s plugin", plugin->name); + sr_info("initializing %s plugin", plugin->name); num_devices = plugin->init(NULL); for (i = 0; i < num_devices; i++) { num_probes = (int)plugin->get_device_info(i, SR_DI_NUM_PROBES); @@ -146,7 +147,7 @@ void sr_device_probe_clear(struct sr_device *device, int probenum) } } -void sr_device_probe_add(struct sr_device *device, char *name) +void sr_device_probe_add(struct sr_device *device, const char *name) { struct sr_probe *p; char probename[16]; @@ -184,7 +185,8 @@ struct sr_probe *sr_device_probe_find(struct sr_device *device, int probenum) } /* TODO: return SIGROK_ERR if probenum not found */ -void sr_device_probe_name(struct sr_device *device, int probenum, char *name) +void sr_device_probe_name(struct sr_device *device, int probenum, + const char *name) { struct sr_probe *p; @@ -216,7 +218,8 @@ void sr_device_trigger_clear(struct sr_device *device) } /* TODO: return SIGROK_ERR if probenum not found */ -void sr_device_trigger_set(struct sr_device *device, int probenum, char *trigger) +void sr_device_trigger_set(struct sr_device *device, int probenum, + const char *trigger) { struct sr_probe *p; @@ -236,7 +239,7 @@ gboolean sr_device_has_hwcap(struct sr_device *device, int hwcap) int *capabilities, i; if (!device || !device->plugin) - return; + return FALSE; if ((capabilities = device->plugin->get_capabilities())) for (i = 0; capabilities[i]; i++)