Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): rename Buf_Expand_1 to Buf_Expand



details:   https://anonhg.NetBSD.org/src/rev/a14a8de66425
branches:  trunk
changeset: 1017464:a14a8de66425
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 28 15:42:53 2020 +0000

description:
make(1): rename Buf_Expand_1 to Buf_Expand

diffstat:

 usr.bin/make/buf.c   |  10 +++++-----
 usr.bin/make/buf.h   |   6 +++---
 usr.bin/make/parse.c |   6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diffs (85 lines):

diff -r 24e162a95224 -r a14a8de66425 usr.bin/make/buf.c
--- a/usr.bin/make/buf.c        Mon Dec 28 15:21:33 2020 +0000
+++ b/usr.bin/make/buf.c        Mon Dec 28 15:42:53 2020 +0000
@@ -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);
diff -r 24e162a95224 -r a14a8de66425 usr.bin/make/buf.h
--- a/usr.bin/make/buf.h        Mon Dec 28 15:21:33 2020 +0000
+++ b/usr.bin/make/buf.h        Mon Dec 28 15:42:53 2020 +0000
@@ -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 @@
 #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 @@
        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';
diff -r 24e162a95224 -r a14a8de66425 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Mon Dec 28 15:21:33 2020 +0000
+++ b/usr.bin/make/parse.c      Mon Dec 28 15:42:53 2020 +0000
@@ -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 @@
                                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);



Home | Main Index | Thread Index | Old Index