Skip to content

Commit

Permalink
marks several string parameters as const, as they are not modified in…
Browse files Browse the repository at this point in the history
…side the function, Patch by Stefan Huehner, stefan AT huehner-org

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19058 b3059339-0415-0410-9bf9-f77b7e298cf2
  • Loading branch information
reynaldo committed Jul 13, 2006
1 parent 7e18214 commit 1a16cbf
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions asxparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ asx_get_attrib(char* attrib,char** attribs) {
}

int
asx_attrib_to_enum(char* val,char** valid_vals) {
asx_attrib_to_enum(const char* val,char** valid_vals) {
char** ptr;
int r = 0;

Expand All @@ -107,7 +107,7 @@ asx_attrib_to_enum(char* val,char** valid_vals) {

static void
asx_warning_attrib_invalid(ASX_Parser_t* parser, char* elem, char* attrib,
char** valid_vals,char* val) {
char** valid_vals,const char* val) {
char *str,*vals,**ptr;
int len;

Expand Down
2 changes: 1 addition & 1 deletion asxparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ char*
asx_get_attrib(char* attrib,char** attribs);

int
asx_attrib_to_enum(char* val,char** valid_vals);
asx_attrib_to_enum(const char* val,char** valid_vals);

#define asx_free_attribs(a) asx_list_free((void***)&a,free)

Expand Down
2 changes: 1 addition & 1 deletion libmpdemux/demux_ogg.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,vo
}

// check if clang has substring from comma separated langlist
static int demux_ogg_check_lang(char *clang, char *langlist)
static int demux_ogg_check_lang(const char *clang, char *langlist)
{
char *c;

Expand Down
2 changes: 1 addition & 1 deletion libmpdemux/demuxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ if (demuxer->desc->seek)
return 1;
}

int demux_info_add(demuxer_t *demuxer, char *opt, char *param)
int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param)
{
char **info = demuxer->info;
int n = 0;
Expand Down
2 changes: 1 addition & 1 deletion libmpdemux/demuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ extern int pts_from_bps;

extern int extension_parsing;

int demux_info_add(demuxer_t *demuxer, char *opt, char *param);
int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param);
char* demux_info_get(demuxer_t *demuxer, char *opt);
int demux_info_print(demuxer_t *demuxer);
int demux_control(demuxer_t *demuxer, int cmd, void *arg);
Expand Down
4 changes: 2 additions & 2 deletions libvo/vo_caca.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static char posbar[MESSAGE_SIZE];
static int osdx = 0, osdy = 0;
static int posbary = 2;

static void osdmessage(int duration, char *fmt, ...)
static void osdmessage(int duration, const char *fmt, ...)
{
/*
* for outputting a centered string at the bottom
Expand All @@ -87,7 +87,7 @@ static void osdmessage(int duration, char *fmt, ...)
posbar[0] = '\0';
}

static void osdpercent(int duration, int min, int max, int val, char *desc, char *unit)
static void osdpercent(int duration, int min, int max, int val, const char *desc, const char *unit)
{
/*
* prints a bar for setting values
Expand Down
6 changes: 3 additions & 3 deletions m_option.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//#define NO_FREE
#endif

m_option_t* m_option_list_find(m_option_t* list,char* name) {
m_option_t* m_option_list_find(m_option_t* list,const char* name) {
int i;

for(i = 0 ; list[i].name ; i++) {
Expand Down Expand Up @@ -1196,7 +1196,7 @@ static int find_obj_desc(char* name,m_obj_list_t* l,m_struct_t** ret) {
return 0;
}

static int get_obj_param(char* opt_name,char* obj_name, m_struct_t* desc,
static int get_obj_param(const char* opt_name,const char* obj_name, m_struct_t* desc,
char* str,int* nold,int oldmax,char** dst) {
char* eq;
m_option_t* opt;
Expand Down Expand Up @@ -1249,7 +1249,7 @@ static int get_obj_param(char* opt_name,char* obj_name, m_struct_t* desc,
return 1;
}

static int get_obj_params(char* opt_name, char* name,char* params,
static int get_obj_params(const char* opt_name, const char* name,char* params,
m_struct_t* desc,char separator, char*** _ret) {
int n = 0,nold = 0, nopts,r;
char* ptr,*last_ptr = params;
Expand Down
2 changes: 1 addition & 1 deletion m_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ struct m_option {
* \param name Name of the option.
* \return The matching option or NULL.
*/
m_option_t* m_option_list_find(m_option_t* list,char* name);
m_option_t* m_option_list_find(m_option_t* list,const char* name);

/// Helper to parse options, see \ref m_option_type::parse.
inline static int
Expand Down
2 changes: 1 addition & 1 deletion m_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ char* m_properties_expand_string(m_option_t* prop_list,char* str);
// Helpers to use MPlayer's properties

/// Get an MPlayer property.
m_option_t* mp_property_find(char* name);
m_option_t* mp_property_find(const char* name);

/// Do an action with an MPlayer property.
int mp_property_do(char* name,int action, void* val);
Expand Down
6 changes: 3 additions & 3 deletions mplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ static mp_osd_msg_t* osd_msg_stack = NULL;
*
*/

static void set_osd_msg(int id, int level, int time, char* fmt, ...) {
static void set_osd_msg(int id, int level, int time, const char* fmt, ...) {
mp_osd_msg_t *msg,*last=NULL;
va_list va;
int r;
Expand Down Expand Up @@ -1243,7 +1243,7 @@ static mp_osd_msg_t* get_osd_msg(void) {
*
*/

void set_osd_bar(int type,char* name,double min,double max,double val) {
void set_osd_bar(int type,const char* name,double min,double max,double val) {

if(osd_level < 1) return;

Expand Down Expand Up @@ -2254,7 +2254,7 @@ static m_option_t mp_properties[] = {
{ NULL, NULL, NULL, 0, 0, 0, NULL }
};

m_option_t* mp_property_find(char* name) {
m_option_t* mp_property_find(const char* name) {
return m_option_list_find(mp_properties,name);
}

Expand Down

0 comments on commit 1a16cbf

Please sign in to comment.