Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make make: move duplicate function Buf_AddFlag to buf.c
details: https://anonhg.NetBSD.org/src/rev/5358aaa9334e
branches: trunk
changeset: 1026563:5358aaa9334e
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 28 22:48:06 2021 +0000
description:
make: move duplicate function Buf_AddFlag to buf.c
It is used only for debug output, therefore performance doesn't matter.
No functional change.
diffstat:
usr.bin/make/buf.c | 14 ++++++++++++--
usr.bin/make/buf.h | 3 ++-
usr.bin/make/make.c | 14 ++------------
usr.bin/make/suff.c | 14 ++------------
4 files changed, 18 insertions(+), 27 deletions(-)
diffs (122 lines):
diff -r 95adf0b3c639 -r 5358aaa9334e usr.bin/make/buf.c
--- a/usr.bin/make/buf.c Sun Nov 28 22:38:17 2021 +0000
+++ b/usr.bin/make/buf.c Sun Nov 28 22:48:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.c,v 1.52 2021/06/21 19:59:58 rillig Exp $ */
+/* $NetBSD: buf.c,v 1.53 2021/11/28 22:48:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
#include "make.h"
/* "@(#)buf.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: buf.c,v 1.52 2021/06/21 19:59:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.53 2021/11/28 22:48:06 rillig Exp $");
/* Make space in the buffer for adding at least 16 more bytes. */
void
@@ -128,6 +128,16 @@
Buf_AddBytes(buf, str, len);
}
+void
+Buf_AddFlag(Buffer *buf, bool flag, const char *name)
+{
+ if (flag) {
+ if (buf->len > 0)
+ Buf_AddByte(buf, '|');
+ Buf_AddBytes(buf, name, strlen(name));
+ }
+}
+
/* Mark the buffer as empty, so it can be filled with data again. */
void
Buf_Empty(Buffer *buf)
diff -r 95adf0b3c639 -r 5358aaa9334e usr.bin/make/buf.h
--- a/usr.bin/make/buf.h Sun Nov 28 22:38:17 2021 +0000
+++ b/usr.bin/make/buf.h Sun Nov 28 22:48:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.43 2021/04/03 11:08:40 rillig Exp $ */
+/* $NetBSD: buf.h,v 1.44 2021/11/28 22:48:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -111,6 +111,7 @@
void Buf_AddBytesBetween(Buffer *, const char *, const char *);
void Buf_AddStr(Buffer *, const char *);
void Buf_AddInt(Buffer *, int);
+void Buf_AddFlag(Buffer *, bool, const char *);
void Buf_Empty(Buffer *);
void Buf_Init(Buffer *);
void Buf_InitSize(Buffer *, size_t);
diff -r 95adf0b3c639 -r 5358aaa9334e usr.bin/make/make.c
--- a/usr.bin/make/make.c Sun Nov 28 22:38:17 2021 +0000
+++ b/usr.bin/make/make.c Sun Nov 28 22:48:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.246 2021/11/28 19:51:06 rillig Exp $ */
+/* $NetBSD: make.c,v 1.247 2021/11/28 22:48:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -104,7 +104,7 @@
#include "job.h"
/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: make.c,v 1.246 2021/11/28 19:51:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.247 2021/11/28 22:48:06 rillig Exp $");
/* Sequence # to detect recursion. */
static unsigned int checked_seqno = 1;
@@ -138,16 +138,6 @@
abort();
}
-static void
-Buf_AddFlag(Buffer *buf, bool flag, const char *name)
-{
- if (flag) {
- if (buf->len > 0)
- Buf_AddByte(buf, '|');
- Buf_AddBytes(buf, name, strlen(name));
- }
-}
-
static const char *
GNodeType_ToString(GNodeType type, void **freeIt)
{
diff -r 95adf0b3c639 -r 5358aaa9334e usr.bin/make/suff.c
--- a/usr.bin/make/suff.c Sun Nov 28 22:38:17 2021 +0000
+++ b/usr.bin/make/suff.c Sun Nov 28 22:48:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.354 2021/11/28 22:38:17 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.355 2021/11/28 22:48:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -115,7 +115,7 @@
#include "dir.h"
/* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.354 2021/11/28 22:38:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.355 2021/11/28 22:48:06 rillig Exp $");
typedef List SuffixList;
typedef ListNode SuffixListNode;
@@ -2125,16 +2125,6 @@
}
static void
-Buf_AddFlag(Buffer *buf, bool flag, const char *name)
-{
- if (flag) {
- if (buf->len > 0)
- Buf_AddByte(buf, '|');
- Buf_AddBytes(buf, name, strlen(name));
- }
-}
-
-static void
Suffix_Print(const Suffix *suff)
{
Buffer buf;
Home |
Main Index |
Thread Index |
Old Index