diff options
author | Diego Nehab <diego@impa.br> | 2015-03-01 22:49:04 -0300 |
---|---|---|
committer | Diego Nehab <diego@impa.br> | 2015-03-01 22:49:04 -0300 |
commit | 8396a0291b2d97bc837c4c55bb99f7f6777ce515 (patch) | |
tree | 3e65b498ff30b00b32819037e4bfa2719286e9c7 /src/mime.c | |
parent | 9d49cdcf05d49a99d9095d63318f11adc73c10d0 (diff) | |
download | luasocket-8396a0291b2d97bc837c4c55bb99f7f6777ce515.tar.gz luasocket-8396a0291b2d97bc837c4c55bb99f7f6777ce515.tar.bz2 luasocket-8396a0291b2d97bc837c4c55bb99f7f6777ce515.zip |
Better solution to luaL_checkint...
Diffstat (limited to 'src/mime.c')
-rw-r--r-- | src/mime.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -13,11 +13,6 @@ | |||
13 | 13 | ||
14 | #include "mime.h" | 14 | #include "mime.h" |
15 | 15 | ||
16 | #if LUA_VERSION_NUM > 502 && !defined(LUA_COMPAT_APIINTCASTS) | ||
17 | #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) | ||
18 | #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) | ||
19 | #endif | ||
20 | |||
21 | /*=========================================================================*\ | 16 | /*=========================================================================*\ |
22 | * Don't want to trust escape character constants | 17 | * Don't want to trust escape character constants |
23 | \*=========================================================================*/ | 18 | \*=========================================================================*/ |
@@ -666,7 +661,7 @@ static int eolprocess(int c, int last, const char *marker, | |||
666 | \*-------------------------------------------------------------------------*/ | 661 | \*-------------------------------------------------------------------------*/ |
667 | static int mime_global_eol(lua_State *L) | 662 | static int mime_global_eol(lua_State *L) |
668 | { | 663 | { |
669 | int ctx = luaL_checkint(L, 1); | 664 | int ctx = luaL_checkinteger(L, 1); |
670 | size_t isize = 0; | 665 | size_t isize = 0; |
671 | const char *input = luaL_optlstring(L, 2, NULL, &isize); | 666 | const char *input = luaL_optlstring(L, 2, NULL, &isize); |
672 | const char *last = input + isize; | 667 | const char *last = input + isize; |