All of lore.kernel.org
 help / color / mirror / Atom feed
* Why is the bufs argument for snd_pcm_writen not const?
@ 2016-05-15  3:05 Trent Reed
  2016-05-16  6:58 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Trent Reed @ 2016-05-15  3:05 UTC (permalink / raw)
  To: alsa-devel

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?

Thanks,
- Trent Reed

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why is the bufs argument for snd_pcm_writen not const?
  2016-05-15  3:05 Why is the bufs argument for snd_pcm_writen not const? Trent Reed
@ 2016-05-16  6:58 ` Takashi Iwai
  2016-05-16  7:06   ` Trent Reed
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2016-05-16  6:58 UTC (permalink / raw)
  To: Trent Reed; +Cc: alsa-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why is the bufs argument for snd_pcm_writen not const?
  2016-05-16  6:58 ` Takashi Iwai
@ 2016-05-16  7:06   ` Trent Reed
  2016-05-16  7:12     ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Trent Reed @ 2016-05-16  7:06 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

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@suse.de> 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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why is the bufs argument for snd_pcm_writen not const?
  2016-05-16  7:06   ` Trent Reed
@ 2016-05-16  7:12     ` Takashi Iwai
       [not found]       ` <CAL6pMWof=PPBE6GnHjgmaBUeO+K8uw-XAEuRw_bG9RMcSi-=xA@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2016-05-16  7:12 UTC (permalink / raw)
  To: Trent Reed; +Cc: alsa-devel

On Mon, 16 May 2016 09:06:06 +0200,
Trent Reed wrote:
> 
> 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?

A patch is always welcome :)


Takashi

> 
> - Trent Reed
> On May 15, 2016 11:58 PM, "Takashi Iwai" <tiwai@suse.de> 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
> >
> [2  <text/html; UTF-8 (quoted-printable)>]
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why is the bufs argument for snd_pcm_writen not const?
       [not found]         ` <CAL6pMWocp13PuNHVg85WfmHqEzJ79Cz8kDMRnVJyfPoYDpZ89w@mail.gmail.com>
@ 2016-05-16  7:19           ` Trent Reed
  0 siblings, 0 replies; 5+ messages in thread
From: Trent Reed @ 2016-05-16  7:19 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Absolutely!

Sorry about that, I'm used to requesting changes and not being able to make
them myself. I'll ping the thread with the patch later this week. :)

Thanks,
- Trent Reed
On May 16, 2016 12:12 AM, "Takashi Iwai" <tiwai@suse.de> wrote:

On Mon, 16 May 2016 09:06:06 +0200,
Trent Reed wrote:
>
> 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?

A patch is always welcome :)


Takashi

>
> - Trent Reed
> On May 15, 2016 11:58 PM, "Takashi Iwai" <tiwai@suse.de> 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
> >
> [2  <text/html; UTF-8 (quoted-printable)>]
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-16  7:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-15  3:05 Why is the bufs argument for snd_pcm_writen not const? Trent Reed
2016-05-16  6:58 ` Takashi Iwai
2016-05-16  7:06   ` Trent Reed
2016-05-16  7:12     ` Takashi Iwai
     [not found]       ` <CAL6pMWof=PPBE6GnHjgmaBUeO+K8uw-XAEuRw_bG9RMcSi-=xA@mail.gmail.com>
     [not found]         ` <CAL6pMWocp13PuNHVg85WfmHqEzJ79Cz8kDMRnVJyfPoYDpZ89w@mail.gmail.com>
2016-05-16  7:19           ` Trent Reed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.