Module Name: src
Committed By: kamil
Date: Fri Jun 30 02:51:14 UTC 2017
Modified Files:
src/bin/ksh: config.h io.c lex.c sh.h shf.c tree.c
Log Message:
ksh: Assume ANSI C prototypes
To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/ksh/config.h
cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/io.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/lex.c
cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/sh.h
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/shf.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/tree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.45 src/bin/ksh/config.h:1.46
--- src/bin/ksh/config.h:1.45 Fri Jun 30 02:38:09 2017
+++ src/bin/ksh/config.h Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h,v 1.45 2017/06/30 02:38:09 kamil Exp $ */
+/* $NetBSD: config.h,v 1.46 2017/06/30 02:51:14 kamil Exp $ */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
@@ -54,9 +54,6 @@
/* Define if you don't have setpgrp(), setpgid() or getpgrp() routines */
/* #undef NO_PGRP */
-/* Define if C compiler groks function prototypes */
-#define HAVE_PROTOTYPES 1
-
/* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */
#define HAVE_GCC_FUNC_ATTR 1
Index: src/bin/ksh/io.c
diff -u src/bin/ksh/io.c:1.14 src/bin/ksh/io.c:1.15
--- src/bin/ksh/io.c:1.14 Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/io.c Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $ */
+/* $NetBSD: io.c,v 1.15 2017/06/30 02:51:14 kamil Exp $ */
/*
* shell buffered IO and formatted output
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $");
+__RCSID("$NetBSD: io.c,v 1.15 2017/06/30 02:51:14 kamil Exp $");
#endif
@@ -23,13 +23,7 @@ static int initio_done;
/* A shell error occurred (eg, syntax error, etc.) */
void
-#ifdef HAVE_PROTOTYPES
errorf(const char *fmt, ...)
-#else
-errorf(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -48,14 +42,7 @@ errorf(fmt, va_alist)
/* like errorf(), but no unwind is done */
void
-#ifdef HAVE_PROTOTYPES
warningf(int fileline, const char *fmt, ...)
-#else
-warningf(fileline, fmt, va_alist)
- int fileline;
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -71,13 +58,7 @@ warningf(fileline, fmt, va_alist)
* (also unwinds environments for special builtins).
*/
void
-#ifdef HAVE_PROTOTYPES
bi_errorf(const char *fmt, ...)
-#else
-bi_errorf(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -108,14 +89,7 @@ bi_errorf(fmt, va_alist)
/* Called when something that shouldn't happen does */
void
-#ifdef HAVE_PROTOTYPES
internal_errorf(int jump, const char *fmt, ...)
-#else
-internal_errorf(jump, fmt, va_alist)
- int jump;
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -148,13 +122,7 @@ error_prefix(fileline)
/* printf to shl_out (stderr) with flush */
void
-#ifdef HAVE_PROTOTYPES
shellf(const char *fmt, ...)
-#else
-shellf(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -168,13 +136,7 @@ shellf(fmt, va_alist)
/* printf to shl_stdout (stdout) */
void
-#ifdef HAVE_PROTOTYPES
shprintf(const char *fmt, ...)
-#else
-shprintf(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -204,13 +166,7 @@ kshdebug_init_()
/* print to debugging log */
void
-# ifdef HAVE_PROTOTYPES
kshdebug_printf_(const char *fmt, ...)
-# else
-kshdebug_printf_(fmt, va_alist)
- const char *fmt;
- va_dcl
-# endif
{
va_list va;
Index: src/bin/ksh/lex.c
diff -u src/bin/ksh/lex.c:1.19 src/bin/ksh/lex.c:1.20
--- src/bin/ksh/lex.c:1.19 Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/lex.c Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $ */
+/* $NetBSD: lex.c,v 1.20 2017/06/30 02:51:14 kamil Exp $ */
/*
* lexical analysis and source input
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.20 2017/06/30 02:51:14 kamil Exp $");
#endif
@@ -836,13 +836,7 @@ readhere(iop)
}
void
-#ifdef HAVE_PROTOTYPES
yyerror(const char *fmt, ...)
-#else
-yyerror(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.30 src/bin/ksh/sh.h:1.31
--- src/bin/ksh/sh.h:1.30 Fri Jun 30 02:38:10 2017
+++ src/bin/ksh/sh.h Fri Jun 30 02:51:14 2017
@@ -1,18 +1,14 @@
-/* $NetBSD: sh.h,v 1.30 2017/06/30 02:38:10 kamil Exp $ */
+/* $NetBSD: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */
/*
* Public Domain Bourne/Korn shell
*/
-/* $Id: sh.h,v 1.30 2017/06/30 02:38:10 kamil Exp $ */
+/* $Id: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */
#include "config.h" /* system and option configuration info */
-#ifdef HAVE_PROTOTYPES
-# define ARGS(args) args /* prototype declaration */
-#else
-# define ARGS(args) () /* K&R declaration */
-#endif
+#define ARGS(args) args /* prototype declaration */
/* Start of common headers */
Index: src/bin/ksh/shf.c
diff -u src/bin/ksh/shf.c:1.11 src/bin/ksh/shf.c:1.12
--- src/bin/ksh/shf.c:1.11 Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/shf.c Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $ */
+/* $NetBSD: shf.c,v 1.12 2017/06/30 02:51:14 kamil Exp $ */
/*
* Shell file I/O routines
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $");
+__RCSID("$NetBSD: shf.c,v 1.12 2017/06/30 02:51:14 kamil Exp $");
#endif
@@ -758,14 +758,7 @@ shf_write(buf, nbytes, shf)
}
int
-#ifdef HAVE_PROTOTYPES
shf_fprintf(struct shf *shf, const char *fmt, ...)
-#else
-shf_fprintf(shf, fmt, va_alist)
- struct shf *shf;
- const char *fmt;
- va_dcl
-#endif
{
va_list args;
int n;
@@ -778,15 +771,7 @@ shf_fprintf(shf, fmt, va_alist)
}
int
-#ifdef HAVE_PROTOTYPES
shf_snprintf(char *buf, int bsize, const char *fmt, ...)
-#else
-shf_snprintf(buf, bsize, fmt, va_alist)
- char *buf;
- int bsize;
- const char *fmt;
- va_dcl
-#endif
{
struct shf shf;
va_list args;
@@ -805,13 +790,7 @@ shf_snprintf(buf, bsize, fmt, va_alist)
}
char *
-#ifdef HAVE_PROTOTYPES
shf_smprintf(const char *fmt, ...)
-#else
-shf_smprintf(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
struct shf shf;
va_list args;
Index: src/bin/ksh/tree.c
diff -u src/bin/ksh/tree.c:1.7 src/bin/ksh/tree.c:1.8
--- src/bin/ksh/tree.c:1.7 Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/tree.c Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.7 2017/06/23 00:18:01 kamil Exp $ */
+/* $NetBSD: tree.c,v 1.8 2017/06/30 02:51:14 kamil Exp $ */
/*
* command tree climbing
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: tree.c,v 1.7 2017/06/23 00:18:01 kamil Exp $");
+__RCSID("$NetBSD: tree.c,v 1.8 2017/06/30 02:51:14 kamil Exp $");
#endif
@@ -375,15 +375,7 @@ tputS(wp, shf)
*/
/* VARARGS */
int
-#ifdef HAVE_PROTOTYPES
fptreef(struct shf *shf, int indent, const char *fmt, ...)
-#else
-fptreef(shf, indent, fmt, va_alist)
- struct shf *shf;
- int indent;
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
@@ -396,15 +388,7 @@ fptreef(shf, indent, fmt, va_alist)
/* VARARGS */
char *
-#ifdef HAVE_PROTOTYPES
snptreef(char *s, int n, const char *fmt, ...)
-#else
-snptreef(s, n, fmt, va_alist)
- char *s;
- int n;
- const char *fmt;
- va_dcl
-#endif
{
va_list va;
struct shf shf;