diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-15 09:35:32 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-15 09:35:32 -0300 |
| commit | fd5e810e0858162a2b11229db4f17dca489c9d41 (patch) | |
| tree | 7474606b40fa85efec537c989d02df4f9ec5b76c | |
| parent | 067f761739f4cfa29384dca8b35c532978d0f372 (diff) | |
| download | lua-fd5e810e0858162a2b11229db4f17dca489c9d41.tar.gz lua-fd5e810e0858162a2b11229db4f17dca489c9d41.tar.bz2 lua-fd5e810e0858162a2b11229db4f17dca489c9d41.zip | |
macro 'char2int' replaced by 'cast_uchar' (used by other files)
| -rw-r--r-- | lzio.c | 4 | ||||
| -rw-r--r-- | lzio.h | 6 |
2 files changed, 4 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lzio.c,v 1.32 2011/02/17 17:34:16 roberto Exp roberto $ | 2 | ** $Id: lzio.c,v 1.33 2011/02/23 13:13:10 roberto Exp roberto $ |
| 3 | ** a generic input stream interface | 3 | ** a generic input stream interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -29,7 +29,7 @@ int luaZ_fill (ZIO *z) { | |||
| 29 | return EOZ; | 29 | return EOZ; |
| 30 | z->n = size - 1; /* discount char being returned */ | 30 | z->n = size - 1; /* discount char being returned */ |
| 31 | z->p = buff; | 31 | z->p = buff; |
| 32 | return char2int(*(z->p++)); | 32 | return cast_uchar(*(z->p++)); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | 35 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lzio.h,v 1.23 2011/02/17 17:34:16 roberto Exp roberto $ | 2 | ** $Id: lzio.h,v 1.24 2011/02/23 13:13:10 roberto Exp roberto $ |
| 3 | ** Buffered streams | 3 | ** Buffered streams |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -17,9 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | typedef struct Zio ZIO; | 18 | typedef struct Zio ZIO; |
| 19 | 19 | ||
| 20 | #define char2int(c) cast(int, cast(unsigned char, (c))) | 20 | #define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) |
| 21 | |||
| 22 | #define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) | ||
| 23 | 21 | ||
| 24 | #define zungetc(z) ((z)->n++, (z)->p--) | 22 | #define zungetc(z) ((z)->n++, (z)->p--) |
| 25 | 23 | ||
