Constify some more 'char *' parameters.

This commit is contained in:
Uwe Hermann 2011-02-20 18:24:25 +01:00
parent 809c5f2011
commit 54ac5277c5
20 changed files with 33 additions and 35 deletions

View File

@ -45,7 +45,7 @@ struct alsa {
gpointer session_id;
};
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;
struct alsa *alsa;

View File

@ -387,7 +387,7 @@ static int bin2bitbang(const char *filename,
return 0;
}
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;
struct sigma *sigma = g_malloc(sizeof(struct sigma));

View File

@ -19,7 +19,7 @@
#include <sigrok.h>
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
}

View File

@ -98,7 +98,7 @@ static int thread_running;
static void hw_stop_acquisition(int device_index, gpointer session_device_id);
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;

View File

@ -347,7 +347,7 @@ static int mso_parse_serial(const char *iSerial, const char *iProduct,
return SR_OK;
}
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;
int devcnt = 0;

View File

@ -219,7 +219,7 @@ static uint32_t reverse32(uint32_t in)
return out;
}
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;
GSList *ports, *l;

View File

@ -291,7 +291,7 @@ static int configure_probes(GSList *probes)
* API callbacks
*/
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;
struct libusb_device_descriptor des;

View File

@ -273,7 +273,7 @@ static int configure_probes(GSList *probes)
* API callbacks
*/
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
struct sr_device_instance *sdi;
struct libusb_device_descriptor des;

View File

@ -202,8 +202,8 @@ static int init_bits(struct sr_output *o)
return init(o, DEFAULT_BPL_BITS, MODE_BITS);
}
static int data_bits(struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
static int data_bits(struct sr_output *o, const char *data_in,
uint64_t length_in, char **data_out, uint64_t *length_out)
{
struct context *ctx;
unsigned int outsize, offset, p;
@ -288,8 +288,8 @@ static int init_hex(struct sr_output *o)
return init(o, DEFAULT_BPL_HEX, MODE_HEX);
}
static int data_hex(struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
static int data_hex(struct sr_output *o, const char *data_in,
uint64_t length_in, char **data_out, uint64_t *length_out)
{
struct context *ctx;
unsigned int outsize, offset, p;
@ -353,8 +353,8 @@ static int init_ascii(struct sr_output *o)
return init(o, DEFAULT_BPL_ASCII, MODE_ASCII);
}
static int data_ascii(struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
static int data_ascii(struct sr_output *o, const char *data_in,
uint64_t length_in, char **data_out, uint64_t *length_out)
{
struct context *ctx;
unsigned int outsize, offset, p;

View File

@ -25,7 +25,7 @@
#include "config.h"
static int data(struct sr_output *o, char *data_in, uint64_t length_in,
static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
char *outbuf;

View File

@ -141,7 +141,7 @@ static int event(struct sr_output *o, int event_type, char **data_out,
return SR_OK;
}
static int data(struct sr_output *o, char *data_in, uint64_t length_in,
static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
struct context *ctx;

View File

@ -97,7 +97,7 @@ static int event(struct sr_output *o, int event_type, char **data_out,
return SR_OK;
}
static int data(struct sr_output *o, char *data_in, uint64_t length_in,
static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
GString *out;

View File

@ -25,7 +25,7 @@ static int init(struct sr_output *o)
return 0;
}
static int data(struct sr_output *o, char *data_in, uint64_t length_in,
static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
return SR_OK;

View File

@ -165,7 +165,7 @@ static int event(struct sr_output *o, int event_type, char **data_out,
return SR_OK;
}
static int data(struct sr_output *o, char *data_in, uint64_t length_in,
static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
struct context *ctx;

View File

@ -30,8 +30,8 @@ int init_ascii(struct sr_output *o)
return init(o, DEFAULT_BPL_ASCII, MODE_ASCII);
}
int data_ascii(struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
int data_ascii(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
struct context *ctx;
unsigned int outsize, offset, p;

View File

@ -30,8 +30,8 @@ int init_bits(struct sr_output *o)
return init(o, DEFAULT_BPL_BITS, MODE_BITS);
}
int data_bits(struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
int data_bits(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
struct context *ctx;
unsigned int outsize, offset, p;

View File

@ -30,8 +30,8 @@ int init_hex(struct sr_output *o)
return init(o, DEFAULT_BPL_HEX, MODE_HEX);
}
int data_hex(struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
int data_hex(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out)
{
struct context *ctx;
unsigned int outsize, offset, p;

View File

@ -17,7 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TEXT_H_
#define TEXT_H_
@ -54,16 +53,15 @@ int event(struct sr_output *o, int event_type, char **data_out,
int init_bits(struct sr_output *o);
int data_bits(struct sr_output *o, char *data_in, uint64_t length_in,
int data_bits(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out);
int init_hex(struct sr_output *o);
int data_hex(struct sr_output *o, char *data_in, uint64_t length_in,
int data_hex(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out);
int init_ascii(struct sr_output *o);
int data_ascii(struct sr_output *o, char *data_in, uint64_t length_in,
int data_ascii(struct sr_output *o, const char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out);
#endif /* TEXT_H_ */
#endif

View File

@ -111,7 +111,7 @@ static int feed_chunk(int fd, int revents, void *user_data)
/* driver callbacks */
static int hw_init(char *deviceinfo)
static int hw_init(const char *deviceinfo)
{
sessionfile = g_strdup(deviceinfo);

View File

@ -157,8 +157,8 @@ struct sr_output_format {
char *description;
int df_type;
int (*init) (struct sr_output *o);
int (*data) (struct sr_output *o, char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out);
int (*data) (struct sr_output *o, const char *data_in,
uint64_t length_in, char **data_out, uint64_t *length_out);
int (*event) (struct sr_output *o, int event_type, char **data_out,
uint64_t *length_out);
};
@ -326,7 +326,7 @@ struct sr_device_plugin {
char *name;
char *longname;
int api_version;
int (*init) (char *deviceinfo);
int (*init) (const char *deviceinfo);
void (*cleanup) (void);
/* Device-specific */