scc

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

commit 50d3bd454474cd84404e4cb71b1d4b8a0a67987f
parent 0cbf86c7857fb758292db3a42d0be08eaf327aa8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 23 Aug 2019 22:10:30 +0100

[libmach] Remove Objsymdef type

This type was only creating noise in the interface.

Diffstat:
Minclude/scc/scc/mach.h | 8--------
Msrc/cmd/ranlib.c | 21+++++++++++++++------
Msrc/libmach/coff32/coff32xsetidx.c | 1-
3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/scc/scc/mach.h b/include/scc/scc/mach.h @@ -1,6 +1,5 @@ #define NR_SYMHASH 32 -typedef struct objsymdef Objsymdef; typedef struct objsec Objsec; typedef struct objsym Objsym; typedef struct objseg Objseg; @@ -38,13 +37,6 @@ struct objsym { Objsym *next, *hash; }; -struct objsymdef { - char *name; - int type; - long offset; - Objsymdef *hash, *next; -}; - struct objseg { unsigned long long size; unsigned long long value; diff --git a/src/cmd/ranlib.c b/src/cmd/ranlib.c @@ -16,12 +16,21 @@ #define NR_SYMDEF 32 +typedef struct symdef Symdef; + +struct symdef { + char *name; + int type; + long offset; + Symdef *hash, *next; +}; + static char *namidx; static long nsymbols; static int status, artype, nolib; static Objops *ops; static char *filename, *membname; -static Objsymdef *htab[NR_SYMDEF], *head; +static Symdef *htab[NR_SYMDEF], *head; static long offset; char *argv0; @@ -47,11 +56,11 @@ error(char *fmt, ...) status = EXIT_FAILURE; } -Objsymdef * +Symdef * lookup(char *name) { unsigned h; - Objsymdef *dp; + Symdef *dp; char *s; size_t len; @@ -87,7 +96,7 @@ lookup(char *name) static int newsymbol(Objsym *sym) { - Objsymdef *np; + Symdef *np; if (!isupper(sym->type) || sym->type == 'N') return 1; @@ -167,7 +176,7 @@ error: static void freehash(void) { - Objsymdef **npp, *next, *np; + Symdef **npp, *next, *np; for (npp = htab; npp < &htab[NR_SYMDEF]; npp++) *npp = NULL; @@ -272,7 +281,7 @@ ranlib(char *fname) long *offs, i; char **names; FILE *fp, *idx, *out; - Objsymdef *dp; + Symdef *dp; struct fprop prop; errno = 0; diff --git a/src/libmach/coff32/coff32xsetidx.c b/src/libmach/coff32/coff32xsetidx.c @@ -10,7 +10,6 @@ coff32xsetidx(int order, long nsyms, char *names[], long offs[], FILE *fp) { long i, n; size_t len; - Objsymdef *def; unsigned char buff[4]; pack(order, buff, "l", nsyms);