From alsa-devel-owner@alsa.jcu.cz  Sun Dec 13 15:32:11 1998
Received: from sunu450.rz.ruhr-uni-bochum.de (sunu450.rz.ruhr-uni-bochum.de [134.147.222.33])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id PAA29711
	for <alsa-devel@alsa.jcu.cz>; Sun, 13 Dec 1998 15:31:27 +0100
Received: (qmail 27825 invoked from network); 13 Dec 1998 14:31:40 -0000
Received: from dialppp-3-115.rz.ruhr-uni-bochum.de (HELO localhost) (mail@134.147.3.115)
  by mailhost.rz.ruhr-uni-bochum.de with SMTP; 13 Dec 1998 14:31:40 -0000
Received: from brinkmds by localhost with local (Exim 2.02 #1 (Debian))
	id 0zpCYt-0006YM-00; Sun, 13 Dec 1998 15:31:55 +0100
Message-ID: <19981213153155.B24824@ruhr-uni-bochum.de>
Date: Sun, 13 Dec 1998 15:31:55 +0100
From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
To: alsa-devel@alsa.jcu.cz, alsa-devel@jcu.cz
Subject: Re: unsigned/signed mess
References: <m0zpA60-000BJJC@downstairs.db-bbs.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
In-Reply-To: <m0zpA60-000BJJC@downstairs.db-bbs.com>; from Chris Butler on Sun, Dec 13, 1998 at 11:53:55AM +0000
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Sun, Dec 13, 1998 at 11:53:55AM +0000, Chris Butler wrote:
> Hi,
> 
> In the info structures, the device numbers for mixers, pcm devices,
> etc are all unsigned integers. However, when alsa-lib requires a
> device number, the function prototype specifies an int, and not an
> unsigned int.
> 
> Is it possible to sort this confusion out? It is causing some trouble
> with the C++ interface (as C++ is more heavily typechecked).

My suggestion is that we use signed int for all. Using unsigned int to
ensure a value is positive is almost never a good idea, because implicit type
conversion works against this.

Unsigned int are good for bit fields, though.

Marcus


-- 
"Rhubarb is no Egyptian god."        Debian GNU/Linux        finger brinkmd@ 
Marcus Brinkmann                   http://www.debian.org    master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09

