Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ksh ksh: Assume ANSI C prototypes



details:   https://anonhg.NetBSD.org/src/rev/8feecde56246
branches:  trunk
changeset: 825096:8feecde56246
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Jun 30 02:51:14 2017 +0000

description:
ksh: Assume ANSI C prototypes

diffstat:

 bin/ksh/config.h |   5 +----
 bin/ksh/io.c     |  48 ++----------------------------------------------
 bin/ksh/lex.c    |  10 ++--------
 bin/ksh/sh.h     |  10 +++-------
 bin/ksh/shf.c    |  25 ++-----------------------
 bin/ksh/tree.c   |  20 ++------------------
 6 files changed, 12 insertions(+), 106 deletions(-)

diffs (truncated from 307 to 300 lines):

diff -r 15bfec188c49 -r 8feecde56246 bin/ksh/config.h
--- a/bin/ksh/config.h  Fri Jun 30 02:38:09 2017 +0000
+++ b/bin/ksh/config.h  Fri Jun 30 02:51:14 2017 +0000
@@ -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 -r 15bfec188c49 -r 8feecde56246 bin/ksh/io.c
--- a/bin/ksh/io.c      Fri Jun 30 02:38:09 2017 +0000
+++ b/bin/ksh/io.c      Fri Jun 30 02:51:14 2017 +0000
@@ -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 @@
 
 /* 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 @@
 
 /* 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 @@
  * (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 @@
 
 /* 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 @@
 
 /* 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 @@
 
 /* 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 @@
 
 /* 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 -r 15bfec188c49 -r 8feecde56246 bin/ksh/lex.c
--- a/bin/ksh/lex.c     Fri Jun 30 02:38:09 2017 +0000
+++ b/bin/ksh/lex.c     Fri Jun 30 02:51:14 2017 +0000
@@ -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 @@
 }
 
 void
-#ifdef HAVE_PROTOTYPES
 yyerror(const char *fmt, ...)
-#else
-yyerror(fmt, va_alist)
-       const char *fmt;
-       va_dcl
-#endif
 {
        va_list va;
 
diff -r 15bfec188c49 -r 8feecde56246 bin/ksh/sh.h
--- a/bin/ksh/sh.h      Fri Jun 30 02:38:09 2017 +0000
+++ b/bin/ksh/sh.h      Fri Jun 30 02:51:14 2017 +0000
@@ -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 -r 15bfec188c49 -r 8feecde56246 bin/ksh/shf.c
--- a/bin/ksh/shf.c     Fri Jun 30 02:38:09 2017 +0000
+++ b/bin/ksh/shf.c     Fri Jun 30 02:51:14 2017 +0000
@@ -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 @@
 }
 
 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 @@
 }
 
 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 @@
 }
 
 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 -r 15bfec188c49 -r 8feecde56246 bin/ksh/tree.c
--- a/bin/ksh/tree.c    Fri Jun 30 02:38:09 2017 +0000
+++ b/bin/ksh/tree.c    Fri Jun 30 02:51:14 2017 +0000
@@ -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 @@
  */
 /* 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 @@
 
 /* VARARGS */
 char *
-#ifdef HAVE_PROTOTYPES
 snptreef(char *s, int n, const char *fmt, ...)
-#else
-snptreef(s, n, fmt, va_alist)
-  char *s;



Home | Main Index | Thread Index | Old Index