mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +00:00
marks several strings inside structs as const when they hold just
read-only information and modifies GetLanguage in Gui/mplayer/gtk/menu.c to cope which the changes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19115 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ca57bf9033
commit
15e8c12de2
@ -94,7 +94,7 @@
|
||||
typedef struct
|
||||
{
|
||||
int msg;
|
||||
char * name;
|
||||
const char * name;
|
||||
} evName;
|
||||
|
||||
extern int evBoxs;
|
||||
|
@ -182,7 +182,7 @@ GtkWidget * AddSeparator( GtkWidget * Menu )
|
||||
typedef struct
|
||||
{
|
||||
int id;
|
||||
char * name;
|
||||
const char * name;
|
||||
} Languages_t;
|
||||
|
||||
#define lng( a,b ) ( (int)(a) * 256 + b )
|
||||
@ -369,7 +369,7 @@ static char * ChannelNumbers[] =
|
||||
{ "","Stereo","","","","5.1" };
|
||||
#endif
|
||||
|
||||
char * GetLanguage( int language )
|
||||
const char * GetLanguage( int language )
|
||||
{
|
||||
unsigned int i;
|
||||
for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
|
||||
|
@ -586,7 +586,7 @@ int cmd_decoration( char * in )
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char * name;
|
||||
const char * name;
|
||||
int (*func)( char * in );
|
||||
} _item;
|
||||
|
||||
|
@ -156,7 +156,7 @@
|
||||
typedef struct
|
||||
{
|
||||
int code;
|
||||
char * name;
|
||||
const char * name;
|
||||
} TwsKeyNames;
|
||||
|
||||
extern TwsKeyNames wsKeyNames[ wsKeyNumber ];
|
||||
|
@ -1671,7 +1671,7 @@ static int mp_input_print_key_list(m_option_t* cfg) {
|
||||
static int mp_input_print_cmd_list(m_option_t* cfg) {
|
||||
mp_cmd_t *cmd;
|
||||
int i,j;
|
||||
char* type;
|
||||
const char* type;
|
||||
|
||||
for(i = 0; (cmd = &mp_cmds[i])->name != NULL ; i++) {
|
||||
printf("%-20.20s",cmd->name);
|
||||
|
@ -463,13 +463,13 @@ static int demux_ogg_sub_reverse_id(demuxer_t *demuxer, int id);
|
||||
/// Try to print out comments and also check for LANGUAGE= tag
|
||||
static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vorbis_comment *vc)
|
||||
{
|
||||
char *hdr, *val;
|
||||
const char *hdr, *val;
|
||||
char **cmt = vc->user_comments;
|
||||
int index, i;
|
||||
ogg_demuxer_t *ogg_d = (ogg_demuxer_t *)d->priv;
|
||||
struct table {
|
||||
char *ogg;
|
||||
char *mp;
|
||||
const char *ogg;
|
||||
const char *mp;
|
||||
} table[] = {
|
||||
{ "ENCODED_USING", "Software" },
|
||||
{ "ENCODER_URL", "Encoder URL" },
|
||||
|
@ -12,7 +12,7 @@
|
||||
* An autodetection based on the extension is not a good idea, but we don't care ;-)
|
||||
*/
|
||||
static struct {
|
||||
char *extension;
|
||||
const char *extension;
|
||||
int demuxer_type;
|
||||
} extensions_table[] = {
|
||||
// { "mpeg", DEMUXER_TYPE_MPEG_PS },
|
||||
|
@ -94,7 +94,7 @@ struct CHANLIST {
|
||||
};
|
||||
|
||||
struct CHANLISTS {
|
||||
char *name;
|
||||
const char *name;
|
||||
const struct CHANLIST *list;
|
||||
int count;
|
||||
};
|
||||
|
@ -2290,7 +2290,7 @@ int mp_property_do(const char* name,int action, void* val) {
|
||||
/// List of the commands that can be handled by setting a property.
|
||||
static struct {
|
||||
/// property name
|
||||
char* name;
|
||||
const char* name;
|
||||
/// cmd id
|
||||
int cmd;
|
||||
/// set/adjust or toggle command
|
||||
@ -2300,7 +2300,7 @@ static struct {
|
||||
/// osd msg id if it must be shared
|
||||
int osd_id;
|
||||
/// osd msg template
|
||||
char* osd_msg;
|
||||
const char* osd_msg;
|
||||
} set_prop_cmd[] = {
|
||||
// audio
|
||||
{ "volume", MP_CMD_VOLUME, 0, OSD_VOLUME, -1, MSGTR_Volume },
|
||||
|
Loading…
Reference in New Issue
Block a user