Module Name:    src
Committed By:   kre
Date:           Wed May  3 04:11:30 UTC 2017

Modified Files:
        src/bin/sh: input.c input.h

Log Message:
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 ...


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/bin/sh/input.c
cvs rdiff -u -r1.15 -r1.16 src/bin/sh/input.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/input.c
diff -u src/bin/sh/input.c:1.52 src/bin/sh/input.c:1.53
--- src/bin/sh/input.c:1.52	Sat Apr 29 15:14:28 2017
+++ src/bin/sh/input.c	Wed May  3 04:11:30 2017
@@ -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 @@ pungetc(void)
  * 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 @@ pushstring(char *s, int len, void *ap)
 	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;

Index: src/bin/sh/input.h
diff -u src/bin/sh/input.h:1.15 src/bin/sh/input.h:1.16
--- src/bin/sh/input.h:1.15	Thu Aug  7 09:05:33 2003
+++ src/bin/sh/input.h	Wed May  3 04:11:30 2017
@@ -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 int parsenleft;		/* number of cha
 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);

Reply via email to