scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 4a33c80f5df444995c798cdacfba87a295b4f854
parent 328defa460951824dd063e52cf2ab377c15544fb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 23 Nov 2017 15:26:49 +0000

[lib/scc] Fix types of lpack/lunpack

The buffer pointer should be unsigned to avoid uneeded
sign extensions.

Diffstat:
Minc/scc.h | 4++--
Mlib/scc/lpack.c | 4++--
Mlib/scc/lunpack.c | 4++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/inc/scc.h b/inc/scc.h @@ -33,5 +33,5 @@ extern void dealloc(Alloc *allocp); extern void *new(Alloc *allocp); extern void delete(Alloc *allocp, void *p); extern int casecmp(const char *s1, const char *s2); -extern int lpack(char *dst, char *fmt, ...); -extern int lunpack(char *src, char *fmt, ...); +extern int lpack(unsigned char *dst, char *fmt, ...); +extern int lunpack(unsigned char *src, char *fmt, ...); diff --git a/lib/scc/lpack.c b/lib/scc/lpack.c @@ -3,9 +3,9 @@ #include "../../inc/scc.h" int -lpack(char *dst, char *fmt, ...) +lpack(unsigned char *dst, char *fmt, ...) { - char *bp; + unsigned char *bp; unsigned s; unsigned long l; unsigned long long q; diff --git a/lib/scc/lunpack.c b/lib/scc/lunpack.c @@ -3,9 +3,9 @@ #include "../../inc/scc.h" int -lunpack(char *src, char *fmt, ...) +lunpack(unsigned char *src, char *fmt, ...) { - char *bp, *cp; + unsigned char *bp, *cp; unsigned short *sp; unsigned s; unsigned long *lp, l;