Skip to contentSkip to conversation

CVS: alsa-lib/src/pcm pcm.c,1.271,1.272

alsa-cvslog Abramo Bagnara 4 participants 4 messages Mar 1, 2004 – Mar 2, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Jaroslav Kysela ha scritto:

Quoted 17 lines

Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19814

Modified Files:
pcm.c
Log Message:
Fixed return comment for *near() functions

Index: pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm.c,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -r1.271 -r1.272

pcm.c line 3421

Quoted 5 lines
pcm.c +1 -1
@@ -3418,7 +3418,7 @@
  * \param pcm PCM handle
  * \param params Configuration space
  * \param val target channels count, returned chosen channels count
- * \return chosen channels count
+ * \return 0 otherwise a negative error code if configuration space would become empty

*near() functions semantic cannot return error by design.

Taken for granted that configuration space on entry of function is not empty how it can become empty if I ask for *nearest* value?

Obviously at least one configuration exists, then in the worst case such value is returned.

Do you agree?

Signature · 12 lines
Abramo Bagnara                       mailto:[email protected]

Opera Unica                          Phone: +39.0546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
#2 lore raw
Quoted 2 lines

Taken for granted that configuration space on entry of function is not empty ....

can this be taken for granted?

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#3 lore raw
In reply to Abramo Bagnara
Quoted 6 lines · Abramo Bagnara

Jaroslav Kysela ha scritto:

Quoted 4 lines

Log Message:
Fixed return comment for *near() functions

+ * \return 0 otherwise a negative error code if configuration space would become empty

Quoted 7 lines

*near() functions semantic cannot return error by design.

Taken for granted that configuration space on entry of function is not empty how it can become empty if I ask for *nearest* value?

Obviously at least one configuration exists, then in the worst case such value is returned.

It may be possible that other errors than an empty configuration space could occur. For example, future ALSA versions might want to fail if an hotplug device has been unpluggeed, or the configuration space could have been reduced due to some outside influence.

I don't think we can guarantee that this function never ever fails.

Maybe we should simply drop the "if configuration space would become empty".

Regards,
Clemens

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#4 lore raw
In reply to Abramo Bagnara
Quoted 26 lines · Abramo Bagnara

Jaroslav Kysela ha scritto:

Quoted 17 lines

Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19814

Modified Files:
pcm.c
Log Message:
Fixed return comment for *near() functions

Index: pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm.c,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -r1.271 -r1.272

pcm.c line 3421

Quoted 5 lines
pcm.c +1 -1
@@ -3418,7 +3418,7 @@
  * \param pcm PCM handle
  * \param params Configuration space
  * \param val target channels count, returned chosen channels count
- * \return chosen channels count
+ * \return 0 otherwise a negative error code if configuration space would become empty

*near() functions semantic cannot return error by design.

Quoted 7 lines

Taken for granted that configuration space on entry of function is not empty how it can become empty if I ask for *nearest* value?

Obviously at least one configuration exists, then in the worst case such value is returned.

Do you agree?

Ok, I replace the phrase with "if configuration space is empty".

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click