summaryrefslogtreecommitdiffstats
path: root/m_option.h
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-02-25 22:32:28 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-02-25 22:32:28 +0000
commit42096a34d53b725eabfe90a59b1e3c2cee6cda9c (patch)
tree11f15b84f3cc9ded909cfb820b22d2864f2e3803 /m_option.h
parentb99077dc4c5a160ad3f70b0ae33c63bd62e19a96 (diff)
downloadmpv-42096a34d53b725eabfe90a59b1e3c2cee6cda9c.tar.bz2
mpv-42096a34d53b725eabfe90a59b1e3c2cee6cda9c.tar.xz
Make more option-parsing related function arguments const.
Prerequisite for making stream_open filename const in a proper way. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30737 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'm_option.h')
-rw-r--r--m_option.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/m_option.h b/m_option.h
index 3aa7ba930a..a70d8638d2 100644
--- a/m_option.h
+++ b/m_option.h
@@ -68,7 +68,7 @@ extern const m_option_type_t m_option_type_func;
typedef void (*m_opt_default_func_t)(const m_option_t *, const char*);
/// Callback used by m_option_type_func_full options.
-typedef int (*m_opt_func_full_t)(const m_option_t *, const char *, char *);
+typedef int (*m_opt_func_full_t)(const m_option_t *, const char *, const char *);
/// Callback used by m_option_type_func_param options.
typedef int (*m_opt_func_param_t)(const m_option_t *, const char *);
@@ -198,9 +198,9 @@ extern const m_obj_params_t m_span_params_def;
/// Option type description
struct m_option_type {
- char* name;
+ const char* name;
/// Syntax description, etc
- char* comments;
+ const char* comments;
/// Size needed for the data.
unsigned int size;
/// See \ref OptionTypeFlags.
@@ -218,7 +218,7 @@ struct m_option_type {
* \return On error a negative value is returned, on success the number of arguments
* consumed. For details see \ref OptionParserReturn.
*/
- int (*parse)(const m_option_t* opt,const char *name, char *param, void* dst, int src);
+ int (*parse)(const m_option_t* opt,const char *name, const char *param, void* dst, int src);
/// Print back a value in string form.
/** \param opt The option to print.
@@ -241,21 +241,21 @@ struct m_option_type {
* \param dst Pointer to the destination memory.
* \param src Pointer to the source memory.
*/
- void (*save)(const m_option_t* opt,void* dst, void* src);
+ void (*save)(const m_option_t* opt,void* dst, const void* src);
/// Set the value in the program (dst) from a save slot.
/** \param opt The option to copy.
* \param dst Pointer to the destination memory.
* \param src Pointer to the source memory.
*/
- void (*set)(const m_option_t* opt,void* dst, void* src);
+ void (*set)(const m_option_t* opt,void* dst, const void* src);
/// Copy the data between two save slots. If NULL and size is > 0 a memcpy will be used.
/** \param opt The option to copy.
* \param dst Pointer to the destination memory.
* \param src Pointer to the source memory.
*/
- void (*copy)(const m_option_t* opt,void* dst, void* src);
+ void (*copy)(const m_option_t* opt,void* dst, const void* src);
//@}
/// Free the data allocated for a save slot.
@@ -483,7 +483,7 @@ const m_option_t* m_option_list_find(const m_option_t* list,const char* name);
/// Helper to parse options, see \ref m_option_type::parse.
inline static int
-m_option_parse(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
+m_option_parse(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
return opt->type->parse(opt,name,param,dst,src);
}
@@ -498,21 +498,21 @@ m_option_print(const m_option_t* opt, const void* val_ptr) {
/// Helper around \ref m_option_type::save.
inline static void
-m_option_save(const m_option_t* opt,void* dst, void* src) {
+m_option_save(const m_option_t* opt,void* dst, const void* src) {
if(opt->type->save)
opt->type->save(opt,dst,src);
}
/// Helper around \ref m_option_type::set.
inline static void
-m_option_set(const m_option_t* opt,void* dst, void* src) {
+m_option_set(const m_option_t* opt,void* dst, const void* src) {
if(opt->type->set)
opt->type->set(opt,dst,src);
}
/// Helper around \ref m_option_type::copy.
inline static void
-m_option_copy(const m_option_t* opt,void* dst, void* src) {
+m_option_copy(const m_option_t* opt,void* dst, const void* src) {
if(opt->type->copy)
opt->type->copy(opt,dst,src);
else if(opt->type->size > 0)