[MPlayer-cvslog] r19109 - in trunk: Gui/mplayer/mw.c Gui/skin/font.c Gui/skin/font.h Gui/win32/interface.c asxparser.c asxparser.h libass/ass_render.c libmpcodecs/ad_libvorbis.c libmpcodecs/ve_x264.c libmpdemux/demux_ty_osd.c m_property.h m_struct.c m_struct.h mplayer.c mplayer.h subopt-helper.c subopt-helper.h
reynaldo
subversion at mplayerhq.hu
Sat Jul 15 18:03:20 CEST 2006
Author: reynaldo
Date: Sat Jul 15 18:03:12 2006
New Revision: 19109
Modified:
trunk/Gui/mplayer/mw.c
trunk/Gui/skin/font.c
trunk/Gui/skin/font.h
trunk/Gui/win32/interface.c
trunk/asxparser.c
trunk/asxparser.h
trunk/libass/ass_render.c
trunk/libmpcodecs/ad_libvorbis.c
trunk/libmpcodecs/ve_x264.c
trunk/libmpdemux/demux_ty_osd.c
trunk/m_property.h
trunk/m_struct.c
trunk/m_struct.h
trunk/mplayer.c
trunk/mplayer.h
trunk/subopt-helper.c
trunk/subopt-helper.h
Log:
marks several read-only string parameters which aren't modified inside the called function as const. Patch by Stefan Huehner, stefan AT huehner-org
Modified: trunk/Gui/mplayer/mw.c
==============================================================================
--- trunk/Gui/mplayer/mw.c (original)
+++ trunk/Gui/mplayer/mw.c Sat Jul 15 18:03:12 2006
@@ -73,7 +73,7 @@
// XFlush( wsDisplay );
}
-extern void exit_player(char* how);
+extern void exit_player(const char* how);
extern int vcd_track;
static unsigned last_redraw_time = 0;
Modified: trunk/Gui/skin/font.c
==============================================================================
--- trunk/Gui/skin/font.c (original)
+++ trunk/Gui/skin/font.c Sat Jul 15 18:03:12 2006
@@ -146,7 +146,7 @@
return max;
}
-txSample * fntRender( wItem * item,int px,char * fmt,... )
+txSample * fntRender( wItem * item,int px,const char * fmt,... )
{
va_list ap;
unsigned char p[512];
Modified: trunk/Gui/skin/font.h
==============================================================================
--- trunk/Gui/skin/font.h (original)
+++ trunk/Gui/skin/font.h Sat Jul 15 18:03:12 2006
@@ -32,7 +32,7 @@
extern int fntTextWidth( int id,char * str );
extern int fntRead( char * path,char * fname );
-extern txSample * fntRender( wItem * item,int px,char * fmt,... );
+extern txSample * fntRender( wItem * item,int px,const char * fmt,... );
#endif
Modified: trunk/Gui/win32/interface.c
==============================================================================
--- trunk/Gui/win32/interface.c (original)
+++ trunk/Gui/win32/interface.c Sat Jul 15 18:03:12 2006
@@ -45,7 +45,7 @@
extern m_obj_settings_t* vo_plugin_args;
extern vo_functions_t *video_out;
extern ao_functions_t *audio_out;
-extern void exit_player(char *how);
+extern void exit_player(const char *how);
extern char *filename;
extern int abs_seek_pos;
extern float rel_seek_secs;
Modified: trunk/asxparser.c
==============================================================================
--- trunk/asxparser.c (original)
+++ trunk/asxparser.c Sat Jul 15 18:03:12 2006
@@ -80,7 +80,7 @@
/////// Attribs utils
char*
-asx_get_attrib(char* attrib,char** attribs) {
+asx_get_attrib(const char* attrib,char** attribs) {
char** ptr;
if(attrib == NULL || attribs == NULL) return NULL;
Modified: trunk/asxparser.h
==============================================================================
--- trunk/asxparser.h (original)
+++ trunk/asxparser.h Sat Jul 15 18:03:12 2006
@@ -34,7 +34,7 @@
/////// Attribs utils
char*
-asx_get_attrib(char* attrib,char** attribs);
+asx_get_attrib(const char* attrib,char** attribs);
int
asx_attrib_to_enum(const char* val,char** valid_vals);
Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c (original)
+++ trunk/libass/ass_render.c Sat Jul 15 18:03:12 2006
@@ -469,7 +469,7 @@
/**
* \brief Check if starting part of (*p) matches sample. If true, shift p to the first symbol after the matching part.
*/
-static inline int mystrcmp(char** p, char* sample) {
+static inline int mystrcmp(char** p, const char* sample) {
int len = strlen(sample);
if (strncmp(*p, sample, len) == 0) {
(*p) += len;
Modified: trunk/libmpcodecs/ad_libvorbis.c
==============================================================================
--- trunk/libmpcodecs/ad_libvorbis.c (original)
+++ trunk/libmpcodecs/ad_libvorbis.c Sat Jul 15 18:03:12 2006
@@ -38,7 +38,7 @@
#endif
} ov_struct_t;
-static int read_vorbis_comment( char* ptr, char* comment, char* format, ... ) {
+static int read_vorbis_comment( char* ptr, const char* comment, const char* format, ... ) {
va_list va;
int clen, ret;
Modified: trunk/libmpcodecs/ve_x264.c
==============================================================================
--- trunk/libmpcodecs/ve_x264.c (original)
+++ trunk/libmpcodecs/ve_x264.c Sat Jul 15 18:03:12 2006
@@ -208,7 +208,7 @@
};
static int parse_cqm(const char *str, uint8_t *cqm, int length,
- h264_module_t *mod, char *matrix_name) {
+ h264_module_t *mod, const char *matrix_name) {
int i;
if (!str) return 0;
for (i = 0; i < length; i++) {
Modified: trunk/libmpdemux/demux_ty_osd.c
==============================================================================
--- trunk/libmpdemux/demux_ty_osd.c (original)
+++ trunk/libmpdemux/demux_ty_osd.c Sat Jul 15 18:03:12 2006
@@ -475,7 +475,7 @@
static int ty_XDSDisplayCount = -1;
-static void ty_AddXDSToDisplay( char *format, ... )
+static void ty_AddXDSToDisplay( const char *format, ... )
{
char line[ 80 ];
int index;
Modified: trunk/m_property.h
==============================================================================
--- trunk/m_property.h (original)
+++ trunk/m_property.h Sat Jul 15 18:03:12 2006
@@ -123,7 +123,7 @@
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);
+int mp_property_do(const char* name,int action, void* val);
/// \defgroup PropertyImplHelper Property implementation helpers
/// \ingroup Properties
Modified: trunk/m_struct.c
==============================================================================
--- trunk/m_struct.c (original)
+++ trunk/m_struct.c Sat Jul 15 18:03:12 2006
@@ -12,7 +12,7 @@
#include "mp_msg.h"
m_option_t*
-m_struct_get_field(m_struct_t* st,char* f) {
+m_struct_get_field(m_struct_t* st,const char* f) {
int i;
for(i = 0 ; st->fields[i].name ; i++) {
@@ -70,7 +70,7 @@
}
void
-m_struct_reset(m_struct_t* st, void* obj, char* field) {
+m_struct_reset(m_struct_t* st, void* obj, const char* field) {
m_option_t* f;
if(!field) { // Reset all options
Modified: trunk/m_struct.h
==============================================================================
--- trunk/m_struct.h (original)
+++ trunk/m_struct.h Sat Jul 15 18:03:12 2006
@@ -78,7 +78,7 @@
* \param field Name of the field to reset, if NULL all fields are reseted.
*/
void
-m_struct_reset(m_struct_t* st, void* obj, char* field);
+m_struct_reset(m_struct_t* st, void* obj, const char* field);
/// Create a copy of an existing struct.
/** \param st Struct definiton.
@@ -101,7 +101,7 @@
* \return The \ref m_option struct describing the field or NULL if not found.
*/
struct m_option*
-m_struct_get_field(m_struct_t* st,char* f);
+m_struct_get_field(m_struct_t* st,const char* f);
///@}
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c (original)
+++ trunk/mplayer.c Sat Jul 15 18:03:12 2006
@@ -519,7 +519,7 @@
current_module=NULL;
}
-static void exit_player_with_rc(char* how, int rc){
+static void exit_player_with_rc(const char* how, int rc){
uninit_player(INITED_ALL);
#ifdef HAVE_X11
@@ -554,7 +554,7 @@
exit(rc);
}
-void exit_player(char* how){
+void exit_player(const char* how){
exit_player_with_rc(how, 1);
}
@@ -2258,7 +2258,7 @@
return m_option_list_find(mp_properties,name);
}
-int mp_property_do(char* name,int action, void* val) {
+int mp_property_do(const char* name,int action, void* val) {
m_option_t* p = mp_property_find(name);
if(!p) return M_PROPERTY_UNAVAILABLE;
return m_property_do(p,action,val);
Modified: trunk/mplayer.h
==============================================================================
--- trunk/mplayer.h (original)
+++ trunk/mplayer.h Sat Jul 15 18:03:12 2006
@@ -58,7 +58,7 @@
extern int dvdsub_id;
extern int vobsub_id;
-extern void exit_player(char* how);
+extern void exit_player(const char* how);
extern void update_set_of_subtitles(void);
#endif
Modified: trunk/subopt-helper.c
==============================================================================
--- trunk/subopt-helper.c (original)
+++ trunk/subopt-helper.c Sat Jul 15 18:03:12 2006
@@ -324,7 +324,7 @@
/*** little helpers */
/** \brief compare the stings just as strcmp does */
-int strargcmp(strarg_t *arg, char *str) {
+int strargcmp(strarg_t *arg, const char *str) {
int res = strncmp(arg->str, str, arg->len);
if (!res && arg->len != strlen(str))
res = arg->len - strlen(str);
Modified: trunk/subopt-helper.h
==============================================================================
--- trunk/subopt-helper.h (original)
+++ trunk/subopt-helper.h Sat Jul 15 18:03:12 2006
@@ -44,7 +44,7 @@
int int_non_neg( int * i );
int int_pos( int * i );
-int strargcmp(strarg_t *arg, char *str);
+int strargcmp(strarg_t *arg, const char *str);
int strargcasecmp(strarg_t *arg, char *str);
#endif
More information about the MPlayer-cvslog
mailing list