Module Name:    src
Committed By:   rillig
Date:           Sun Aug  1 18:07:35 UTC 2021

Modified Files:
        src/usr.bin/xlint/common: externs.h mem.c
        src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: unexport nomem

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/common/mem.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/mem1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/common/externs.h
diff -u src/usr.bin/xlint/common/externs.h:1.15 src/usr.bin/xlint/common/externs.h:1.16
--- src/usr.bin/xlint/common/externs.h:1.15	Sun Aug  1 17:59:47 2021
+++ src/usr.bin/xlint/common/externs.h	Sun Aug  1 18:07:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.15 2021/08/01 17:59:47 rillig Exp $	*/
+/*	$NetBSD: externs.h,v 1.16 2021/08/01 18:07:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -57,7 +57,6 @@ extern	void	*xmalloc(size_t);
 extern	void	*xcalloc(size_t, size_t);
 extern	void	*xrealloc(void *, size_t);
 extern	char	*xstrdup(const char *);
-extern	void	nomem(void);
 extern  void	xasprintf(char **, const char *, ...) __printflike(2, 3);
 
 /*

Index: src/usr.bin/xlint/common/mem.c
diff -u src/usr.bin/xlint/common/mem.c:1.13 src/usr.bin/xlint/common/mem.c:1.14
--- src/usr.bin/xlint/common/mem.c:1.13	Sun Aug  1 17:59:47 2021
+++ src/usr.bin/xlint/common/mem.c	Sun Aug  1 18:07:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.13 2021/08/01 17:59:47 rillig Exp $	*/
+/*	$NetBSD: mem.c,v 1.14 2021/08/01 18:07:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,18 +37,22 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem.c,v 1.13 2021/08/01 17:59:47 rillig Exp $");
+__RCSID("$NetBSD: mem.c,v 1.14 2021/08/01 18:07:35 rillig Exp $");
 #endif
 
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/mman.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "lint.h"
 
+static void __attribute__((noreturn))
+nomem(void)
+{
+
+	errx(1, "virtual memory exhausted");
+}
+
 void *
 xmalloc(size_t s)
 {
@@ -92,13 +96,6 @@ xstrdup(const char *s)
 	return s2;
 }
 
-void __attribute__((noreturn))
-nomem(void)
-{
-
-	errx(1, "virtual memory exhausted");
-}
-
 void
 xasprintf(char **buf, const char *fmt, ...)
 {

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.46 src/usr.bin/xlint/lint1/mem1.c:1.47
--- src/usr.bin/xlint/lint1/mem1.c:1.46	Sun Aug  1 17:59:47 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sun Aug  1 18:07:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.46 2021/08/01 17:59:47 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.47 2021/08/01 18:07:35 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.46 2021/08/01 17:59:47 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.47 2021/08/01 18:07:35 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -398,8 +398,8 @@ expr_save_memory(void)
 }
 
 /*
- * Free all memory used for the current expression and the memory used
- * be a previous expression and saved by expr_save_memory(). The next call to
+ * Free all memory used for the current expression and restore the memory used
+ * by a previous expression and saved by expr_save_memory(). The next call to
  * expr_free_all() frees the restored memory.
  */
 void

Reply via email to