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 mbl to memory_block
details: https://anonhg.NetBSD.org/src/rev/1f78515e46b4
branches: trunk
changeset: 982135:1f78515e46b4
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Apr 02 09:39:25 2021 +0000
description:
lint: rename mbl to memory_block
No functional change.
diffstat:
usr.bin/xlint/lint1/externs1.h | 6 +++---
usr.bin/xlint/lint1/init.c | 6 +++---
usr.bin/xlint/lint1/lint1.h | 4 ++--
usr.bin/xlint/lint1/mem1.c | 40 ++++++++++++++++++++--------------------
4 files changed, 28 insertions(+), 28 deletions(-)
diffs (186 lines):
diff -r 964c1ff3b987 -r 1f78515e46b4 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h Fri Apr 02 09:27:44 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h Fri Apr 02 09:39:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.95 2021/03/30 14:25:28 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.96 2021/04/02 09:39:25 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -108,8 +108,8 @@
extern void *tgetblk(size_t);
extern tnode_t *getnode(void);
extern void tfreeblk(void);
-extern struct mbl *tsave(void);
-extern void trestor(struct mbl *);
+extern struct memory_block *tsave(void);
+extern void trestor(struct memory_block *);
/*
* err.c
diff -r 964c1ff3b987 -r 1f78515e46b4 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c Fri Apr 02 09:27:44 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c Fri Apr 02 09:39:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.186 2021/04/02 08:38:44 rillig Exp $ */
+/* $NetBSD: init.c,v 1.187 2021/04/02 09:39:25 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.186 2021/04/02 08:38:44 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.187 2021/04/02 09:39:25 rillig Exp $");
#endif
#include <stdlib.h>
@@ -380,7 +380,7 @@
{
tnode_t *ln;
tspec_t lt, rt;
- struct mbl *tmem;
+ struct memory_block *tmem;
/* Create a temporary node for the left side. */
ln = tgetblk(sizeof *ln);
diff -r 964c1ff3b987 -r 1f78515e46b4 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h Fri Apr 02 09:27:44 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h Fri Apr 02 09:39:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.90 2021/03/27 12:42:22 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.91 2021/04/02 09:39:25 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -411,7 +411,7 @@
type_t *c_switch_type; /* type of switch expression */
case_label_t *c_case_labels; /* list of case values */
- struct mbl *c_for_expr3_mem; /* saved memory for end of loop
+ struct memory_block *c_for_expr3_mem; /* saved memory for end of loop
* expression in for() */
tnode_t *c_for_expr3; /* end of loop expr in for() */
pos_t c_for_expr3_pos; /* position of end of loop expr */
diff -r 964c1ff3b987 -r 1f78515e46b4 usr.bin/xlint/lint1/mem1.c
--- a/usr.bin/xlint/lint1/mem1.c Fri Apr 02 09:27:44 2021 +0000
+++ b/usr.bin/xlint/lint1/mem1.c Fri Apr 02 09:39:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem1.c,v 1.37 2021/03/27 12:32:19 rillig Exp $ */
+/* $NetBSD: mem1.c,v 1.38 2021/04/02 09:39:25 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.37 2021/03/27 12:32:19 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.38 2021/04/02 09:39:25 rillig Exp $");
#endif
#include <sys/types.h>
@@ -172,37 +172,37 @@
*/
#define ML_INC ((size_t)32) /* Increment for length of *mblks */
-typedef struct mbl {
+typedef struct memory_block {
void *blk; /* beginning of memory block */
void *ffree; /* first free byte */
size_t nfree; /* # of free bytes */
size_t size; /* total size of memory block */
- struct mbl *nxt; /* next block */
-} mbl_t;
+ struct memory_block *nxt; /* next block */
+} memory_block;
/*
* Array of pointers to lists of memory blocks. mem_block_level is used as
* index into this array.
*/
-static mbl_t **mblks;
+static memory_block **mblks;
/* number of elements in *mblks */
static size_t nmblks;
/* free list for memory blocks */
-static mbl_t *frmblks;
+static memory_block *frmblks;
/* length of new allocated memory blocks */
static size_t mblklen;
-static void *xgetblk(mbl_t **, size_t);
-static void xfreeblk(mbl_t **);
-static mbl_t *xnewblk(void);
+static void *xgetblk(memory_block **, size_t);
+static void xfreeblk(memory_block **);
+static memory_block *xnewblk(void);
-static mbl_t *
+static memory_block *
xnewblk(void)
{
- mbl_t *mb = xmalloc(sizeof *mb);
+ memory_block *mb = xmalloc(sizeof *mb);
/* use mmap instead of malloc to avoid malloc's size overhead */
mb->blk = xmapalloc(mblklen);
@@ -213,9 +213,9 @@
/* Allocate new memory, initialized with zero. */
static void *
-xgetblk(mbl_t **mbp, size_t s)
+xgetblk(memory_block **mbp, size_t s)
{
- mbl_t *mb;
+ memory_block *mb;
void *p;
size_t t = 0;
@@ -264,9 +264,9 @@
* used memory to zero.
*/
static void
-xfreeblk(mbl_t **fmbp)
+xfreeblk(memory_block **fmbp)
{
- mbl_t *mb;
+ memory_block *mb;
while ((mb = *fmbp) != NULL) {
*fmbp = mb->nxt;
@@ -323,7 +323,7 @@
freelblk(mem_block_level);
}
-static mbl_t *tmblk;
+static memory_block *tmblk;
/*
* Return zero-initialized memory that is freed at the end of the current
@@ -358,10 +358,10 @@
* is not freed by the next tfreeblk() call. The pointer returned can be
* used to restore the memory.
*/
-mbl_t *
+memory_block *
tsave(void)
{
- mbl_t *tmem;
+ memory_block *tmem;
tmem = tmblk;
tmblk = NULL;
@@ -374,7 +374,7 @@
* tfreeblk() frees the restored memory.
*/
void
-trestor(mbl_t *tmem)
+trestor(memory_block *tmem)
{
tfreeblk();
Home |
Main Index |
Thread Index |
Old Index