summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-09-11 04:32:39 +0000
committerrillig <rillig@NetBSD.org>2020-09-11 04:32:39 +0000
commit694efd06dbd39fba2eda6fc182691f10ea6f4ae2 (patch)
tree6f56f1461a3d6a277817ab341117464a618562a3
parent1b770242cbfde180f864630d754eda5ffea24c7e (diff)
make(1): replace *a->b with a->b[0]
This allows the code to be read strictly from left to right. In most places this style was already used.
-rw-r--r--usr.bin/make/dir.c8
-rw-r--r--usr.bin/make/job.c16
-rw-r--r--usr.bin/make/strlist.c8
-rw-r--r--usr.bin/make/suff.c8
-rw-r--r--usr.bin/make/var.c8
5 files changed, 24 insertions, 24 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index 75863cdfbd5..3d754422691 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.137 2020/09/07 19:48:08 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.138 2020/09/11 04:32:39 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.137 2020/09/07 19:48:08 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.138 2020/09/11 04:32:39 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: dir.c,v 1.137 2020/09/07 19:48:08 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.138 2020/09/11 04:32:39 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -579,7 +579,7 @@ DirMatchFiles(const char *pattern, Path *p, Lst expansions)
Hash_Entry *entry; /* Current entry in the table */
Boolean isDot; /* TRUE if the directory being searched is . */
- isDot = (*p->name == '.' && p->name[1] == '\0');
+ isDot = (p->name[0] == '.' && p->name[1] == '\0');
for (entry = Hash_EnumFirst(&p->files, &search);
entry != NULL;
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 77fde1d282f..81e00172f50 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.228 2020/09/07 05:32:12 rillig Exp $ */
+/* $NetBSD: job.c,v 1.229 2020/09/11 04:32:39 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.228 2020/09/07 05:32:12 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.229 2020/09/11 04:32:39 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.228 2020/09/07 05:32:12 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.229 2020/09/11 04:32:39 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -804,7 +804,7 @@ JobPrintCommand(void *cmdp, void *jobp)
DBPRINTF("%s\n", commandShell->ignErr);
}
} else if (commandShell->ignErr &&
- (*commandShell->ignErr != '\0'))
+ commandShell->ignErr[0] != '\0')
{
/*
* The shell has no error control, so we need to be
@@ -849,7 +849,7 @@ JobPrintCommand(void *cmdp, void *jobp)
*/
if (!commandShell->hasErrCtl && commandShell->errOut &&
- (*commandShell->errOut != '\0')) {
+ commandShell->errOut[0] != '\0') {
if (!(job->flags & JOB_SILENT) && !shutUp) {
if (commandShell->hasEchoCtl) {
DBPRINTF("%s\n", commandShell->echoOff);
@@ -1474,8 +1474,8 @@ JobMakeArgv(Job *job, char **argv)
argv[0] = UNCONST(shellName);
argc = 1;
- if ((commandShell->exit && (*commandShell->exit != '-')) ||
- (commandShell->echo && (*commandShell->echo != '-')))
+ if ((commandShell->exit && commandShell->exit[0] != '-') ||
+ (commandShell->echo && commandShell->echo[0] != '-'))
{
/*
* At least one of the flags doesn't have a minus before it, so
@@ -2179,7 +2179,7 @@ Shell_Init(void)
if (commandShell->echo == NULL) {
commandShell->echo = "";
}
- if (commandShell->hasErrCtl && *commandShell->exit) {
+ if (commandShell->hasErrCtl && commandShell->exit[0] != '\0') {
if (shellErrFlag &&
strcmp(commandShell->exit, &shellErrFlag[1]) != 0) {
free(shellErrFlag);
diff --git a/usr.bin/make/strlist.c b/usr.bin/make/strlist.c
index 905e78fd8ca..f0e8554dbcd 100644
--- a/usr.bin/make/strlist.c
+++ b/usr.bin/make/strlist.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strlist.c,v 1.6 2020/08/25 17:37:09 rillig Exp $ */
+/* $NetBSD: strlist.c,v 1.7 2020/09/11 04:32:39 rillig Exp $ */
/*-
* Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc.
@@ -33,11 +33,11 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: strlist.c,v 1.6 2020/08/25 17:37:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: strlist.c,v 1.7 2020/09/11 04:32:39 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: strlist.c,v 1.6 2020/08/25 17:37:09 rillig Exp $");
+__RCSID("$NetBSD: strlist.c,v 1.7 2020/09/11 04:32:39 rillig Exp $");
#endif /* not lint */
#endif
@@ -80,7 +80,7 @@ strlist_add_str(strlist_t *sl, char *str, unsigned int info)
sl->sl_num = n;
items = sl->sl_items;
if (n >= sl->sl_max) {
- items = bmake_realloc(items, (n + 7) * sizeof *sl->sl_items);
+ items = bmake_realloc(items, (n + 7) * sizeof *items);
sl->sl_items = items;
sl->sl_max = n + 6;
}
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 6ba415827b5..ebc7eb27512 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.145 2020/09/08 05:26:21 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.146 2020/09/11 04:32:39 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.145 2020/09/08 05:26:21 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.146 2020/09/11 04:32:39 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.145 2020/09/08 05:26:21 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.146 2020/09/11 04:32:39 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -969,7 +969,7 @@ SuffAddSrc(void *sp, void *lsp)
targ = ls->s;
- if ((s->flags & SUFF_NULL) && (*s->name != '\0')) {
+ if ((s->flags & SUFF_NULL) && s->name[0] != '\0') {
/*
* If the suffix has been marked as the NULL suffix, also create a Src
* structure for a file with no suffix attached. Two birds, and all
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index bbb4a4c3d78..6ca7a9795fd 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.491 2020/09/08 05:26:21 rillig Exp $ */
+/* $NetBSD: var.c,v 1.492 2020/09/11 04:32:39 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.491 2020/09/08 05:26:21 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.492 2020/09/11 04:32:39 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.491 2020/09/08 05:26:21 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.492 2020/09/11 04:32:39 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -2969,7 +2969,7 @@ ApplyModifier_SysV(const char **pp, ApplyModifiersState *st)
* string. Note the pattern is anchored at the end.
*/
(*pp)--;
- if (lhs[0] == '\0' && *st->val == '\0') {
+ if (lhs[0] == '\0' && st->val[0] == '\0') {
st->newVal = st->val; /* special case */
} else {
ModifyWord_SYSVSubstArgs args = {st->ctxt, lhs, rhs};