1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
Origin: https://trac.macports.org/attachment/ticket/49481/cardpeek-lua5.3.patch
Author: Ryan Schmidt
---
--- a/lua_bytes.c.orig 2015-11-04 00:33:40.000000000 +0100
+++ b/lua_bytes.c 2015-11-04 00:32:44.000000000 +0100
@@ -116,7 +116,7 @@
static int subr_bytes_new(lua_State *L)
{
- int width = luaL_checkint(L, 1);
+ int width = luaL_checkinteger(L, 1);
int n = lua_gettop(L);
bytestring_t *bs;
@@ -259,7 +259,7 @@
b_index = 0;
else
{
- b_index=luaL_checkint(L,2);
+ b_index=luaL_checkinteger(L,2);
if (b_index<0) b_index = 0;
}
@@ -267,7 +267,7 @@
e_index = b_index;
else
{
- e_index=luaL_checkint(L,2);
+ e_index=luaL_checkinteger(L,2);
if (e_index>=(int)bytestring_get_size(bs)) e_index = bytestring_get_size(bs)-1;
}
@@ -293,13 +293,13 @@
unsigned i;
unsigned char c;
- b_index=(unsigned)luaL_checkint(L,2);
+ b_index=(unsigned)luaL_checkinteger(L,2);
e_index = b_index + lua_gettop(L)-3;
for (i=b_index;i<=e_index;i++)
{
- c = (unsigned char)luaL_checkint(L,i-b_index+3);
+ c = (unsigned char)luaL_checkinteger(L,i-b_index+3);
if (i<bytestring_get_size(bs))
{
bytestring_set_element(bs,i,c);
@@ -324,8 +324,8 @@
static int subr_bytes_pad_left(lua_State *L)
{
bytestring_t *bs = bytestring_duplicate(luaL_check_bytestring(L, 1));
- unsigned pad_length = luaL_checkint(L,2);
- unsigned pad_value = luaL_checkint(L,3);
+ unsigned pad_length = luaL_checkinteger(L,2);
+ unsigned pad_value = luaL_checkinteger(L,3);
if (bytestring_pad_left(bs,pad_length,pad_value)!=BYTESTRING_OK)
{
bytestring_free(bs);
@@ -340,8 +340,8 @@
static int subr_bytes_pad_right(lua_State *L)
{
bytestring_t *bs = bytestring_duplicate(luaL_check_bytestring(L, 1));
- unsigned pad_length = luaL_checkint(L,2);
- unsigned pad_value = luaL_checkint(L,3);
+ unsigned pad_length = luaL_checkinteger(L,2);
+ unsigned pad_value = luaL_checkinteger(L,3);
if (bytestring_pad_right(bs,pad_length,pad_value)!=BYTESTRING_OK)
{
bytestring_free(bs);
@@ -376,12 +376,12 @@
static int subr_bytes_sub(lua_State *L)
{
bytestring_t *bs = luaL_check_bytestring(L, 1);
- int start=luaL_checkint(L,2);
+ int start=luaL_checkinteger(L,2);
int end=-1;
bytestring_t *ret;
if (lua_gettop(L)>2)
- end=luaL_checkint(L,3);
+ end=luaL_checkinteger(L,3);
if (start<0)
start=bytestring_get_size(bs)+start;
if (end<0)
@@ -431,13 +431,13 @@
"\tchange bytes.convert(A,B) to bytes.convert(B,A)\n"
"\tThis warning will only appear once.");
}
- width=luaL_checkint(L,1);
+ width=luaL_checkinteger(L,1);
bs = luaL_check_bytestring(L, 2);
}
else
{
bs = luaL_check_bytestring(L, 1);
- width=luaL_checkint(L,2);
+ width=luaL_checkinteger(L,2);
}
if (width!=8 && width!=4 && width!=1)
|