Ticket #49481: cardpeek-lua5.3.patch

File cardpeek-lua5.3.patch, 4.3 KB (added by db_macports@…, 8 years ago)
  • sysutils/cardpeek/Portfile

    diff -Naur -x work -x .DS_Store /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/sysutils/cardpeek/Portfile sysutils/cardpeek/Portfile
    old new  
    11# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
    2 # $Id: Portfile 140065 2015-09-08 11:06:08Z ryandesign@macports.org $
     2# $Id: Portfile 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
    33
    44PortSystem 1.0
    55
     
    2424checksums       rmd160 0d1118586f85512d4483d6be027921ecc222c1f8 \
    2525                sha256 9c78dfdf84493c551b49447e4bb46c8d7b33f0785b93893222b70b6115013a85
    2626
     27patchfiles      patch-lua_bytes.c.diff
     28
    2729depends_build   port:pkgconfig
    2830
    2931depends_lib     port:gtk3 path:lib/pkgconfig/glib-2.0.pc:glib2 port:lua port:libiconv port:curl path:lib/libssl.dylib:openssl
  • sysutils/cardpeek/files/patch-lua_bytes.c.diff

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