From d5a83fd73e2eb14dd9e20cda3719710369fb2022 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 18 Jan 2017 19:55:56 +0100 Subject: [PATCH] Clean up the led includes. --- util/led/archive.c | 2 +- util/led/error.c | 8 +++++--- util/led/extract.c | 4 +++- util/led/finish.c | 4 ++++ util/led/main.c | 4 +++- util/led/memory.c | 15 +++++++++------ util/led/output.c | 6 +++++- util/led/read.c | 5 +++++ util/led/save.c | 4 +++- util/led/scan.c | 4 +++- util/led/sym.c | 8 +++++--- util/led/write.c | 6 ++++-- 12 files changed, 50 insertions(+), 20 deletions(-) diff --git a/util/led/archive.c b/util/led/archive.c index 7cb3397b8..7e39e9fb7 100644 --- a/util/led/archive.c +++ b/util/led/archive.c @@ -6,8 +6,8 @@ static char rcsid[] = "$Id$"; #endif -#include #include +#include #include #include #include "arch.h" diff --git a/util/led/error.c b/util/led/error.c index e7f4fc6ec..61dc7983e 100644 --- a/util/led/error.c +++ b/util/led/error.c @@ -6,9 +6,11 @@ static char rcsid[] = "$Id$"; #endif -#include -#include #include +#include +#include +#include +#include #include #include "const.h" @@ -73,7 +75,7 @@ do_verbose(char *format, ...) static void diag(char *tail, char *format, va_list ap) { - extern char *progname, *archname, *modulname; + extern char *progname, *archname, *modulname; fprintf(stderr, "%s: ", progname); if (archname && modulname) diff --git a/util/led/extract.c b/util/led/extract.c index 5878d527d..48a2f16c6 100644 --- a/util/led/extract.c +++ b/util/led/extract.c @@ -6,8 +6,10 @@ static char rcsid[] = "$Id$"; #endif -#include #include +#include +#include +#include #include "out.h" #include "const.h" #include "debug.h" diff --git a/util/led/finish.c b/util/led/finish.c index 2eace760b..439d4b364 100644 --- a/util/led/finish.c +++ b/util/led/finish.c @@ -6,6 +6,10 @@ static char rcsid[] = "$Id$"; #endif +#include +#include +#include +#include #include #include "const.h" #include "defs.h" diff --git a/util/led/main.c b/util/led/main.c index 028bc3b3f..125f0c9a5 100644 --- a/util/led/main.c +++ b/util/led/main.c @@ -11,7 +11,9 @@ static char rcsid[] = "$Id$"; */ #include +#include #include +#include #include #include "const.h" #include "debug.h" @@ -168,7 +170,7 @@ first_pass(argv) case 'c': /* * Leave relocation information in the output, so that - * a next pass can see where relocation was done. The + * a next pass can see where relocation was done. The * resulting output however is no longer relocatable. */ flagword &= ~RFLAG; diff --git a/util/led/memory.c b/util/led/memory.c index 6349c826a..df4ee99d9 100644 --- a/util/led/memory.c +++ b/util/led/memory.c @@ -22,6 +22,9 @@ static char rcsid[] = "$Id$"; */ #include +#include +#include +#include #include #include "const.h" #include "assert.h" @@ -112,7 +115,7 @@ init_core() incore = FALSE; /* In core strategy failed. */ if (sbreak(AT_LEAST) == -1) fatal("no core at all"); - + base = BASE; for (mem = mems; mem < &mems[NMEMS]; mem++) { mem->mem_base = base; @@ -198,15 +201,15 @@ compact(piece, incr, flag) gain = (mem->mem_full + incr) >> SHIFT_COUNT; if (incr < gain) incr = gain; } - + /* * First, check that moving will result in enough space */ if (flag != FREEZE) { gain = mem->mem_left; for (mem = &mems[piece-1]; mem >= &mems[0]; mem--) { - /* - * Don't give it all away! + /* + * Don't give it all away! * If this does not give us enough, bad luck */ if (flag == FORCED) @@ -224,8 +227,8 @@ compact(piece, incr, flag) } if (min == piece) for (mem = &mems[piece+1]; mem <= &mems[NMEMS - 1]; mem++) { - /* - * Don't give it all away! + /* + * Don't give it all away! * If this does not give us enough, bad luck */ if (flag == FORCED) diff --git a/util/led/output.c b/util/led/output.c index 0ee622e3a..835627631 100644 --- a/util/led/output.c +++ b/util/led/output.c @@ -6,6 +6,10 @@ static char rcsid[] = "$Id$"; #endif +#include +#include +#include +#include #include #include "const.h" #include "memory.h" @@ -60,7 +64,7 @@ generate_section_names() extern struct outsect outsect[]; extern char *core_alloc(); - size = (long)outhead.oh_nsect * sizeof(struct outname); + size = (long)outhead.oh_nsect * sizeof(struct outname); name = (struct outname *)core_alloc(ALLOGLOB, size); if (name == (struct outname *)0) return; diff --git a/util/led/read.c b/util/led/read.c index 95ec7dd6b..3ea15925c 100644 --- a/util/led/read.c +++ b/util/led/read.c @@ -6,6 +6,11 @@ static char rcsid[] = "$Id$"; #endif +#include +#include +#include +#include + int infile; /* The current input file. */ rd_fatal() diff --git a/util/led/save.c b/util/led/save.c index 3804413d9..952649633 100644 --- a/util/led/save.c +++ b/util/led/save.c @@ -10,8 +10,10 @@ static char rcsid[] = "$Id$"; * If everything is kept in core, we must save some things for the second pass. */ -#include #include +#include +#include +#include #include #include "arch.h" #include "out.h" diff --git a/util/led/scan.c b/util/led/scan.c index a870f8e05..1740a14de 100644 --- a/util/led/scan.c +++ b/util/led/scan.c @@ -6,8 +6,10 @@ static char rcsid[] = "$Id$"; #endif -#include #include +#include +#include +#include #ifdef SYMDBUG #include #include diff --git a/util/led/sym.c b/util/led/sym.c index 2ec47b6b7..53f0f3440 100644 --- a/util/led/sym.c +++ b/util/led/sym.c @@ -10,8 +10,10 @@ static char rcsid[] = "$Id$"; * Symbol table management. */ -#include #include +#include +#include +#include #include "out.h" #include "const.h" #include "memory.h" @@ -49,7 +51,7 @@ init_symboltable() * in the hash table is followed. If the names match, a pointer to the outname * in this element of the list is returned. When a match cannot be found, * NIL is returned. - */ + */ struct outname * searchname(string, hashval) char *string; @@ -74,7 +76,7 @@ searchname(string, hashval) debug("found %x, %x, %lx\n", name->on_type, name->on_desc, name->on_valu, 0); return name; - } + } symindex = sym->sy_next; } /* Not found. */ diff --git a/util/led/write.c b/util/led/write.c index d77ea98ef..b916949ae 100644 --- a/util/led/write.c +++ b/util/led/write.c @@ -6,8 +6,10 @@ static char rcsid[] = "$Id$"; #endif -#include #include +#include +#include +#include #include #include "out.h" #include "const.h" @@ -75,7 +77,7 @@ end_write() for (sectindex = 0; sectindex < outhead.oh_nsect; sectindex++) wrt_name(sectname(sectindex), 1); } - + wrt_emit(emit, sectindex, cnt) char *emit; int sectindex;