From: Uwe Hermann Date: Sun, 20 Feb 2011 12:53:13 +0000 (+0100) Subject: Constify a few more 'char *' parameters. X-Git-Tag: libsigrok-0.1.0~322 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=8225e92175c64909eddaecf8bd512049acf653a2 Constify a few more 'char *' parameters. --- diff --git a/device.c b/device.c index bf87e811..d11eea5c 100644 --- a/device.c +++ b/device.c @@ -146,7 +146,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 +184,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 +217,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; diff --git a/filter.c b/filter.c index 6b219842..69cb45ca 100644 --- a/filter.c +++ b/filter.c @@ -28,7 +28,7 @@ * unused probes removed. */ int filter_probes(int in_unitsize, int out_unitsize, int *probelist, - char *data_in, uint64_t length_in, char **data_out, + const char *data_in, uint64_t length_in, char **data_out, uint64_t *length_out) { unsigned int in_offset, out_offset; diff --git a/session_file.c b/session_file.c index 0092e718..4d70b351 100644 --- a/session_file.c +++ b/session_file.c @@ -136,7 +136,7 @@ int sr_session_load(const char *filename) return SR_OK; } -int sr_session_save(char *filename) +int sr_session_save(const char *filename) { GSList *l, *p, *d; FILE *meta; diff --git a/sigrok-proto.h b/sigrok-proto.h index 88c84e89..3589024d 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -44,19 +44,20 @@ void sr_device_clear(struct sr_device *device); void sr_device_destroy(struct sr_device *dev); 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 *sr_device_probe_find(struct sr_device *device, int probenum); -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); void sr_device_trigger_clear(struct sr_device *device); void sr_device_trigger_set(struct sr_device *device, int probenum, - char *trigger); + const char *trigger); gboolean sr_device_has_hwcap(struct sr_device *device, int hwcap); /*--- filter.c --------------------------------------------------------------*/ int filter_probes(int in_unitsize, int out_unitsize, int *probelist, - char *data_in, uint64_t length_in, char **data_out, + const char *data_in, uint64_t length_in, char **data_out, uint64_t *length_out); /*--- hwplugin.c ------------------------------------------------------------*/ @@ -118,7 +119,7 @@ void sr_session_halt(void); void sr_session_stop(void); void sr_session_bus(struct sr_device *device, struct sr_datafeed_packet *packet); -int sr_session_save(char *filename); +int sr_session_save(const char *filename); void sr_session_source_add(int fd, int events, int timeout, receive_data_callback callback, void *user_data); void sr_session_source_remove(int fd);