Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh NFC: Change prototype of pushstring() to give a real ...
details: https://anonhg.NetBSD.org/src/rev/6a07d7a29a61
branches: trunk
changeset: 353388:6a07d7a29a61
user: kre <kre%NetBSD.org@localhost>
date: Wed May 03 04:11:30 2017 +0000
description:
NFC: Change prototype of pushstring() to give a real type for the 3rd
arg (struct alias *) rather than using void * and then casting it
when used. For callers, the arg either is a struct alias *, or is NULL,
so nothing to adjust there.
NB: This change untested by itself, it was going to be a part of the next
change (coming in a few minutes) but is logically unrelated, so ...
diffstat:
bin/sh/input.c | 10 +++++-----
bin/sh/input.h | 6 ++++--
2 files changed, 9 insertions(+), 7 deletions(-)
diffs (63 lines):
diff -r a867fcfbf188 -r 6a07d7a29a61 bin/sh/input.c
--- a/bin/sh/input.c Wed May 03 01:37:16 2017 +0000
+++ b/bin/sh/input.c Wed May 03 04:11:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: input.c,v 1.52 2017/04/29 15:14:28 kre Exp $ */
+/* $NetBSD: input.c,v 1.53 2017/05/03 04:11:30 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
#else
-__RCSID("$NetBSD: input.c,v 1.52 2017/04/29 15:14:28 kre Exp $");
+__RCSID("$NetBSD: input.c,v 1.53 2017/05/03 04:11:30 kre Exp $");
#endif
#endif /* not lint */
@@ -341,7 +341,7 @@
* We handle aliases this way.
*/
void
-pushstring(char *s, int len, void *ap)
+pushstring(char *s, int len, strust alias *ap)
{
struct strpush *sp;
@@ -356,9 +356,9 @@
sp->prevstring = parsenextc;
sp->prevnleft = parsenleft;
sp->prevlleft = parselleft;
- sp->ap = (struct alias *)ap;
+ sp->ap = ap;
if (ap)
- ((struct alias *)ap)->flag |= ALIASINUSE;
+ ap->flag |= ALIASINUSE;
parsenextc = s;
parsenleft = len;
INTON;
diff -r a867fcfbf188 -r 6a07d7a29a61 bin/sh/input.h
--- a/bin/sh/input.h Wed May 03 01:37:16 2017 +0000
+++ b/bin/sh/input.h Wed May 03 04:11:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: input.h,v 1.15 2003/08/07 09:05:33 agc Exp $ */
+/* $NetBSD: input.h,v 1.16 2017/05/03 04:11:30 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -46,11 +46,13 @@
extern char *parsenextc; /* next character in input buffer */
extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */
+strust alias;
+
char *pfgets(char *, int);
int pgetc(void);
int preadbuffer(void);
void pungetc(void);
-void pushstring(char *, int, void *);
+void pushstring(char *, int, struct alias *);
void popstring(void);
void setinputfile(const char *, int);
void setinputfd(int, int);
Home |
Main Index |
Thread Index |
Old Index