From 143cf52f816688c8d023c5b9c414f4eaaa48ce41 Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 26 May 2002 16:53:30 +0000 Subject: [PATCH] __STDC__ is always defined on NetBSD. --- lib/libc/sys/Lint___syscall.c | 14 ++------- lib/libc/sys/Lint_syscall.c | 14 ++------- lib/libc/sys/__semctl13.c | 27 ++++------------- lib/libc/sys/semctl.c | 14 +++------ lib/libcurses/ctrace.c | 21 ++----------- lib/libcurses/printw.c | 55 ++--------------------------------- lib/libcurses/scanw.c | 52 ++------------------------------- lib/libcurses/tscroll.c | 14 ++------- lib/libkstream/kstream.c | 13 +-------- lib/libkstream/kstream.h | 22 +------------- 10 files changed, 24 insertions(+), 222 deletions(-) diff --git a/lib/libc/sys/Lint___syscall.c b/lib/libc/sys/Lint___syscall.c index e49a0ae5870e..d474949d5d43 100644 --- a/lib/libc/sys/Lint___syscall.c +++ b/lib/libc/sys/Lint___syscall.c @@ -1,26 +1,16 @@ -/* $NetBSD: Lint___syscall.c,v 1.1 2000/12/10 21:27:38 mycroft Exp $ */ +/* $NetBSD: Lint___syscall.c,v 1.2 2002/05/26 16:53:30 wiz Exp $ */ /* * This file placed in the public domain. * Chris Demetriou, November 5, 1997. */ -#include -#ifdef __STDC__ #include -#else -#include -#endif +#include /*ARGSUSED*/ quad_t -#ifdef __STDC__ __syscall(quad_t arg1, ...) -#else -__syscall(arg1, va_alist) - quad_t arg1; - va_dcl -#endif { return (0); } diff --git a/lib/libc/sys/Lint_syscall.c b/lib/libc/sys/Lint_syscall.c index a0d1990133a9..69ebf58aed81 100644 --- a/lib/libc/sys/Lint_syscall.c +++ b/lib/libc/sys/Lint_syscall.c @@ -1,26 +1,16 @@ -/* $NetBSD: Lint_syscall.c,v 1.2 2000/06/14 06:49:10 cgd Exp $ */ +/* $NetBSD: Lint_syscall.c,v 1.3 2002/05/26 16:53:30 wiz Exp $ */ /* * This file placed in the public domain. * Chris Demetriou, November 5, 1997. */ -#include -#ifdef __STDC__ #include -#else -#include -#endif +#include /*ARGSUSED*/ int -#ifdef __STDC__ syscall(int arg1, ...) -#else -syscall(arg1, va_alist) - int arg1; - va_dcl -#endif { return (0); } diff --git a/lib/libc/sys/__semctl13.c b/lib/libc/sys/__semctl13.c index 223f80097d63..6d74e8184390 100644 --- a/lib/libc/sys/__semctl13.c +++ b/lib/libc/sys/__semctl13.c @@ -1,4 +1,4 @@ -/* $NetBSD: __semctl13.c,v 1.3 2002/01/03 16:13:11 tron Exp $ */ +/* $NetBSD: __semctl13.c,v 1.4 2002/05/26 16:53:31 wiz Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -37,43 +37,26 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: __semctl13.c,v 1.3 2002/01/03 16:13:11 tron Exp $"); +__RCSID("$NetBSD: __semctl13.c,v 1.4 2002/05/26 16:53:31 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include #include #include -#if __STDC__ #include -#else -#include -#endif - /* The kernel version [... == union semun *] */ int ____semctl13 __P((int, int, int, ...)); /* The userland version [... == union semun] */ int __semctl13 __P((int, int, int, ...)); -#if __STDC__ -int __semctl13(int semid, int semnum, int cmd, ...) -#else -int __semctl13(va_alist) - va_dcl -#endif +int +__semctl13(int semid, int semnum, int cmd, ...) { va_list ap; union __semun semun; -#if __STDC__ + va_start(ap, cmd); -#else - int semid, semnum; - int cmd; - va_start(ap); - semid = va_arg(ap, int); - semnum = va_arg(ap, int); - cmd = va_arg(ap, int); -#endif switch (cmd) { case IPC_SET: case IPC_STAT: diff --git a/lib/libc/sys/semctl.c b/lib/libc/sys/semctl.c index 125cd44fa4b2..520071041acb 100644 --- a/lib/libc/sys/semctl.c +++ b/lib/libc/sys/semctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: semctl.c,v 1.8 2000/06/14 17:25:07 cgd Exp $ */ +/* $NetBSD: semctl.c,v 1.9 2002/05/26 16:53:31 wiz Exp $ */ /* * Copyright (c) 1994, 1995 Christopher G. Demetriou @@ -36,7 +36,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: semctl.c,v 1.8 2000/06/14 17:25:07 cgd Exp $"); +__RCSID("$NetBSD: semctl.c,v 1.9 2002/05/26 16:53:31 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ @@ -45,14 +45,8 @@ __RCSID("$NetBSD: semctl.c,v 1.8 2000/06/14 17:25:07 cgd Exp $"); #include #include -#if __STDC__ -int semctl(int semid, int semnum, int cmd, union __semun semun) -#else -int semctl(semid, semnum, cmd, semun) - int semid, semnum; - int cmd; - union __semun semun; -#endif +int +semctl(int semid, int semnum, int cmd, union __semun semun) { return (__semctl(semid, semnum, cmd, &semun)); } diff --git a/lib/libcurses/ctrace.c b/lib/libcurses/ctrace.c index 5828b23868ad..d7f92508bb54 100644 --- a/lib/libcurses/ctrace.c +++ b/lib/libcurses/ctrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: ctrace.c,v 1.11 2001/09/24 13:22:30 wiz Exp $ */ +/* $NetBSD: ctrace.c,v 1.12 2002/05/26 17:01:38 wiz Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -38,18 +38,13 @@ #if 0 static char sccsid[] = "@(#)ctrace.c 8.2 (Berkeley) 10/5/93"; #else -__RCSID("$NetBSD: ctrace.c,v 1.11 2001/09/24 13:22:30 wiz Exp $"); +__RCSID("$NetBSD: ctrace.c,v 1.12 2002/05/26 17:01:38 wiz Exp $"); #endif #endif /* not lint */ #ifdef DEBUG -#include - -#ifdef __STDC__ #include -#else -#include -#endif +#include #include #include @@ -64,13 +59,7 @@ __RCSID("$NetBSD: ctrace.c,v 1.11 2001/09/24 13:22:30 wiz Exp $"); static FILE *tracefp; /* Curses debugging file descriptor. */ void -#ifdef __STDC__ __CTRACE(const char *fmt,...) -#else -__CTRACE(fmt, va_alist) - char *fmt; -va_dcl -#endif { struct timeval tv; static int seencr = 1; @@ -85,11 +74,7 @@ va_dcl gettimeofday(&tv, NULL); (void) fprintf(tracefp, "%lu.%06lu: ", tv.tv_sec, tv.tv_usec); } -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void) vfprintf(tracefp, fmt, ap); seencr = (strchr(fmt, '\n') != NULL); va_end(ap); diff --git a/lib/libcurses/printw.c b/lib/libcurses/printw.c index 9aa0a4ad316f..d6c72f066c65 100644 --- a/lib/libcurses/printw.c +++ b/lib/libcurses/printw.c @@ -1,4 +1,4 @@ -/* $NetBSD: printw.c,v 1.17 2001/09/24 13:22:30 wiz Exp $ */ +/* $NetBSD: printw.c,v 1.18 2002/05/26 17:01:38 wiz Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -38,24 +38,17 @@ #if 0 static char sccsid[] = "@(#)printw.c 8.3 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: printw.c,v 1.17 2001/09/24 13:22:30 wiz Exp $"); +__RCSID("$NetBSD: printw.c,v 1.18 2002/05/26 17:01:38 wiz Exp $"); #endif #endif /* not lint */ -#ifdef __STDC__ #include -#else -#include -#endif #include "curses.h" #include "curses_private.h" /* * printw and friends. - * - * These routines make nonportable assumptions about varargs if __STDC__ - * is not in effect. */ static int __winwrite __P((void *, const char *, int)); @@ -65,22 +58,12 @@ static int __winwrite __P((void *, const char *, int)); * Printf on the standard screen. */ int -#ifdef __STDC__ printw(const char *fmt,...) -#else -printw(fmt, va_alist) - const char *fmt; -va_dcl -#endif { va_list ap; int ret; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwprintw(stdscr, fmt, ap); va_end(ap); return (ret); @@ -90,23 +73,12 @@ va_dcl * Printf on the given window. */ int -#ifdef __STDC__ wprintw(WINDOW *win, const char *fmt,...) -#else -wprintw(win, fmt, va_alist) - WINDOW *win; - const char *fmt; -va_dcl -#endif { va_list ap; int ret; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwprintw(win, fmt, ap); va_end(ap); return (ret); @@ -117,40 +89,21 @@ va_dcl * arguments, they cannot be macros. Sigh.... */ int -#ifdef __STDC__ mvprintw(int y, int x, const char *fmt,...) -#else -mvprintw(y, x, fmt, va_alist) - int y, x; - const char *fmt; -va_dcl -#endif { va_list ap; int ret; if (move(y, x) != OK) return (ERR); -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwprintw(stdscr, fmt, ap); va_end(ap); return (ret); } int -#ifdef __STDC__ mvwprintw(WINDOW * win, int y, int x, const char *fmt,...) -#else -mvwprintw(win, y, x, fmt, va_alist) - WINDOW *win; - int y, x; - const char *fmt; -va_dcl -#endif { va_list ap; int ret; @@ -158,11 +111,7 @@ va_dcl if (wmove(win, y, x) != OK) return (ERR); -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwprintw(win, fmt, ap); va_end(ap); return (ret); diff --git a/lib/libcurses/scanw.c b/lib/libcurses/scanw.c index 8cadbdd6d5c0..0fabb781b61c 100644 --- a/lib/libcurses/scanw.c +++ b/lib/libcurses/scanw.c @@ -1,4 +1,4 @@ -/* $NetBSD: scanw.c,v 1.15 2000/12/30 17:20:55 martin Exp $ */ +/* $NetBSD: scanw.c,v 1.16 2002/05/26 17:01:38 wiz Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)scanw.c 8.3 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: scanw.c,v 1.15 2000/12/30 17:20:55 martin Exp $"); +__RCSID("$NetBSD: scanw.c,v 1.16 2002/05/26 17:01:38 wiz Exp $"); #endif #endif /* not lint */ @@ -46,11 +46,7 @@ __RCSID("$NetBSD: scanw.c,v 1.15 2000/12/30 17:20:55 martin Exp $"); * scanw and friends. */ -#ifdef __STDC__ #include -#else -#include -#endif #include "curses.h" @@ -59,22 +55,12 @@ __RCSID("$NetBSD: scanw.c,v 1.15 2000/12/30 17:20:55 martin Exp $"); * Implement a scanf on the standard screen. */ int -#ifdef __STDC__ scanw(const char *fmt,...) -#else -scanw(fmt, va_alist) - const char *fmt; -va_dcl -#endif { va_list ap; int ret; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwscanw(stdscr, fmt, ap); va_end(ap); return (ret); @@ -84,23 +70,12 @@ va_dcl * Implements a scanf on the given window. */ int -#ifdef __STDC__ wscanw(WINDOW *win, const char *fmt,...) -#else -wscanw(win, fmt, va_alist) - WINDOW *win; - const char *fmt; -va_dcl -#endif { va_list ap; int ret; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwscanw(win, fmt, ap); va_end(ap); return (ret); @@ -111,51 +86,28 @@ va_dcl * arguments, they cannot be macros. Another sigh.... */ int -#ifdef __STDC__ mvscanw(int y, int x, const char *fmt,...) -#else -mvscanw(y, x, fmt, va_alist) - int y, x; - const char *fmt; -va_dcl -#endif { va_list ap; int ret; if (move(y, x) != OK) return (ERR); -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwscanw(stdscr, fmt, ap); va_end(ap); return (ret); } int -#ifdef __STDC__ mvwscanw(WINDOW * win, int y, int x, const char *fmt,...) -#else -mvwscanw(win, y, x, fmt, va_alist) - WINDOW *win; - int y, x; - const char *fmt; -va_dcl -#endif { va_list ap; int ret; if (move(y, x) != OK) return (ERR); -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vwscanw(win, fmt, ap); va_end(ap); return (ret); diff --git a/lib/libcurses/tscroll.c b/lib/libcurses/tscroll.c index 20eb9044e4c0..a6e6410277ca 100644 --- a/lib/libcurses/tscroll.c +++ b/lib/libcurses/tscroll.c @@ -1,4 +1,4 @@ -/* $NetBSD: tscroll.c,v 1.9 2000/04/27 00:27:56 jdc Exp $ */ +/* $NetBSD: tscroll.c,v 1.10 2002/05/26 17:01:38 wiz Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)tscroll.c 8.4 (Berkeley) 7/27/94"; #else -__RCSID("$NetBSD: tscroll.c,v 1.9 2000/04/27 00:27:56 jdc Exp $"); +__RCSID("$NetBSD: tscroll.c,v 1.10 2002/05/26 17:01:38 wiz Exp $"); #endif #endif /* not lint */ @@ -81,13 +81,7 @@ __tscroll(const char *cap, int n1, int n2) * is also defined but we don't support it (yet). */ char * -#if __STDC__ __parse_cap (char const *cap, ...) -#else -__parse_cap (cap, va_alist) - const char *cap; - va_dcl -#endif { va_list ap; static char result[MAXRETURNSIZE]; @@ -95,11 +89,7 @@ __parse_cap (cap, va_alist) char *dp; int have_input; -#if __STDC__ va_start (ap, cap); -#else - va_start(ap); -#endif n = 0; /* XXX gcc -Wuninitialized */ if (cap == NULL) diff --git a/lib/libkstream/kstream.c b/lib/libkstream/kstream.c index bbbdb5842bba..9889ec47ce1e 100644 --- a/lib/libkstream/kstream.c +++ b/lib/libkstream/kstream.c @@ -1,4 +1,4 @@ -/* $NetBSD: kstream.c,v 1.3 2001/11/05 15:01:02 lukem Exp $ */ +/* $NetBSD: kstream.c,v 1.4 2002/05/26 17:04:44 wiz Exp $ */ /* Encrypted-stream implementation for MIT Kerberos. Written by Ken Raeburn (Raeburn@Cygnus.COM). @@ -53,19 +53,8 @@ #endif #include -#ifdef __STDC__ int krb_net_write (int, char *, int); int krb_net_read (int, char *, int); -#else -int krb_net_write (); -int krb_net_read (); -void abort (); -char *memmove (); -void *memcpy (); -char *malloc (); -char *realloc (); -void free (); -#endif #ifdef sun #ifndef solaris20 diff --git a/lib/libkstream/kstream.h b/lib/libkstream/kstream.h index 5b6126331a0f..1ace67f2f722 100644 --- a/lib/libkstream/kstream.h +++ b/lib/libkstream/kstream.h @@ -6,7 +6,7 @@ For copying and distribution information, please see the file . - $NetBSD: kstream.h,v 1.1.1.1 2000/06/17 06:24:28 thorpej Exp $ + $NetBSD: kstream.h,v 1.2 2002/05/26 17:04:44 wiz Exp $ */ #include /* for size_t */ @@ -15,11 +15,7 @@ requested, output will be flushed before input is read, or when kstream_flush is called. */ -#if defined (__STDC__) || defined (__cplusplus) typedef void *kstream_ptr; -#else -typedef char *kstream_ptr; -#endif typedef struct kstream_rec *kstream; struct kstream_data_block { kstream_ptr ptr; @@ -31,7 +27,6 @@ struct kstream_crypt_ctl_block { Right now, it's just a hack so we can bang out the interface in some form that lets us run both rcp and rlogin. This is also the only reason the contents of this structure are public. */ -#if defined (__STDC__) || defined (__cplusplus) int (*encrypt) (struct kstream_data_block *, /* output -- written */ struct kstream_data_block*, /* input */ kstream str @@ -42,14 +37,9 @@ struct kstream_crypt_ctl_block { ); /* ret val = # input bytes used */ int (*init) (kstream str, kstream_ptr data); void (*destroy) (kstream str); -#else - int (*encrypt) (), (*decrypt) (), (*init) (); - void (*destroy) (); -#endif }; /* ctl==0 means no encryption. data is specific to crypt functions */ -#if defined (__STDC__) || defined (__cplusplus) kstream kstream_create_from_fd (int fd, const struct kstream_crypt_ctl_block *ctl, kstream_ptr data); @@ -64,21 +54,11 @@ int kstream_read (kstream, void*, size_t); int kstream_flush (kstream); int kstream_destroy (kstream); void kstream_set_buffer_mode (kstream, int); -#else -kstream kstream_create_from_fd (), - kstream_create_rlogin_from_fd (), - kstream_create_rcp_from_fd (); -void kstream_set_buffer_mode (); -#endif #if 0 /* Perhaps someday... */ kstream kstream_create (principal, host, port, ...); #endif -#if !defined (__STDC__) && !defined (__cplusplus) && !defined (const) -#define const /* empty */ -#endif - typedef struct fifo { char data[10*1024]; size_t next_write, next_read;