Re: Why is the bufs argument for snd_pcm_writen not const?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Takashi,

I wasn't able to find anything about this in the documentation. Perhaps if
it isn't changed in the API, it could be added as a @note for Doxygen in
the functions?

- Trent Reed
On May 15, 2016 11:58 PM, "Takashi Iwai" <tiwai@xxxxxxx> wrote:

> On Sun, 15 May 2016 05:05:49 +0200,
> Trent Reed wrote:
> >
> > Hey All,
> >
> > Just wondering what the reasoning is behind snd_pcm_writen not having
> > a constant variable for bufs. To me, this doesn't make sense. Does
> > snd_pcm_writen make any alterations to bufs? I would expect one of the
> > following declaration:
> >
> > // Better, but doesn't promise that the API won't change the channel
> pointers.
> > snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t* pcm, const void** bufs,
> > snd_pcm_uframes_t size);
> > // Best, promises ALSA won't change channel pointers, wont change
> > underlying data.
> > snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t* pcm, const void*const*
> > bufs, snd_pcm_uframes_t size);
> >
> > For now, is it safe to assume that snd_pcm_writen() doesn't alter any
> > of the data in bufs passed into it? Any chance on seeing this patched
> > or is there some reason for this?
>
> We never thought of modifying the data inside the writen API
> function.  The lack of const is merely the laziness.
>
>
> Takashi
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux