summaryrefslogtreecommitdiff
path: root/src/libexecline/el_parse.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-07 20:31:02 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-07 20:31:02 +0000
commit6a9ca73e10c3c4e8a95101313e9c5d46cf018f86 (patch)
tree41ae80cb08fa1e280012b799ad0d1e63090b19bc /src/libexecline/el_parse.c
parent6245dcef12eed3b12b129519eeaf11f7e221d278 (diff)
downloadexecline-6a9ca73e10c3c4e8a95101313e9c5d46cf018f86.tar.xz
Types fix: first pass
This pass makes variable size_t-ready, so everything works when the prototypes are fixed in skalibs. Some code uses "unsigned int *" where it should be "size_t *"; it cannot be changed now, but it's been marked with XXX. It must change at the same time as the skalibs API.
Diffstat (limited to 'src/libexecline/el_parse.c')
-rw-r--r--src/libexecline/el_parse.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libexecline/el_parse.c b/src/libexecline/el_parse.c
index 1544f51..acff34a 100644
--- a/src/libexecline/el_parse.c
+++ b/src/libexecline/el_parse.c
@@ -1,6 +1,7 @@
/* ISC license. */
-#include <skalibs/uint16.h>
+#include <sys/types.h>
+#include <stdint.h>
#include <skalibs/uint.h>
#include <skalibs/bytestr.h>
#include <skalibs/stralloc.h>
@@ -10,7 +11,7 @@
int el_parse (stralloc *sa, el_chargen_func_t_ref next, void *source)
{
static unsigned char const class[256] = "`aaaaaaaaadaaaaaaaaaaaaaaaaaaaaaafcbffffffffffffjhhhhhhhiifffffffmmmmmmfffffffffffffffffffffeffffggmmmgfffffffkfffkfkfkflffnfoffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ;
- static uint16 const table[16][16] =
+ static uint16_t const table[16][16] =
{
{ 0x0011, 0x4011, 0x0010, 0x0010, 0x0010, 0x0011, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x4091 },
{ 0x0000, 0x4000, 0x8001, 0x8003, 0x8003, 0x0005, 0x0010, 0x8403, 0x8403, 0x8403, 0x8403, 0x0010, 0x8403, 0x8403, 0x0100, 0x4080 },
@@ -30,14 +31,14 @@ int el_parse (stralloc *sa, el_chargen_func_t_ref next, void *source)
{ 0x820f, 0x8001, 0x8001, 0x8003, 0x8003, 0x0005, 0x0010, 0x8403, 0x8403, 0x8403, 0x8403, 0x0010, 0x8403, 0x8403, 0x8001, 0x8001 }
} ;
- unsigned int mark = 0 ;
- unsigned int n = 0 ;
+ size_t mark = 0 ;
+ int n = 0 ;
unsigned int blevel = 0 ;
unsigned char state = 0, base = 10 ;
while (state < 0x10)
{
- uint16 c ;
+ uint16_t c ;
unsigned char cur ;
if (!(*next)(&cur, source)) return -1 ;
c = table[class[cur]-'`'][state] ;