From alsa-devel-owner@alsa.jcu.cz  Sun Dec 13 17:51:35 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 RAA06434
	for <alsa-devel@alsa.jcu.cz>; Sun, 13 Dec 1998 17:51:10 +0100
Received: (qmail 16796 invoked from network); 13 Dec 1998 16:51:25 -0000
Received: from dialppp-3-178.rz.ruhr-uni-bochum.de (HELO localhost) (mail@134.147.3.178)
  by mailhost.rz.ruhr-uni-bochum.de with SMTP; 13 Dec 1998 16:51:25 -0000
Received: from brinkmds by localhost with local (Exim 2.02 #1 (Debian))
	id 0zpElq-0006kk-00; Sun, 13 Dec 1998 17:53:26 +0100
Message-ID: <19981213175326.A25303@ruhr-uni-bochum.de>
Date: Sun, 13 Dec 1998 17:53:26 +0100
From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
To: alsa-devel@alsa.jcu.cz
Subject: Re: unsigned/signed mess
References: <19981213153155.B24824@ruhr-uni-bochum.de> <Pine.LNX.3.96.981213153958.3930D-100000@entry.jcu.cz>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
In-Reply-To: <Pine.LNX.3.96.981213153958.3930D-100000@entry.jcu.cz>; from Jaroslav Kysela on Sun, Dec 13, 1998 at 03:52:26PM +0100
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Sun, Dec 13, 1998 at 03:52:26PM +0100, Jaroslav Kysela wrote:
> On Sun, 13 Dec 1998, Marcus Brinkmann wrote:
> > On Sun, Dec 13, 1998 at 11:53:55AM +0000, Chris Butler wrote:
> > 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.
> 
> Note that device numbers are like constants. I don't see any reason for
> which implicit compiler conversion will be used (arithmetic operations
> willn't be applied for these constants).

Right. I didn't consider this.
 
> But if anyone change asound.h and recode kernel side conditions from
> 
> if (device >= MAX_DEVICES)
> 
> to
> 
> if (device < 0 || device >= MAX_DEVICES)
> 
> I'll include patch to ALSA driver sources...

Fair enough.

> There is a lot of other
> variables which are unsigned and should be signed (include strings)...
> For me are these changes only cosmetic which willn't have any other 
> result (than possible problems with negative values in kernel code
> if all conditions willn't be changed).

It would make the C++ code a _bit_ easier, thoiugh it has no priority, I or
Chris may do the changes.

Thanks,
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

