diff options
Diffstat (limited to 'lib/libc')
30 files changed, 4 insertions, 343 deletions
diff --git a/lib/libc/compat-43/gethostid.c b/lib/libc/compat-43/gethostid.c index 0652230..cc1b905 100644 --- a/lib/libc/compat-43/gethostid.c +++ b/lib/libc/compat-43/gethostid.c @@ -40,13 +40,8 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/sysctl.h> -#if __STDC__ long gethostid(void) -#else -long -gethostid() -#endif { int mib[2]; size_t size; diff --git a/lib/libc/compat-43/killpg.c b/lib/libc/compat-43/killpg.c index 2ab3c3b..3eafc76 100644 --- a/lib/libc/compat-43/killpg.c +++ b/lib/libc/compat-43/killpg.c @@ -45,13 +45,7 @@ __FBSDID("$FreeBSD$"); * Backwards-compatible killpg(). */ int -#if __STDC__ killpg(pid_t pgid, int sig) -#else -killpg(pgid, sig) - pid_t pgid; - int sig; -#endif { if (pgid == 1) { errno = ESRCH; diff --git a/lib/libc/compat-43/sethostid.c b/lib/libc/compat-43/sethostid.c index 1cb73b2..55ad658 100644 --- a/lib/libc/compat-43/sethostid.c +++ b/lib/libc/compat-43/sethostid.c @@ -40,14 +40,8 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/sysctl.h> -#if __STDC__ long sethostid(long hostid) -#else -long -sethostid(hostid) - long hostid; -#endif { int mib[2]; diff --git a/lib/libc/compat-43/setpgrp.c b/lib/libc/compat-43/setpgrp.c index cf0c08e..381c018 100644 --- a/lib/libc/compat-43/setpgrp.c +++ b/lib/libc/compat-43/setpgrp.c @@ -41,12 +41,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> int -#if __STDC__ setpgrp(pid_t pid, pid_t pgid) -#else -setpgrp(pid, pgid) - pid_t pid, pgid; -#endif { return(setpgid(pid, pgid)); } diff --git a/lib/libc/compat-43/setrgid.c b/lib/libc/compat-43/setrgid.c index 4b6d751..1617ab13 100644 --- a/lib/libc/compat-43/setrgid.c +++ b/lib/libc/compat-43/setrgid.c @@ -40,12 +40,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> int -#ifdef __STDC__ setrgid(gid_t rgid) -#else -setrgid(rgid) - int rgid; -#endif { return (setregid(rgid, -1)); diff --git a/lib/libc/compat-43/setruid.c b/lib/libc/compat-43/setruid.c index 37b2b5b..a0a6e81 100644 --- a/lib/libc/compat-43/setruid.c +++ b/lib/libc/compat-43/setruid.c @@ -40,12 +40,7 @@ __FBSDID("$FreeBSD$"); #include <unistd.h> int -#ifdef __STDC__ setruid(uid_t ruid) -#else -setruid(ruid) - int ruid; -#endif { return (setreuid(ruid, -1)); diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c index ec367e1..4d81aee 100644 --- a/lib/libc/db/test/dbtest.c +++ b/lib/libc/db/test/dbtest.c @@ -725,27 +725,14 @@ usage() exit(1); } -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif void -#if __STDC__ err(const char *fmt, ...) -#else -err(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ + va_start(ap, fmt); -#else - va_start(ap); -#endif (void)fprintf(stderr, "dbtest: "); (void)vfprintf(stderr, fmt, ap); va_end(ap); diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 1cb8db7..99e3806 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -48,34 +48,19 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <paths.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "un-namespace.h" extern char **environ; int -#if __STDC__ execl(const char *name, const char *arg, ...) -#else -execl(name, arg, va_alist) - const char *name; - const char *arg; - va_dcl -#endif { va_list ap; char **argv; int n; -#if __STDC__ va_start(ap, arg); -#else - va_start(ap); -#endif n = 1; while (va_arg(ap, char *) != NULL) n++; @@ -85,11 +70,7 @@ execl(name, arg, va_alist) errno = ENOMEM; return (-1); } -#if __STDC__ va_start(ap, arg); -#else - va_start(ap); -#endif n = 1; argv[0] = (char *)arg; while ((argv[n] = va_arg(ap, char *)) != NULL) @@ -99,24 +80,13 @@ execl(name, arg, va_alist) } int -#if __STDC__ execle(const char *name, const char *arg, ...) -#else -execle(name, arg, va_alist) - const char *name; - const char *arg; - va_dcl -#endif { va_list ap; char **argv, **envp; int n; -#if __STDC__ va_start(ap, arg); -#else - va_start(ap); -#endif n = 1; while (va_arg(ap, char *) != NULL) n++; @@ -126,11 +96,7 @@ execle(name, arg, va_alist) errno = ENOMEM; return (-1); } -#if __STDC__ va_start(ap, arg); -#else - va_start(ap); -#endif n = 1; argv[0] = (char *)arg; while ((argv[n] = va_arg(ap, char *)) != NULL) @@ -141,25 +107,14 @@ execle(name, arg, va_alist) } int -#if __STDC__ execlp(const char *name, const char *arg, ...) -#else -execlp(name, arg, va_alist) - const char *name; - const char *arg; - va_dcl -#endif { va_list ap; int sverrno; char **argv; int n; -#if __STDC__ va_start(ap, arg); -#else - va_start(ap); -#endif n = 1; while (va_arg(ap, char *) != NULL) n++; @@ -169,11 +124,7 @@ execlp(name, arg, va_alist) errno = ENOMEM; return (-1); } -#if __STDC__ va_start(ap, arg); -#else - va_start(ap); -#endif n = 1; argv[0] = (char *)arg; while ((argv[n] = va_arg(ap, char *)) != NULL) diff --git a/lib/libc/gen/getosreldate.c b/lib/libc/gen/getosreldate.c index 6cc3f5c..b0421a3 100644 --- a/lib/libc/gen/getosreldate.c +++ b/lib/libc/gen/getosreldate.c @@ -40,13 +40,8 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/sysctl.h> -#if __STDC__ int getosreldate(void) -#else -int -getosreldate() -#endif { int mib[2]; size_t size; diff --git a/lib/libc/gen/semctl.c b/lib/libc/gen/semctl.c index a64e125..a449cac 100644 --- a/lib/libc/gen/semctl.c +++ b/lib/libc/gen/semctl.c @@ -4,30 +4,16 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include <stdlib.h> -#if __STDC__ int semctl(int semid, int semnum, int cmd, ...) -#else -int semctl(semid, semnum, cmd, va_alist) - int semid, semnum; - int cmd; - va_dcl -#endif { va_list ap; union semun semun; union semun *semun_ptr; -#if __STDC__ + va_start(ap, cmd); -#else - va_start(ap); -#endif if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL || cmd == SETVAL || cmd == SETALL) { semun = va_arg(ap, union semun); diff --git a/lib/libc/gen/sethostname.c b/lib/libc/gen/sethostname.c index 1f0a14a..769401a 100644 --- a/lib/libc/gen/sethostname.c +++ b/lib/libc/gen/sethostname.c @@ -40,15 +40,8 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/sysctl.h> -#if __STDC__ int sethostname(const char *name, int namelen) -#else -int -sethostname(name, namelen) - char *name; - int namelen; -#endif { int mib[2]; diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 621e63a..fa19907 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -54,11 +54,7 @@ __FBSDID("$FreeBSD$"); #include <time.h> #include <unistd.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "un-namespace.h" #include "libc_private.h" @@ -113,22 +109,11 @@ int writehook(cookie, buf, len) * print message on log file; output is intended for syslogd(8). */ void -#if __STDC__ syslog(int pri, const char *fmt, ...) -#else -syslog(pri, fmt, va_alist) - int pri; - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif vsyslog(pri, fmt, ap); va_end(ap); } diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c index 592d7bf..cc57cf8 100644 --- a/lib/libc/gen/termios.c +++ b/lib/libc/gen/termios.c @@ -83,13 +83,7 @@ tcsetattr(fd, opt, t) } int -#if __STDC__ tcsetpgrp(int fd, pid_t pgrp) -#else -tcsetpgrp(fd, pgrp) - int fd; - pid_t pgrp; -#endif { int s; diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c index bc4903c..640ae3af 100644 --- a/lib/libc/gen/vis.c +++ b/lib/libc/gen/vis.c @@ -97,11 +97,7 @@ vis(dst, c, flag, nextc) *dst++ = '\\'; *dst++ = 'b'; goto done; -#if __STDC__ case '\a': -#else - case '\007': -#endif *dst++ = '\\'; *dst++ = 'a'; goto done; diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c index 307b2c6..25da107 100644 --- a/lib/libc/net/nsdispatch.c +++ b/lib/libc/net/nsdispatch.c @@ -212,18 +212,8 @@ _nsdbtput(dbt) int -#if __STDC__ nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const char *method, const ns_src defaults[], ...) -#else -nsdispatch(retval, disp_tab, database, method, defaults, va_alist) - void *retval; - const ns_dtab disp_tab[]; - const char *database; - const char *method; - const ns_src defaults[]; - va_dcl -#endif { va_list ap; int i, curdisp, result; @@ -250,11 +240,7 @@ nsdispatch(retval, disp_tab, database, method, defaults, va_alist) break; result = 0; if (disp_tab[curdisp].callback) { -#if __STDC__ va_start(ap, defaults); -#else - va_start(ap); -#endif result = disp_tab[curdisp].callback(retval, disp_tab[curdisp].cb_data, ap); va_end(ap); diff --git a/lib/libc/stdio/asprintf.c b/lib/libc/stdio/asprintf.c index 276f86f..57116e6 100644 --- a/lib/libc/stdio/asprintf.c +++ b/lib/libc/stdio/asprintf.c @@ -33,33 +33,18 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <stdlib.h> #include <errno.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "local.h" int -#if __STDC__ asprintf(char **str, char const *fmt, ...) -#else -asprintf(str, fmt, va_alist) - char **str; - const char *fmt; - va_dcl -#endif { int ret; va_list ap; FILE f; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif f._file = -1; f._flags = __SWR | __SSTR | __SALC; f._bf._base = f._p = (unsigned char *)malloc(128); diff --git a/lib/libc/stdio/fprintf.c b/lib/libc/stdio/fprintf.c index 53c1328..55ae1d5 100644 --- a/lib/libc/stdio/fprintf.c +++ b/lib/libc/stdio/fprintf.c @@ -41,30 +41,15 @@ static char sccsid[] = "@(#)fprintf.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD$"); #include <stdio.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif int -#if __STDC__ fprintf(FILE *fp, const char *fmt, ...) -#else -fprintf(fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vfprintf(fp, fmt, ap); va_end(ap); return (ret); diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c index e147e79..1c376a8 100644 --- a/lib/libc/stdio/fscanf.c +++ b/lib/libc/stdio/fscanf.c @@ -42,33 +42,17 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include <stdio.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "un-namespace.h" #include "libc_private.h" -#if __STDC__ int -fscanf(FILE *fp, char const *fmt, ...) { - int ret; - va_list ap; - - va_start(ap, fmt); -#else -int -fscanf(fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl +fscanf(FILE *fp, char const *fmt, ...) { int ret; va_list ap; - va_start(ap); -#endif + va_start(ap, fmt); FLOCKFILE(fp); ret = __svfscanf(fp, fmt, ap); va_end(ap); diff --git a/lib/libc/stdio/funopen.c b/lib/libc/stdio/funopen.c index 28da521..459cd5c 100644 --- a/lib/libc/stdio/funopen.c +++ b/lib/libc/stdio/funopen.c @@ -49,11 +49,7 @@ FILE * funopen(cookie, readfn, writefn, seekfn, closefn) const void *cookie; int (*readfn)(), (*writefn)(); -#if __STDC__ fpos_t (*seekfn)(void *cookie, fpos_t off, int whence); -#else - fpos_t (*seekfn)(); -#endif int (*closefn)(); { FILE *fp; diff --git a/lib/libc/stdio/fvwrite.h b/lib/libc/stdio/fvwrite.h index e55341b..df59bf0 100644 --- a/lib/libc/stdio/fvwrite.h +++ b/lib/libc/stdio/fvwrite.h @@ -50,8 +50,4 @@ struct __suio { int uio_resid; }; -#if __STDC__ || c_plusplus extern int __sfvwrite(FILE *, struct __suio *); -#else -extern int __sfvwrite(); -#endif diff --git a/lib/libc/stdio/printf.c b/lib/libc/stdio/printf.c index 1d24931..bd7d16c 100644 --- a/lib/libc/stdio/printf.c +++ b/lib/libc/stdio/printf.c @@ -41,29 +41,15 @@ static char sccsid[] = "@(#)printf.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD$"); #include <stdio.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif int -#if __STDC__ printf(char const *fmt, ...) -#else -printf(fmt, va_alist) - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = vfprintf(stdout, fmt, ap); va_end(ap); return (ret); diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c index 98cd4e2..990c9b0 100644 --- a/lib/libc/stdio/scanf.c +++ b/lib/libc/stdio/scanf.c @@ -42,32 +42,17 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include <stdio.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "un-namespace.h" #include "libc_private.h" -#if __STDC__ int scanf(char const *fmt, ...) -#else -int -scanf(fmt, va_alist) - char *fmt; - va_dcl -#endif { int ret; va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif FLOCKFILE(stdin); ret = __svfscanf(stdin, fmt, ap); FUNLOCKFILE(stdin); diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c index 0a09bac..e3e71f2 100644 --- a/lib/libc/stdio/snprintf.c +++ b/lib/libc/stdio/snprintf.c @@ -42,25 +42,12 @@ __FBSDID("$FreeBSD$"); #include <limits.h> #include <stdio.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "local.h" -#if __STDC__ int snprintf(char *str, size_t n, char const *fmt, ...) -#else -int -snprintf(str, n, fmt, va_alist) - char *str; - size_t n; - char *fmt; - va_dcl -#endif { size_t on; int ret; @@ -72,11 +59,7 @@ snprintf(str, n, fmt, va_alist) n--; if (n > INT_MAX) n = INT_MAX; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c index 075ac63..7b81c1f 100644 --- a/lib/libc/stdio/sprintf.c +++ b/lib/libc/stdio/sprintf.c @@ -41,23 +41,12 @@ static char sccsid[] = "@(#)sprintf.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD$"); #include <stdio.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include <limits.h> #include "local.h" int -#if __STDC__ sprintf(char *str, char const *fmt, ...) -#else -sprintf(str, fmt, va_alist) - char *str; - char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -67,11 +56,7 @@ sprintf(str, fmt, va_alist) f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = __vfprintf(&f, fmt, ap); va_end(ap); *f._p = 0; diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c index 5a9ada6..d988326 100644 --- a/lib/libc/stdio/sscanf.c +++ b/lib/libc/stdio/sscanf.c @@ -42,11 +42,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <string.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "local.h" static int eofread(void *, char *, int); @@ -62,16 +58,8 @@ eofread(cookie, buf, len) return (0); } -#if __STDC__ int sscanf(const char *str, char const *fmt, ...) -#else -int -sscanf(str, fmt, va_alist) - char *str; - char *fmt; - va_dcl -#endif { int ret; va_list ap; @@ -87,11 +75,7 @@ sscanf(str, fmt, va_alist) f._lb._base = NULL; f._extra = &extra; INITEXTRA(&f); -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ret = __svfscanf(&f, fmt, ap); va_end(ap); return (ret); diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index b723c67..55fc82c 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -58,11 +58,7 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <string.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "un-namespace.h" #include "libc_private.h" diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index a31d6ad0..e329eed 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -46,11 +46,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <stdlib.h> #include <stddef.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include <string.h> #include "un-namespace.h" diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 0a72ca8..aa9b318 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -33,11 +33,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <limits.h> #include <locale.h> -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -91,17 +87,8 @@ static void __setup_vars(int, char *, char *, char *, char **); static int __calc_left_pad(int, char *); static char *__format_grouped_double(double, int *, int, int, int); -#if __STDC__ ssize_t strfmon(char *s, size_t maxsize, const char *format, ...) -#else -ssize_t -strfmon(s, maxsize, format, va_alist) - char *s; - size_t maxsize; - const char *format; - va_dcl -#endif { va_list ap; char *dst; /* output destination pointer */ @@ -127,11 +114,7 @@ strfmon(s, maxsize, format, va_alist) char *tmpptr; /* temporary vars */ int *ntmp; -#if __STDC__ va_start(ap, format); -#else - va_start(ap); -#endif lc = localeconv(); dst = s; diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c index 9258d71..eaa7ad0 100644 --- a/lib/libc/stdlib/strtod.c +++ b/lib/libc/stdlib/strtod.c @@ -1378,18 +1378,7 @@ strtod if (e1 > DBL_MAX_10_EXP) { ovfl: errno = ERANGE; -#ifdef __STDC__ rv = HUGE_VAL; -#else - /* Can't trust HUGE_VAL */ -#ifdef IEEE_Arith - word0(rv) = Exp_mask; - word1(rv) = 0; -#else - word0(rv) = Big0; - word1(rv) = Big1; -#endif -#endif goto ret; } if (e1 >>= 4) { diff --git a/lib/libc/stdtime/private.h b/lib/libc/stdtime/private.h index 8568ab1..214442c 100644 --- a/lib/libc/stdtime/private.h +++ b/lib/libc/stdtime/private.h @@ -107,19 +107,6 @@ static char privatehid[] = "@(#)private.h 7.43"; #define is_digit(c) ((unsigned)(c) - '0' <= 9) /* -** Workarounds for compilers/systems. -*/ - -#ifndef P -#ifdef __STDC__ -#define P(x) x -#endif /* defined __STDC__ */ -#ifndef __STDC__ -#define P(x) () -#endif /* !defined __STDC__ */ -#endif /* !defined P */ - -/* ** SunOS 4.1.1 headers lack FILENAME_MAX. */ |