scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 9fa6e648d66374ab74185dc11c5fb385ddee8f54
parent 0c97aafd0bcc755fd297d534ffd5119a9d79a6cf
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  9 Aug 2019 16:58:05 +0100

[libscc] Remove outdated bits about pack/unpack

These functions were removed fom libscc long time ago
but there were some functions that still were in the library
and some declarations in scc.h.

Diffstat:
Minclude/scc/scc/scc.h | 4----
Dsrc/libscc/bpack.c | 64----------------------------------------------------------------
2 files changed, 0 insertions(+), 68 deletions(-)

diff --git a/include/scc/scc/scc.h b/include/scc/scc/scc.h @@ -35,8 +35,4 @@ 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(unsigned char *dst, char *fmt, ...); -extern int lunpack(unsigned char *src, char *fmt, ...); -extern int bpack(unsigned char *dst, char *fmt, ...); -extern int bunpack(unsigned char *src, char *fmt, ...); extern unsigned genhash(char *name); diff --git a/src/libscc/bpack.c b/src/libscc/bpack.c @@ -1,64 +0,0 @@ -#include <ctype.h> -#include <stdarg.h> - -#include <scc/scc.h> - -int -bpack(unsigned char *dst, char *fmt, ...) -{ - unsigned char *bp, *cp; - unsigned s; - unsigned long l; - unsigned long long q; - size_t n; - int d; - va_list va; - - bp = dst; - va_start(va, fmt); - while (*fmt) { - switch (*fmt++) { - case '\'': - for (n = 0; isdigit(*fmt); n += d) { - n *= 10; - d = *fmt++ - '0'; - } - cp = va_arg(va, unsigned char *); - while (n--) - *bp++ = *cp++; - break; - case 'c': - *bp++ = va_arg(va, unsigned); - break; - case 's': - s = va_arg(va, unsigned); - *bp++ = s >> 8; - *bp++ = s; - break; - case 'l': - l = va_arg(va, unsigned long); - *bp++ = l >> 24; - *bp++ = l >> 16; - *bp++ = l >> 8; - *bp++ = l; - break; - case 'q': - q = va_arg(va, unsigned long long); - *bp++ = q >> 56; - *bp++ = q >> 48; - *bp++ = q >> 40; - *bp++ = q >> 32; - *bp++ = q >> 24; - *bp++ = q >> 16; - *bp++ = q >> 8; - *bp++ = q; - break; - default: - va_end(va); - return -1; - } - } - va_end(va); - - return bp - dst; -}