[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Porting Lua to Windows Mobile Professional 6.5.3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 2 Jun 2011 13:57:17 -0300
> I changed that isdigit() back to isalnum() in the second loop, but
> added a check that ls->current is > 0. That works as well. I still
> don't know where that -1, 0xff comes from, but at least stuff works
> for now.
The -1 comes from Lua itself. It is EOZ, the mark for end of input.
Lua assumes that is*(-1) should be false. The ISO standard says that
these functions should accept EOF:
The header <ctype.h> declares several functions useful for classifying
and mapping characters.) In all cases the argument is an int, the
value of which shall be representable as an unsigned char or shall equal
the value of the macro EOF.
But actually the standard does not say that EOF should be -1 (it only
says that EOF should be a negative integer), nor that EOF could not be a
digit ;)
-- Roberto
- References:
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Reuben Thomas
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Luiz Henrique de Figueiredo
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Marc Balmer
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Luiz Henrique de Figueiredo
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Marc Balmer
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Luiz Henrique de Figueiredo
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Marc Balmer
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Marc Balmer
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Marc Balmer
- Re: Porting Lua to Windows Mobile Professional 6.5.3, Marc Balmer