Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/xlint lint: inline list_add_defines
details: https://anonhg.NetBSD.org/src/rev/f368d67f9a7f
branches: trunk
changeset: 1022824:f368d67f9a7f
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Aug 08 15:06:44 2021 +0000
description:
lint: inline list_add_defines
No functional change.
diffstat:
usr.bin/xlint/xlint/xlint.c | 30 ++++--------------------------
1 files changed, 4 insertions(+), 26 deletions(-)
diffs (72 lines):
diff -r b63c876a9113 -r f368d67f9a7f usr.bin/xlint/xlint/xlint.c
--- a/usr.bin/xlint/xlint/xlint.c Sun Aug 08 15:03:47 2021 +0000
+++ b/usr.bin/xlint/xlint/xlint.c Sun Aug 08 15:06:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.67 2021/08/08 15:03:47 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: xlint.c,v 1.67 2021/08/08 15:03:47 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $");
#endif
#include <sys/param.h>
@@ -129,7 +129,6 @@
static const char target_prefix[] = TARGET_PREFIX;
static char *concat2(const char *, const char *);
-static char *concat3(const char *, const char *, const char *);
static void terminate(int) __attribute__((__noreturn__));
static const char *lbasename(const char *, int);
static void usage(void);
@@ -190,14 +189,6 @@
}
static void
-list_add_defines(char ***lstp, const char *def)
-{
-
- list_add(lstp, concat2("-D__", def));
- list_add(lstp, concat3("-D__", def, "__"));
-}
-
-static void
list_free(char ***lstp)
{
char *s;
@@ -245,19 +236,6 @@
return s;
}
-static char *
-concat3(const char *s1, const char *s2, const char *s3)
-{
- char *s;
-
- s = xmalloc(strlen(s1) + strlen(s2) + strlen(s3) + 1);
- (void)strcpy(s, s1);
- (void)strcat(s, s2);
- (void)strcat(s, s3);
-
- return s;
-}
-
/*
* Clean up after a signal.
*/
@@ -387,8 +365,8 @@
pass_to_cpp("-Wcomment");
pass_to_cpp("-D__LINT__");
pass_to_cpp("-Dlint"); /* XXX don't def. with -s */
-
- list_add_defines(&cflags, "lint");
+ pass_to_cpp("-D__lint");
+ pass_to_cpp("-D__lint__");
list_add_copy(&deflibs, "c");
Home |
Main Index |
Thread Index |
Old Index