]> sigrok.org Git - libsigrok.git/commitdiff
Constify a few more 'char *' parameters.
authorUwe Hermann <redacted>
Sun, 20 Feb 2011 12:53:13 +0000 (13:53 +0100)
committerUwe Hermann <redacted>
Sun, 20 Feb 2011 20:16:23 +0000 (21:16 +0100)
device.c
filter.c
session_file.c
sigrok-proto.h

index bf87e811e90c6ffb9530214b0fcf381215bde610..d11eea5c358177ae1b33db7eae50de59e8b54407 100644 (file)
--- 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;
 
index 6b219842e5d6cc2195aa7bab265d2f78302464aa..69cb45ca725a888686f570fb49adf961aa24b8ce 100644 (file)
--- 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;
index 0092e71875e9ee7e7cc454e36f3f01556307f04e..4d70b3514e92404dc49e7c9fa78271f0a78c918f 100644 (file)
@@ -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;
index 88c84e898f5e4e6d6a72c0b45a24f1853846a031..3589024d74326d77b0b46fffd19eb5edc6e7feee 100644 (file)
@@ -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);