nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH 4/5] chars: speed up the determination whether s


From: Mike Frysinger
Subject: Re: [Nano-devel] [PATCH 4/5] chars: speed up the determination whether something is a control character
Date: Sun, 5 Jun 2016 16:47:01 -0400

On 05 Jun 2016 09:54, Benno Schulenberg wrote:
> On Sun, Jun 5, 2016, at 09:46, Benno Schulenberg wrote:
> > +   return ((c[0] & 0xE0) == 0 || c[0] == 127 ||
> > +                                   (c[0] == -62 && c[1] < -96));
> 
> My question is: is it permissible to assume that variables of type char
> will have values in the range -128 .. 127?  Or are there platforms where
> there are treated as all postive, 0 .. 255?

if you want signed char, you need to use "signed char".
some platforms (like powerpc) default to "unsigned char".
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]