summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2017-06-30 02:51:14 +0000
committerkamil <kamil@NetBSD.org>2017-06-30 02:51:14 +0000
commit0329fa437b1d8f70525db7a0ff6e1252b31fbc82 (patch)
tree33613ed79740c9b093865a5bf4a4a6f2b5ca3df5 /bin/ksh
parent84720dce5b1e58844003e92df297c2b034e04cc4 (diff)
ksh: Assume ANSI C prototypes
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/config.h5
-rw-r--r--bin/ksh/io.c48
-rw-r--r--bin/ksh/lex.c10
-rw-r--r--bin/ksh/sh.h10
-rw-r--r--bin/ksh/shf.c25
-rw-r--r--bin/ksh/tree.c20
6 files changed, 12 insertions, 106 deletions
diff --git a/bin/ksh/config.h b/bin/ksh/config.h
index f7ca1e7ffc6..49a48ded98a 100644
--- a/bin/ksh/config.h
+++ b/bin/ksh/config.h
@@ -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
diff --git a/bin/ksh/io.c b/bin/ksh/io.c
index 9927b21c017..2a5d808752f 100644
--- a/bin/ksh/io.c
+++ b/bin/ksh/io.c
@@ -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;
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index 94e08564727..b07dfe329a8 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -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;
diff --git a/bin/ksh/sh.h b/bin/ksh/sh.h
index 198f783ce44..be26d8a4539 100644
--- a/bin/ksh/sh.h
+++ b/bin/ksh/sh.h
@@ -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 */
diff --git a/bin/ksh/shf.c b/bin/ksh/shf.c
index 727ad47b4dc..7148a79f556 100644
--- a/bin/ksh/shf.c
+++ b/bin/ksh/shf.c
@@ -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;
diff --git a/bin/ksh/tree.c b/bin/ksh/tree.c
index 9c01ee2c0fd..25aff751c0e 100644
--- a/bin/ksh/tree.c
+++ b/bin/ksh/tree.c
@@ -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;