new macro 'luaM_reallocvchar' to allocate arrays of chars (avoids

uneeded tests and respective warnings)
This commit is contained in:
Roberto Ierusalimschy
2014-12-19 11:45:40 -02:00
parent 2b83711fba
commit 6321041058
2 changed files with 9 additions and 3 deletions

5
lzio.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: lzio.h,v 1.27 2013/06/07 14:51:10 roberto Exp roberto $
** $Id: lzio.h,v 1.28 2014/01/31 15:14:22 roberto Exp roberto $
** Buffered streams
** See Copyright Notice in lua.h
*/
@@ -37,7 +37,8 @@ typedef struct Mbuffer {
#define luaZ_resizebuffer(L, buff, size) \
(luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
((buff)->buffer = cast(char *, luaM_reallocvchar(L, (buff)->buffer, \
(buff)->buffsize, size)), \
(buff)->buffsize = size)
#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)