The contents of the snd_pcm_scope_ops structure are not going to be
changed, so we might as well declare is as constant. This change is
backwards compatible, and avoids warnings if some ops structure is
actually defined as const.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
-void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val);
+void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
+ const snd_pcm_scope_ops_t *val);
void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
struct _snd_pcm_scope {
int enabled;
char *name;
- snd_pcm_scope_ops_t *ops;
+ const snd_pcm_scope_ops_t *ops;
void *private_data;
struct list_head list;
};
* \param scope PCM meter scope
* \param val callbacks
*/
-void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val)
+void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, const snd_pcm_scope_ops_t *val)
{
scope->ops = val;
}