Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: remove unused print_tnode
details: https://anonhg.NetBSD.org/src/rev/d8bc62329103
branches: trunk
changeset: 1021849:d8bc62329103
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jun 20 20:59:08 2021 +0000
description:
lint: remove unused print_tnode
The function display_expression serves the same purpose and prints more
details.
diffstat:
usr.bin/xlint/lint1/externs1.h | 3 +-
usr.bin/xlint/lint1/print.c | 54 +----------------------------------------
2 files changed, 3 insertions(+), 54 deletions(-)
diffs (89 lines):
diff -r 15d5fb7f1160 -r d8bc62329103 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h Sun Jun 20 20:48:25 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h Sun Jun 20 20:59:08 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.110 2021/06/19 14:08:45 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.111 2021/06/20 20:59:08 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -338,7 +338,6 @@
/*
* print.c
*/
-extern char *print_tnode(char *, size_t, const tnode_t *);
const char *scl_name(scl_t);
/*
diff -r 15d5fb7f1160 -r d8bc62329103 usr.bin/xlint/lint1/print.c
--- a/usr.bin/xlint/lint1/print.c Sun Jun 20 20:48:25 2021 +0000
+++ b/usr.bin/xlint/lint1/print.c Sun Jun 20 20:59:08 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.14 2021/06/20 20:32:42 rillig Exp $ */
+/* $NetBSD: print.c,v 1.15 2021/06/20 20:59:08 rillig Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,61 +35,11 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: print.c,v 1.14 2021/06/20 20:32:42 rillig Exp $");
+__RCSID("$NetBSD: print.c,v 1.15 2021/06/20 20:59:08 rillig Exp $");
#endif
-#include <stdio.h>
-
#include "lint1.h"
-char *
-print_tnode(char *buf, size_t bufsiz, const tnode_t *tn)
-{
- strg_t *st;
- val_t *v;
- sym_t *s;
- switch (tn->tn_op) {
- case NAME:
- s = tn->tn_sym;
- (void)snprintf(buf, bufsiz, "%s", s->s_name);
- break;
- case CON:
- v = tn->tn_val;
- switch (v->v_tspec) {
- case FLOAT:
- case DOUBLE:
- case LDOUBLE:
- (void)snprintf(buf, bufsiz, "%Lg", v->v_ldbl);
- break;
- default:
- (void)snprintf(buf, bufsiz,
- /* FIXME */
- v->v_unsigned_since_c90 ? "%llu" : "%lld",
- (unsigned long long)v->v_quad);
- break;
- }
- break;
-
- case STRING:
- st = tn->tn_string;
- switch (st->st_tspec) {
- case CHAR:
- case SCHAR:
- case UCHAR:
- (void)snprintf(buf, bufsiz, "\"%s\"", st->st_cp);
- break;
- default:
- (void)snprintf(buf, bufsiz, "\"*wide string*\"");
- break;
- }
- break;
- default:
- (void)snprintf(buf, bufsiz, "%s", modtab[tn->tn_op].m_name);
- break;
- }
- return buf;
-}
-
/* Return the name of the "storage class" in the wider sense. */
const char *
scl_name(scl_t scl)
Home |
Main Index |
Thread Index |
Old Index