Module Name: src
Committed By: rillig
Date: Mon Dec 28 15:42:53 UTC 2020
Modified Files:
src/usr.bin/make: buf.c buf.h parse.c
Log Message:
make(1): rename Buf_Expand_1 to Buf_Expand
To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/make/buf.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/make/buf.h
cvs rdiff -u -r1.522 -r1.523 src/usr.bin/make/parse.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/make/buf.c
diff -u src/usr.bin/make/buf.c:1.45 src/usr.bin/make/buf.c:1.46
--- src/usr.bin/make/buf.c:1.45 Mon Nov 23 19:07:12 2020
+++ src/usr.bin/make/buf.c Mon Dec 28 15:42:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.c,v 1.45 2020/11/23 19:07:12 rillig Exp $ */
+/* $NetBSD: buf.c,v 1.46 2020/12/28 15:42:53 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -69,17 +69,17 @@
* SUCH DAMAGE.
*/
-/* Automatically-expanding null-terminated buffers. */
+/* Automatically-expanding null-terminated character buffers. */
#include <limits.h>
#include "make.h"
/* "@(#)buf.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: buf.c,v 1.45 2020/11/23 19:07:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.46 2020/12/28 15:42:53 rillig Exp $");
-/* Make space in the buffer for adding a single byte. */
+/* Make space in the buffer for adding at least 16 more bytes. */
void
-Buf_Expand_1(Buffer *buf)
+Buf_Expand(Buffer *buf)
{
buf->cap += buf->cap > 16 ? buf->cap : 16;
buf->data = bmake_realloc(buf->data, buf->cap);
Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.37 src/usr.bin/make/buf.h:1.38
--- src/usr.bin/make/buf.h:1.37 Sun Dec 6 11:00:56 2020
+++ src/usr.bin/make/buf.h Mon Dec 28 15:42:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.37 2020/12/06 11:00:56 rillig Exp $ */
+/* $NetBSD: buf.h,v 1.38 2020/12/28 15:42:53 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@ typedef struct Buffer {
#define __predict_false(x) (x)
#endif
-void Buf_Expand_1(Buffer *);
+void Buf_Expand(Buffer *);
/* Buf_AddByte adds a single byte to a buffer. */
MAKE_INLINE void
@@ -100,7 +100,7 @@ Buf_AddByte(Buffer *buf, char byte)
size_t old_len = buf->len++;
char *end;
if (__predict_false(old_len + 1 >= buf->cap))
- Buf_Expand_1(buf);
+ Buf_Expand(buf);
end = buf->data + old_len;
end[0] = byte;
end[1] = '\0';
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.522 src/usr.bin/make/parse.c:1.523
--- src/usr.bin/make/parse.c:1.522 Mon Dec 28 15:21:33 2020
+++ src/usr.bin/make/parse.c Mon Dec 28 15:42:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.522 2020/12/28 15:21:33 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.523 2020/12/28 15:42:53 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.522 2020/12/28 15:21:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.523 2020/12/28 15:42:53 rillig Exp $");
/* types and constants */
@@ -459,7 +459,7 @@ loadfile(const char *path, int fd)
Error("%s: file too large", path);
exit(2); /* Not 1 so -q can distinguish error */
}
- Buf_Expand_1(&buf);
+ Buf_Expand(&buf);
}
assert(buf.len < buf.cap);
n = read(fd, buf.data + buf.len, buf.cap - buf.len);