Skip to content
Snippets Groups Projects
Commit 552d82aa authored by neil's avatar neil
Browse files

Need to use some unsigned chars on mac; also cast to make explicit some const/non-const conversions

git-svn-id: http://svn.net-core.org/repos/t-engine4@2946 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0b2c674d
No related branches found
No related tags found
No related merge requests found
......@@ -2373,10 +2373,17 @@ static int lua_zlib_compress(lua_State *L)
uLongf len;
const char *data = luaL_checklstring(L, 1, (size_t*)&len);
uLongf reslen = len * 1.1 + 12;
#ifdef __APPLE__
unsigned
#endif
char *res = malloc(reslen);
z_stream zi;
zi.next_in = data;
zi.next_in = (
#ifdef __APPLE__
unsigned
#endif
char *)data;
zi.avail_in = len;
zi.total_in = 0;
......@@ -2411,7 +2418,7 @@ static int lua_zlib_compress(lua_State *L)
if (deflateStatus == Z_STREAM_END)
{
lua_pushlstring(L, res, zi.total_out);
lua_pushlstring(L, (char *)res, zi.total_out);
free(res);
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment