Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/ksh ksh: Use ANSI C varargs, drop support for older vers...
details: https://anonhg.NetBSD.org/src/rev/adde1e1fb496
branches: trunk
changeset: 354632:adde1e1fb496
user: kamil <kamil%NetBSD.org@localhost>
date: Fri Jun 23 00:18:01 2017 +0000
description:
ksh: Use ANSI C varargs, drop support for older version <varargs.h>
diffstat:
bin/ksh/io.c | 18 +++++++++---------
bin/ksh/lex.c | 6 +++---
bin/ksh/sh.h | 14 +++-----------
bin/ksh/shf.c | 10 +++++-----
bin/ksh/tree.c | 8 ++++----
5 files changed, 24 insertions(+), 32 deletions(-)
diffs (222 lines):
diff -r 7992e93a6f04 -r adde1e1fb496 bin/ksh/io.c
--- a/bin/ksh/io.c Fri Jun 23 00:11:01 2017 +0000
+++ b/bin/ksh/io.c Fri Jun 23 00:18:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $ */
+/* $NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $ */
/*
* shell buffered IO and formatted output
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $");
+__RCSID("$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $");
#endif
@@ -37,7 +37,7 @@
exstat = 1;
if (*fmt) {
error_prefix(TRUE);
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
shf_putchar('\n', shl_out);
@@ -60,7 +60,7 @@
va_list va;
error_prefix(fileline);
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
shf_putchar('\n', shl_out);
@@ -88,7 +88,7 @@
/* not set when main() calls parse_args() */
if (builtin_argv0)
shf_fprintf(shl_out, "%s: ", builtin_argv0);
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
shf_putchar('\n', shl_out);
@@ -121,7 +121,7 @@
error_prefix(TRUE);
shf_fprintf(shl_out, "internal error: ");
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
shf_putchar('\n', shl_out);
@@ -160,7 +160,7 @@
if (!initio_done) /* shl_out may not be set up yet... */
return;
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
shf_flush(shl_out);
@@ -180,7 +180,7 @@
if (!shl_stdout_ok)
internal_errorf(1, "shl_stdout not valid");
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_stdout, fmt, va);
va_end(va);
}
@@ -216,7 +216,7 @@
if (!kshdebug_shf)
return;
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_fprintf(kshdebug_shf, "[%d] ", getpid());
shf_vfprintf(kshdebug_shf, fmt, va);
va_end(va);
diff -r 7992e93a6f04 -r adde1e1fb496 bin/ksh/lex.c
--- a/bin/ksh/lex.c Fri Jun 23 00:11:01 2017 +0000
+++ b/bin/ksh/lex.c Fri Jun 23 00:18:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.18 2017/06/22 14:20:46 kamil Exp $ */
+/* $NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $ */
/*
* lexical analysis and source input
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.18 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $");
#endif
@@ -852,7 +852,7 @@
source->str = null; /* zap pending input */
error_prefix(TRUE);
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
errorf("%s", null);
diff -r 7992e93a6f04 -r adde1e1fb496 bin/ksh/sh.h
--- a/bin/ksh/sh.h Fri Jun 23 00:11:01 2017 +0000
+++ b/bin/ksh/sh.h Fri Jun 23 00:18:01 2017 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */
+/* $NetBSD: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */
/*
* Public Domain Bourne/Korn shell
*/
-/* $Id: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */
+/* $Id: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */
#include "config.h" /* system and option configuration info */
@@ -23,15 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-
-#ifdef HAVE_PROTOTYPES
-# include <stdarg.h>
-# define SH_VA_START(va, argn) va_start(va, argn)
-#else
-# include <varargs.h>
-# define SH_VA_START(va, argn) va_start(va)
-#endif /* HAVE_PROTOTYPES */
-
+#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
diff -r 7992e93a6f04 -r adde1e1fb496 bin/ksh/shf.c
--- a/bin/ksh/shf.c Fri Jun 23 00:11:01 2017 +0000
+++ b/bin/ksh/shf.c Fri Jun 23 00:18:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: shf.c,v 1.10 2017/06/22 14:20:46 kamil Exp $ */
+/* $NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $ */
/*
* Shell file I/O routines
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: shf.c,v 1.10 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $");
#endif
@@ -770,7 +770,7 @@
va_list args;
int n;
- SH_VA_START(args, fmt);
+ va_start(args, fmt);
n = shf_vfprintf(shf, fmt, args);
va_end(args);
@@ -797,7 +797,7 @@
(long) buf, bsize);
shf_sopen(buf, bsize, SHF_WR, &shf);
- SH_VA_START(args, fmt);
+ va_start(args, fmt);
n = shf_vfprintf(&shf, fmt, args);
va_end(args);
shf_sclose(&shf); /* null terminates */
@@ -817,7 +817,7 @@
va_list args;
shf_sopen((char *) 0, 0, SHF_WR|SHF_DYNAMIC, &shf);
- SH_VA_START(args, fmt);
+ va_start(args, fmt);
shf_vfprintf(&shf, fmt, args);
va_end(args);
return shf_sclose(&shf); /* null terminates */
diff -r 7992e93a6f04 -r adde1e1fb496 bin/ksh/tree.c
--- a/bin/ksh/tree.c Fri Jun 23 00:11:01 2017 +0000
+++ b/bin/ksh/tree.c Fri Jun 23 00:18:01 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.6 2005/06/26 19:09:00 christos Exp $ */
+/* $NetBSD: tree.c,v 1.7 2017/06/23 00:18:01 kamil Exp $ */
/*
* command tree climbing
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: tree.c,v 1.6 2005/06/26 19:09:00 christos Exp $");
+__RCSID("$NetBSD: tree.c,v 1.7 2017/06/23 00:18:01 kamil Exp $");
#endif
@@ -387,7 +387,7 @@
{
va_list va;
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
vfptreef(shf, indent, fmt, va);
va_end(va);
@@ -411,7 +411,7 @@
shf_sopen(s, n, SHF_WR | (s ? 0 : SHF_DYNAMIC), &shf);
- SH_VA_START(va, fmt);
+ va_start(va, fmt);
vfptreef(&shf, 0, fmt, va);
va_end(va);
Home |
Main Index |
Thread Index |
Old Index