mixer: make all mixer_plugin pointers const
The plugin structures must never be modified.
This commit is contained in:
parent
899eb5383d
commit
ad8561bfdc
@ -237,7 +237,7 @@ alsa_mixer_control(struct mixer_data *data, int cmd, void *arg)
|
||||
return false;
|
||||
}
|
||||
|
||||
struct mixer_plugin alsa_mixer = {
|
||||
const struct mixer_plugin alsa_mixer = {
|
||||
.init = alsa_mixer_init,
|
||||
.finish = alsa_mixer_finish,
|
||||
.configure = alsa_mixer_configure,
|
||||
|
@ -218,7 +218,7 @@ oss_mixer_control(struct mixer_data *data, int cmd, void *arg)
|
||||
return false;
|
||||
}
|
||||
|
||||
struct mixer_plugin oss_mixer = {
|
||||
const struct mixer_plugin oss_mixer = {
|
||||
.init = oss_mixer_init,
|
||||
.finish = oss_mixer_finish,
|
||||
.configure = oss_mixer_configure,
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "mixer_api.h"
|
||||
|
||||
void mixer_init(struct mixer *mixer, struct mixer_plugin *plugin)
|
||||
void mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin)
|
||||
{
|
||||
assert(plugin != NULL);
|
||||
assert(mixer != NULL);
|
||||
|
@ -25,8 +25,8 @@
|
||||
* list of currently implemented mixers
|
||||
*/
|
||||
|
||||
extern struct mixer_plugin alsa_mixer;
|
||||
extern struct mixer_plugin oss_mixer;
|
||||
extern const struct mixer_plugin alsa_mixer;
|
||||
extern const struct mixer_plugin oss_mixer;
|
||||
|
||||
struct mixer_data;
|
||||
|
||||
@ -65,11 +65,11 @@ struct mixer_plugin {
|
||||
};
|
||||
|
||||
struct mixer {
|
||||
struct mixer_plugin *plugin;
|
||||
const struct mixer_plugin *plugin;
|
||||
struct mixer_data *data;
|
||||
};
|
||||
|
||||
void mixer_init(struct mixer *mixer, struct mixer_plugin *plugin);
|
||||
void mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin);
|
||||
void mixer_finish(struct mixer *mixer);
|
||||
void mixer_configure(struct mixer *mixer, const struct config_param *param);
|
||||
bool mixer_open(struct mixer *mixer);
|
||||
|
Loading…
Reference in New Issue
Block a user