diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-12-02 11:26:54 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-12-02 11:26:54 -0200 |
commit | ca9c405fef78137453502c5d7fd1dee64fdf3a02 (patch) | |
tree | 82b3af416637ad743eed3f1ff73a327bd5ac19a5 /lmem.h | |
parent | e2feb886d688bfc96697b634f03e7cc319234139 (diff) | |
download | lua-ca9c405fef78137453502c5d7fd1dee64fdf3a02.tar.gz lua-ca9c405fef78137453502c5d7fd1dee64fdf3a02.tar.bz2 lua-ca9c405fef78137453502c5d7fd1dee64fdf3a02.zip |
some compilers (e.g., gcc C++) do not accept NULL as a pointer in
that context
Diffstat (limited to 'lmem.h')
-rw-r--r-- | lmem.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmem.h,v 1.36 2010/04/08 17:16:46 roberto Exp roberto $ | 2 | ** $Id: lmem.h,v 1.37 2011/11/30 12:42:49 roberto Exp roberto $ |
3 | ** Interface to Memory Manager | 3 | ** Interface to Memory Manager |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -15,9 +15,9 @@ | |||
15 | 15 | ||
16 | 16 | ||
17 | #define luaM_reallocv(L,b,on,n,e) \ | 17 | #define luaM_reallocv(L,b,on,n,e) \ |
18 | ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ | 18 | ((cast(size_t, (n)+1) > MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ |
19 | luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ | 19 | (luaM_toobig(L), (void *)0) : \ |
20 | (luaM_toobig(L), NULL)) | 20 | luaM_realloc_(L, (b), (on)*(e), (n)*(e))) |
21 | 21 | ||
22 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) | 22 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) |
23 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) | 23 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) |