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: eliminate local variable in Substring_Words



details:   https://anonhg.NetBSD.org/src/rev/f5aa2d922fdb
branches:  trunk
changeset: 984105:f5aa2d922fdb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jun 21 16:59:18 2021 +0000

description:
make: eliminate local variable in Substring_Words

No functional change.

diffstat:

 usr.bin/make/str.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r d0baf98565a3 -r f5aa2d922fdb usr.bin/make/str.c
--- a/usr.bin/make/str.c        Mon Jun 21 11:11:33 2021 +0000
+++ b/usr.bin/make/str.c        Mon Jun 21 16:59:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.85 2021/05/30 21:16:54 rillig Exp $  */
+/*     $NetBSD: str.c,v 1.86 2021/06/21 16:59:18 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -71,7 +71,7 @@
 #include "make.h"
 
 /*     "@(#)str.c      5.8 (Berkeley) 6/1/90"  */
-MAKE_RCSID("$NetBSD: str.c,v 1.85 2021/05/30 21:16:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.86 2021/06/21 16:59:18 rillig Exp $");
 
 /* Return the concatenation of s1 and s2, freshly allocated. */
 char *
@@ -188,10 +188,9 @@
 
                        *word_end++ = '\0';
                        if (words_len == words_cap) {
-                               size_t new_size;
                                words_cap *= 2;
-                               new_size = (words_cap + 1) * sizeof(words[0]);
-                               words = bmake_realloc(words, new_size);
+                               words = bmake_realloc(words,
+                                   (words_cap + 1) * sizeof(words[0]));
                        }
                        words[words_len++] =
                            Substring_Init(word_start, word_end - 1);



Home | Main Index | Thread Index | Old Index