From: Immanuel Litzroth Subject: snd_card_load Date: 24 Jun 2005 13:28:08 +0200 Message-ID: Return-path: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org I am currently writing some C++ classes around parts of the alsa api. I have a lot of work figuring out the semantics of the alsa calls and am using a combination of the doxygen documentation, the alsalib source and the sources to programs that use alsa. The problem I ran into yesterday concerns the snd_card_load function. 1) the documentation states that that functions returns 0 if the driver is not present and 1 if it is. The code at the end of the function goes: if (open_dev >= 0) { close (open_dev); return 0; } return open_dev ? 1 : 0; it seems to me that 0 is returned if the driver is loaded and 1 if it is not. moreover the last expression (return open_dev ? 1 : 0;) is superflous and should be just "return 1;" 2) somewhat further in snd_card_get_index the following tests are made if(snd_card_load(card) >= 0) --> always true if(snd_card_load(card) < 0) --> always false Am I missing something? Immanuel *************************************************************************** I can, I can't. Tubbs Tattsyrup -- Immanuel Litzroth Software Development Engineer Enfocus Software Antwerpsesteenweg 41-45 9000 Gent Belgium Voice: +32 9 269 23 90 Fax : +32 9 269 16 91 Email: Immanuell@enfocus.be web : www.enfocus.be *************************************************************************** ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click