Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/config Use per-suffix lists where appropriate.
details: https://anonhg.NetBSD.org/src/rev/e952ba31e110
branches: trunk
changeset: 340354:e952ba31e110
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Tue Sep 01 12:10:56 2015 +0000
description:
Use per-suffix lists where appropriate.
diffstat:
usr.bin/config/defs.h | 4 +---
usr.bin/config/files.c | 14 +++++++++-----
usr.bin/config/mkmakefile.c | 18 ++++++++----------
3 files changed, 18 insertions(+), 18 deletions(-)
diffs (143 lines):
diff -r ae0396af72a6 -r e952ba31e110 usr.bin/config/defs.h
--- a/usr.bin/config/defs.h Tue Sep 01 11:35:46 2015 +0000
+++ b/usr.bin/config/defs.h Tue Sep 01 12:10:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.77 2015/09/01 11:35:46 uebayasi Exp $ */
+/* $NetBSD: defs.h,v 1.78 2015/09/01 12:10:56 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -481,8 +481,6 @@
struct filelist allcfiles; /* list of all .c files */
struct filelist allsfiles; /* list of all .S files */
struct filelist allofiles; /* list of all .o files */
-TAILQ_HEAD(, files) allobjects; /* list of all kernel object and
- library files */
SLIST_HEAD(, prefix) prefixes, /* prefix stack */
allprefixes; /* all prefixes used (after popped) */
diff -r ae0396af72a6 -r e952ba31e110 usr.bin/config/files.c
--- a/usr.bin/config/files.c Tue Sep 01 11:35:46 2015 +0000
+++ b/usr.bin/config/files.c Tue Sep 01 12:10:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: files.c,v 1.22 2015/09/01 11:22:59 uebayasi Exp $ */
+/* $NetBSD: files.c,v 1.23 2015/09/01 12:10:56 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: files.c,v 1.22 2015/09/01 11:22:59 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.23 2015/09/01 12:10:56 uebayasi Exp $");
#include <sys/param.h>
#include <errno.h>
@@ -85,7 +85,6 @@
TAILQ_INIT(&allsfiles);
TAILQ_INIT(&allofiles);
unchecked = &TAILQ_FIRST(&allfiles);
- TAILQ_INIT(&allobjects);
}
void
@@ -177,13 +176,18 @@
TAILQ_INSERT_TAIL(&allfiles, fi, fi_next);
break;
case 'S':
+ fi->fi_suffix = 's';
+ /* FALLTHRU */
case 's':
TAILQ_INSERT_TAIL(&allsfiles, fi, fi_snext);
TAILQ_INSERT_TAIL(&allfiles, fi, fi_next);
break;
case 'o':
TAILQ_INSERT_TAIL(&allofiles, fi, fi_snext);
- TAILQ_INSERT_TAIL(&allobjects, fi, fi_next);
+ break;
+ default:
+ cfgxerror(fi->fi_srcfile, fi->fi_srcline,
+ "unknown suffix");
break;
}
return;
@@ -331,7 +335,7 @@
int err, sel;
err = 0;
- TAILQ_FOREACH(fi, &allobjects, fi_next) {
+ TAILQ_FOREACH(fi, &allofiles, fi_snext) {
/* Optional: see if it is to be included. */
if (fi->fi_optx != NULL) {
flathead = NULL;
diff -r ae0396af72a6 -r e952ba31e110 usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c Tue Sep 01 11:35:46 2015 +0000
+++ b/usr.bin/config/mkmakefile.c Tue Sep 01 12:10:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkmakefile.c,v 1.53 2015/09/01 11:35:46 uebayasi Exp $ */
+/* $NetBSD: mkmakefile.c,v 1.54 2015/09/01 12:10:56 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.53 2015/09/01 11:35:46 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.54 2015/09/01 12:10:56 uebayasi Exp $");
#include <sys/param.h>
#include <ctype.h>
@@ -63,7 +63,7 @@
*/
static void emitdefs(FILE *);
-static void emitfiles(FILE *, int, int);
+static void emitfiles(FILE *, struct filelist *, int);
static void emitobjs(FILE *);
static void emitallkobjs(FILE *);
@@ -320,7 +320,7 @@
continue;
fprintf(fp, "\t%s.o \\\n", fi->fi_base);
}
- TAILQ_FOREACH(fi, &allobjects, fi_next) {
+ TAILQ_FOREACH(fi, &allofiles, fi_snext) {
if ((fi->fi_flags & FI_SEL) == 0)
continue;
putc('\t', fp);
@@ -444,29 +444,27 @@
emitcfiles(FILE *fp)
{
- emitfiles(fp, 'c', 0);
+ emitfiles(fp, &allcfiles, 'c');
}
static void
emitsfiles(FILE *fp)
{
- emitfiles(fp, 's', 'S');
+ emitfiles(fp, &allsfiles, 's');
}
static void
-emitfiles(FILE *fp, int suffix, int upper_suffix)
+emitfiles(FILE *fp, struct filelist *filelist, int suffix)
{
struct files *fi;
struct config *cf;
char swapname[100];
fprintf(fp, "%cFILES= \\\n", toupper(suffix));
- TAILQ_FOREACH(fi, &allfiles, fi_next) {
+ TAILQ_FOREACH(fi, filelist, fi_snext) {
if ((fi->fi_flags & FI_SEL) == 0)
continue;
- if (fi->fi_suffix != suffix && fi->fi_suffix != upper_suffix)
- continue;
putc('\t', fp);
emitfile(fp, fi);
fputs(" \\\n", fp);
Home |
Main Index |
Thread Index |
Old Index