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: rename types in filename management
details: https://anonhg.NetBSD.org/src/rev/eac732b811a5
branches: trunk
changeset: 960707:eac732b811a5
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Mar 27 12:01:49 2021 +0000
description:
lint: rename types in filename management
No functional change.
diffstat:
usr.bin/xlint/lint1/mem1.c | 32 +++++++++++++++-----------------
1 files changed, 15 insertions(+), 17 deletions(-)
diffs (98 lines):
diff -r 8be7f0dd1eda -r eac732b811a5 usr.bin/xlint/lint1/mem1.c
--- a/usr.bin/xlint/lint1/mem1.c Sat Mar 27 11:54:35 2021 +0000
+++ b/usr.bin/xlint/lint1/mem1.c Sat Mar 27 12:01:49 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem1.c,v 1.31 2021/03/27 11:54:35 rillig Exp $ */
+/* $NetBSD: mem1.c,v 1.32 2021/03/27 12:01:49 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.31 2021/03/27 11:54:35 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.32 2021/03/27 12:01:49 rillig Exp $");
#endif
#include <sys/types.h>
@@ -51,22 +51,20 @@
/*
* Filenames allocated by fnalloc() and fnnalloc() are shared.
*/
-typedef struct fn {
+struct filename {
char *fn_name;
size_t fn_len;
int fn_id;
- struct fn *fn_next;
-} fn_t;
+ struct filename *fn_next;
+};
-static fn_t *fnames;
-
-static fn_t *srchfn(const char *, size_t);
+static struct filename *fnames;
/* Find the given filename, or return NULL. */
-static fn_t *
+static struct filename *
srchfn(const char *s, size_t len)
{
- fn_t *fn;
+ struct filename *fn;
for (fn = fnames; fn != NULL; fn = fn->fn_next) {
if (fn->fn_len == len && memcmp(fn->fn_name, s, len) == 0)
@@ -75,19 +73,19 @@
return fn;
}
-struct repl {
+struct filename_replacement {
char *orig;
char *repl;
size_t len;
- struct repl *next;
+ struct filename_replacement *next;
};
-struct repl *replist;
+static struct filename_replacement *replist;
void
add_directory_replacement(char *arg)
{
- struct repl *r = xmalloc(sizeof *r);
+ struct filename_replacement *r = xmalloc(sizeof *r);
r->orig = arg;
if ((r->repl = strchr(arg, '=')) == NULL)
@@ -105,7 +103,7 @@
fnxform(const char *name, size_t len)
{
static char buf[MAXPATHLEN];
- struct repl *r;
+ struct filename_replacement *r;
for (r = replist; r != NULL; r = r->next)
if (r->len < len && memcmp(name, r->orig, r->len) == 0)
@@ -123,7 +121,7 @@
const char *
fnnalloc(const char *s, size_t len)
{
- fn_t *fn;
+ struct filename *fn;
static int nxt_id = 0;
@@ -156,7 +154,7 @@
int
getfnid(const char *s)
{
- fn_t *fn;
+ struct filename *fn;
if (s == NULL || (fn = srchfn(s, strlen(s))) == NULL)
return -1;
Home |
Main Index |
Thread Index |
Old Index