From e634fbcf2b208150971780538dba6ed8be56cb8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 21 Oct 2006 17:49:35 +0000 Subject: [PATCH] const rulez --- include/configuration.h | 24 ++++++++++++------------ include/modules.h | 12 ++++++------ include/vlc_common.h | 2 +- include/vlc_keys.h | 4 ++-- src/libvlc.h | 16 ++++++++-------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/configuration.h b/include/configuration.h index 3e0c0dc691..7cb65edb28 100644 --- a/include/configuration.h +++ b/include/configuration.h @@ -113,18 +113,18 @@ struct config_category_t { int i_id; - char *psz_name; - char *psz_help; + const char *psz_name; + const char *psz_help; }; struct module_config_t { int i_type; /* Configuration type */ - char *psz_type; /* Configuration subtype */ - char *psz_name; /* Option name */ + const char *psz_type; /* Configuration subtype */ + const char *psz_name; /* Option name */ char i_short; /* Optional short option name */ - char *psz_text; /* Short comment on the configuration option */ - char *psz_longtext; /* Long comment on the configuration option */ + const char *psz_text; /* Short comment on the configuration option */ + const char *psz_longtext; /* Long comment on the configuration option */ char *psz_value; /* Option value */ int i_value; /* Option value */ float f_value; /* Option value */ @@ -138,18 +138,18 @@ struct module_config_t void *p_callback_data; /* Values list */ - char **ppsz_list; /* List of possible values for the option */ + const char **ppsz_list; /* List of possible values for the option */ int *pi_list; /* Idem for integers */ - char **ppsz_list_text; /* Friendly names for list values */ + const char **ppsz_list_text; /* Friendly names for list values */ int i_list; /* Options list size */ /* Actions list */ vlc_callback_t *ppf_action; /* List of possible actions for a config */ - char **ppsz_action_text; /* Friendly names for actions */ + const char **ppsz_action_text; /* Friendly names for actions */ int i_action; /* actions list size */ /* Deprecated */ - char *psz_current; /* Good option name */ + const char *psz_current; /* Good option name */ vlc_bool_t b_strict; /* Transitionnal or strict */ /* Misc */ vlc_mutex_t *p_lock; /* Lock to use when modifying the config */ @@ -160,12 +160,12 @@ struct module_config_t /* to take effect */ /* Original option values */ - char *psz_value_orig; + const char *psz_value_orig; int i_value_orig; float f_value_orig; /* Option values loaded from config file */ - char *psz_value_saved; + const char *psz_value_saved; int i_value_saved; float f_value_saved; vlc_bool_t b_autosave; /* Config will be auto-saved at exit time */ diff --git a/include/modules.h b/include/modules.h index 41def36da3..c1151ae2cb 100644 --- a/include/modules.h +++ b/include/modules.h @@ -85,18 +85,18 @@ struct module_t /* * Variables set by the module to identify itself */ - char *psz_shortname; /* Module name */ - char *psz_longname; /* Module descriptive name */ - char *psz_help; /* Long help string for "special" modules */ + const char *psz_shortname; /* Module name */ + const char *psz_longname; /* Module descriptive name */ + const char *psz_help; /* Long help string for "special" modules */ /* * Variables set by the module to tell us what it can do */ - char *psz_program; /* Program name which will activate the module */ + const char *psz_program; /* Program name which will activate the module */ - char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; /* Shortcuts to the module */ + const char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; /* Shortcuts to the module */ - char *psz_capability; /* Capability */ + const char *psz_capability; /* Capability */ int i_score; /* Score for each capability */ uint32_t i_cpu; /* Required CPU capabilities */ diff --git a/include/vlc_common.h b/include/vlc_common.h index 9e47f2ba47..5edb253f24 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -499,7 +499,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ int i_object_id; \ int i_object_type; \ const char *psz_object_type; \ - char *psz_object_name; \ + const char *psz_object_name; \ \ /* Messages header */ \ char *psz_header; \ diff --git a/include/vlc_keys.h b/include/vlc_keys.h index f8380806f3..4ae6358ebb 100644 --- a/include/vlc_keys.h +++ b/include/vlc_keys.h @@ -83,7 +83,7 @@ typedef struct key_descriptor_s { - char *psz_key_string; + const char *psz_key_string; int i_key_code; } key_descriptor_t; @@ -188,7 +188,7 @@ static const struct key_descriptor_s vlc_keys[] = { "Media Play Pause", KEY_MEDIA_PLAY_PAUSE } }; -static inline char *KeyToString( int i_key ) +static inline const char *KeyToString( int i_key ) { unsigned int i = 0; for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ ) diff --git a/src/libvlc.h b/src/libvlc.h index fb9ee1f2ae..f8ba5d36e2 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -29,12 +29,12 @@ #include "vlc_meta.h" #if defined (WIN32) || defined (__APPLE__) -static char *ppsz_language[] = +static const char *ppsz_language[] = { "auto", "en", "en_GB", "ca", "cs", "da", "de", "es", "fr", "gl", "he", "hu", "it", "ja", "ka", "ko", "ms", "nl", "oc", "pt_BR", "ro", "ru", "sk", "sv", "tr", "zh_CN", "zh_TW" }; -static char *ppsz_language_text[] = +static const char *ppsz_language_text[] = { N_("Auto"), N_("American English"), N_("British English"), N_("Catalan"), N_("Czech"), N_("Danish"), N_("German"), N_("Spanish"), N_("French"), N_("Galician"), N_("Hebrew"), N_("Hungarian"),N_("Italian"), @@ -44,7 +44,7 @@ N_("Slovak"), N_("Turkish"), N_("Simplified Chinese"), N_("Chinese Traditional") }; #endif -static char *ppsz_snap_formats[] = +static const char *ppsz_snap_formats[] = { "png", "jpg" }; /***************************************************************************** @@ -199,7 +199,7 @@ static char *ppsz_snap_formats[] = "enhance your experience, especially when combined with the Headphone "\ "Channel Mixer." ) static int pi_force_dolby_values[] = { 0, 1, 2 }; -static char *ppsz_force_dolby_descriptions[] = { N_("Auto"), N_("On"), N_("Off") }; +static const char *ppsz_force_dolby_descriptions[] = { N_("Auto"), N_("On"), N_("Off") }; #define AUDIO_FILTER_TEXT N_("Audio filters") @@ -264,7 +264,7 @@ static char *ppsz_force_dolby_descriptions[] = { N_("Auto"), N_("On"), N_("Off") "will be centered (0=center, 1=left, 2=right, 4=top, 8=bottom, you can " \ "also use combinations of these values, like 6=4+2 meaning top-right).") static int pi_align_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; -static char *ppsz_align_descriptions[] = +static const char *ppsz_align_descriptions[] = { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") }; @@ -419,7 +419,7 @@ static char *ppsz_align_descriptions[] = "are available in Advanced / Network Sync." ) static int pi_clock_values[] = { -1, 0, 1 }; -static char *ppsz_clock_descriptions[] = +static const char *ppsz_clock_descriptions[] = { N_("Default"), N_("Disable"), N_("Enable") }; #define SERVER_PORT_TEXT N_("UDP port") @@ -948,7 +948,7 @@ static int pi_albumart_values[] = { ALBUM_ART_NEVER, ALBUM_ART_WHEN_ASKED, ALBUM_ART_WHEN_PLAYED, ALBUM_ART_ALL }; -static char *ppsz_albumart_descriptions[] = +static const char *ppsz_albumart_descriptions[] = { N_("Never download"), N_("Download when asked"), N_("Download when track starts playing"), N_("Download everything ASAP") }; @@ -989,7 +989,7 @@ static char *ppsz_albumart_descriptions[] = "contents of a directory. \"Default\" means that the tree will only " \ "be used when really needed." ) static int pi_pltree_values[] = { 0, 1, 2 }; -static char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N_("Never") }; +static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N_("Never") }; -- 2.39.5