Module Name:    src
Committed By:   rillig
Date:           Sun Sep 27 16:52:22 UTC 2020

Modified Files:
        src/usr.bin/make: buf.h for.c main.c var.c

Log Message:
make(1): rename Buf_Size to Buf_Len

The new name better matches the field name Buffer.len as well as the
variables around the calls to this function.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/make/buf.h
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/make/for.c
cvs rdiff -u -r1.349 -r1.350 src/usr.bin/make/main.c
cvs rdiff -u -r1.544 -r1.545 src/usr.bin/make/var.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.h
diff -u src/usr.bin/make/buf.h:1.32 src/usr.bin/make/buf.h:1.33
--- src/usr.bin/make/buf.h:1.32	Sun Sep 27 16:38:32 2020
+++ src/usr.bin/make/buf.h	Sun Sep 27 16:52:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.32 2020/09/27 16:38:32 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.33 2020/09/27 16:52:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -107,7 +107,7 @@ Buf_AddByte(Buffer *bp, char byte)
 }
 
 static inline MAKE_ATTR_UNUSED size_t
-Buf_Size(const Buffer *bp)
+Buf_Len(const Buffer *bp)
 {
     return bp->len;
 }

Index: src/usr.bin/make/for.c
diff -u src/usr.bin/make/for.c:1.86 src/usr.bin/make/for.c:1.87
--- src/usr.bin/make/for.c:1.86	Fri Sep 25 15:54:50 2020
+++ src/usr.bin/make/for.c	Sun Sep 27 16:52:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.86 2020/09/25 15:54:50 rillig Exp $	*/
+/*	$NetBSD: for.c,v 1.87 2020/09/27 16:52:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -60,7 +60,7 @@
 #include    "strlist.h"
 
 /*	"@(#)for.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: for.c,v 1.86 2020/09/25 15:54:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.87 2020/09/27 16:52:22 rillig Exp $");
 
 typedef enum {
     FOR_SUB_ESCAPE_CHAR = 0x0001,
@@ -433,7 +433,7 @@ ForIterate(void *v_arg, size_t *ret_len)
     }
     Buf_AddBytesBetween(&cmds, cmd_cp, body_end);
 
-    *ret_len = Buf_Size(&cmds);
+    *ret_len = Buf_Len(&cmds);
     cmds_str = Buf_Destroy(&cmds, FALSE);
     if (DEBUG(FOR))
 	(void)fprintf(debug_file, "For: loop body:\n%s", cmds_str);

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.349 src/usr.bin/make/main.c:1.350
--- src/usr.bin/make/main.c:1.349	Sat Sep 26 17:39:45 2020
+++ src/usr.bin/make/main.c	Sun Sep 27 16:52:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.349 2020/09/26 17:39:45 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.350 2020/09/27 16:52:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #endif
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.349 2020/09/26 17:39:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.350 2020/09/27 16:52:22 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
  The Regents of the University of California.  All rights reserved.");
@@ -1679,7 +1679,7 @@ Cmd_Exec(const char *cmd, const char **e
 	    JobReapChild(pid, status, FALSE);
 	    continue;
 	}
-	res_len = Buf_Size(&buf);
+	res_len = Buf_Len(&buf);
 	res = Buf_Destroy(&buf, FALSE);
 
 	if (savederr != 0)

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.544 src/usr.bin/make/var.c:1.545
--- src/usr.bin/make/var.c:1.544	Sun Sep 27 16:10:07 2020
+++ src/usr.bin/make/var.c	Sun Sep 27 16:52:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.544 2020/09/27 16:10:07 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.545 2020/09/27 16:52:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include    "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.544 2020/09/27 16:10:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.545 2020/09/27 16:52:22 rillig Exp $");
 
 #define VAR_DEBUG_IF(cond, fmt, ...)	\
     if (!(DEBUG(VAR) && (cond)))	\
@@ -1551,7 +1551,7 @@ ModifyWords(GNode *ctx, char sep, Boolea
 
     for (i = 0; i < words.len; i++) {
 	modifyWord(words.words[i], &result, modifyWord_args);
-	if (Buf_Size(&result.buf) > 0)
+	if (Buf_Len(&result.buf) > 0)
 	    SepBuf_Sep(&result);
     }
 
@@ -1942,7 +1942,7 @@ ParseModifierPart(
 
     *pp = ++p;
     if (out_length != NULL)
-	*out_length = Buf_Size(&buf);
+	*out_length = Buf_Len(&buf);
 
     *out_part = Buf_Destroy(&buf, FALSE);
     VAR_DEBUG("Modifier part: \"%s\"\n", *out_part);
@@ -3361,7 +3361,7 @@ ParseVarname(const char **pp, char start
 	}
     }
     *pp = p;
-    *out_varname_len = Buf_Size(&buf);
+    *out_varname_len = Buf_Len(&buf);
     return Buf_Destroy(&buf, FALSE);
 }
 

Reply via email to