From bb31faf853c37f2eec7b874517481377d0277b9d Mon Sep 17 00:00:00 2001 From: fvdl Date: Sun, 22 Dec 1996 23:00:02 +0000 Subject: [PATCH] Make this compile again, including Politically Correct const handling. --- sys/compat/ibcs2/ibcs2_misc.c | 32 +++++++++---------- sys/compat/linux/common/linux_socket.c | 8 ++--- sys/compat/linux/common/linux_socketcall.c | 8 ++--- sys/compat/linux/linux_socket.c | 8 ++--- sys/compat/linux/multiarch/linux_socketcall.c | 8 ++--- sys/compat/svr4/svr4_stat.c | 8 +++-- sys/compat/svr4/svr4_stream.c | 17 ++++++---- 7 files changed, 47 insertions(+), 42 deletions(-) diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c index c7e624413acd..579271ce7d48 100644 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ b/sys/compat/ibcs2/ibcs2_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_misc.c,v 1.21 1996/10/02 18:04:59 ws Exp $ */ +/* $NetBSD: ibcs2_misc.c,v 1.22 1996/12/22 23:01:12 fvdl Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -642,8 +642,7 @@ ibcs2_sys_setgroups(p, v, retval) caddr_t sg = stackgap_init(p->p_emul); SCARG(&sa, gidsetsize) = SCARG(uap, gidsetsize); - SCARG(&sa, gidset) = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * - sizeof(gid_t *)); + gp = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * sizeof(gid_t *)); iset = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * sizeof(ibcs2_gid_t *)); if (SCARG(&sa, gidsetsize)) { @@ -652,8 +651,9 @@ ibcs2_sys_setgroups(p, v, retval) if (error) return error; } - for (i = 0, gp = SCARG(&sa, gidset); i < SCARG(&sa, gidsetsize); i++) - *gp++ = (gid_t)iset[i]; + for (i = 0; i < SCARG(&sa, gidsetsize); i++) + gp[i]= (gid_t)iset[i]; + SCARG(&sa, gidset) = gp; return sys_setgroups(p, &sa, retval); } @@ -963,14 +963,16 @@ ibcs2_sys_stime(p, v, retval) int error; struct sys_settimeofday_args sa; caddr_t sg = stackgap_init(p->p_emul); + struct timeval *tvp; - SCARG(&sa, tv) = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv))); + tvp = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv))); SCARG(&sa, tzp) = NULL; error = copyin((caddr_t)SCARG(uap, timep), - &(SCARG(&sa, tv)->tv_sec), sizeof(long)); + (void *)&tvp->tv_sec, sizeof(long)); if (error) return error; - SCARG(&sa, tv)->tv_usec = 0; + tvp->tv_usec = 0; + SCARG(&sa, tv) = tvp; if ((error = sys_settimeofday(p, &sa, retval)) != 0) return EPERM; return 0; @@ -1000,14 +1002,12 @@ ibcs2_sys_utime(p, v, retval) sizeof(ubuf)); if (error) return error; - SCARG(&sa, tptr) = stackgap_alloc(&sg, - 2 * sizeof(struct timeval *)); - tp = (struct timeval *)SCARG(&sa, tptr); - tp->tv_sec = ubuf.actime; - tp->tv_usec = 0; - tp++; - tp->tv_sec = ubuf.modtime; - tp->tv_usec = 0; + tp = stackgap_alloc(&sg, 2 * sizeof(struct timeval *)); + tp[0].tv_sec = ubuf.actime; + tp[0].tv_usec = 0; + tp[1].tv_sec = ubuf.modtime; + tp[1].tv_usec = 0; + SCARG(&sa, tptr) = tp; } else SCARG(&sa, tptr) = NULL; return sys_utimes(p, &sa, retval); diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c index 747cf8a7cfdd..2e737abaa75e 100644 --- a/sys/compat/linux/common/linux_socket.c +++ b/sys/compat/linux/common/linux_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */ +/* $NetBSD: linux_socket.c,v 1.15 1996/12/22 23:02:26 fvdl Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -170,7 +170,7 @@ linux_bind(p, uap, retval) return error; SCARG(&bba, s) = lba.s; - SCARG(&bba, name) = (caddr_t) lba.name; + SCARG(&bba, name) = (void *) lba.name; SCARG(&bba, namelen) = lba.namelen; return sys_bind(p, &bba, retval); @@ -194,7 +194,7 @@ linux_connect(p, uap, retval) return error; SCARG(&bca, s) = lca.s; - SCARG(&bca, name) = (caddr_t) lca.name; + SCARG(&bca, name) = (void *) lca.name; SCARG(&bca, namelen) = lca.namelen; return sys_connect(p, &bca, retval); @@ -398,7 +398,7 @@ linux_sendto(p, uap, retval) SCARG(&bsa, buf) = lsa.msg; SCARG(&bsa, len) = lsa.len; SCARG(&bsa, flags) = lsa.flags; - SCARG(&bsa, to) = (caddr_t) lsa.to; + SCARG(&bsa, to) = (void *) lsa.to; SCARG(&bsa, tolen) = lsa.tolen; return sys_sendto(p, &bsa, retval); diff --git a/sys/compat/linux/common/linux_socketcall.c b/sys/compat/linux/common/linux_socketcall.c index 04c409cd167e..4e5882c69673 100644 --- a/sys/compat/linux/common/linux_socketcall.c +++ b/sys/compat/linux/common/linux_socketcall.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socketcall.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */ +/* $NetBSD: linux_socketcall.c,v 1.15 1996/12/22 23:02:26 fvdl Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -170,7 +170,7 @@ linux_bind(p, uap, retval) return error; SCARG(&bba, s) = lba.s; - SCARG(&bba, name) = (caddr_t) lba.name; + SCARG(&bba, name) = (void *) lba.name; SCARG(&bba, namelen) = lba.namelen; return sys_bind(p, &bba, retval); @@ -194,7 +194,7 @@ linux_connect(p, uap, retval) return error; SCARG(&bca, s) = lca.s; - SCARG(&bca, name) = (caddr_t) lca.name; + SCARG(&bca, name) = (void *) lca.name; SCARG(&bca, namelen) = lca.namelen; return sys_connect(p, &bca, retval); @@ -398,7 +398,7 @@ linux_sendto(p, uap, retval) SCARG(&bsa, buf) = lsa.msg; SCARG(&bsa, len) = lsa.len; SCARG(&bsa, flags) = lsa.flags; - SCARG(&bsa, to) = (caddr_t) lsa.to; + SCARG(&bsa, to) = (void *) lsa.to; SCARG(&bsa, tolen) = lsa.tolen; return sys_sendto(p, &bsa, retval); diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 747cf8a7cfdd..2e737abaa75e 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */ +/* $NetBSD: linux_socket.c,v 1.15 1996/12/22 23:02:26 fvdl Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -170,7 +170,7 @@ linux_bind(p, uap, retval) return error; SCARG(&bba, s) = lba.s; - SCARG(&bba, name) = (caddr_t) lba.name; + SCARG(&bba, name) = (void *) lba.name; SCARG(&bba, namelen) = lba.namelen; return sys_bind(p, &bba, retval); @@ -194,7 +194,7 @@ linux_connect(p, uap, retval) return error; SCARG(&bca, s) = lca.s; - SCARG(&bca, name) = (caddr_t) lca.name; + SCARG(&bca, name) = (void *) lca.name; SCARG(&bca, namelen) = lca.namelen; return sys_connect(p, &bca, retval); @@ -398,7 +398,7 @@ linux_sendto(p, uap, retval) SCARG(&bsa, buf) = lsa.msg; SCARG(&bsa, len) = lsa.len; SCARG(&bsa, flags) = lsa.flags; - SCARG(&bsa, to) = (caddr_t) lsa.to; + SCARG(&bsa, to) = (void *) lsa.to; SCARG(&bsa, tolen) = lsa.tolen; return sys_sendto(p, &bsa, retval); diff --git a/sys/compat/linux/multiarch/linux_socketcall.c b/sys/compat/linux/multiarch/linux_socketcall.c index 04c409cd167e..4e5882c69673 100644 --- a/sys/compat/linux/multiarch/linux_socketcall.c +++ b/sys/compat/linux/multiarch/linux_socketcall.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socketcall.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */ +/* $NetBSD: linux_socketcall.c,v 1.15 1996/12/22 23:02:26 fvdl Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -170,7 +170,7 @@ linux_bind(p, uap, retval) return error; SCARG(&bba, s) = lba.s; - SCARG(&bba, name) = (caddr_t) lba.name; + SCARG(&bba, name) = (void *) lba.name; SCARG(&bba, namelen) = lba.namelen; return sys_bind(p, &bba, retval); @@ -194,7 +194,7 @@ linux_connect(p, uap, retval) return error; SCARG(&bca, s) = lca.s; - SCARG(&bca, name) = (caddr_t) lca.name; + SCARG(&bca, name) = (void *) lca.name; SCARG(&bca, namelen) = lca.namelen; return sys_connect(p, &bca, retval); @@ -398,7 +398,7 @@ linux_sendto(p, uap, retval) SCARG(&bsa, buf) = lsa.msg; SCARG(&bsa, len) = lsa.len; SCARG(&bsa, flags) = lsa.flags; - SCARG(&bsa, to) = (caddr_t) lsa.to; + SCARG(&bsa, to) = (void *) lsa.to; SCARG(&bsa, tolen) = lsa.tolen; return sys_sendto(p, &bsa, retval); diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index d78a39a85441..8709670ab6cc 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stat.c,v 1.21 1996/04/22 01:16:07 christos Exp $ */ +/* $NetBSD: svr4_stat.c,v 1.22 1996/12/22 23:00:02 fvdl Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -556,6 +556,7 @@ svr4_sys_utime(p, v, retval) struct sys_utimes_args ap; int error; caddr_t sg = stackgap_init(p->p_emul); + void *ttp; SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&ap, path) = SCARG(uap, path); @@ -566,10 +567,11 @@ svr4_sys_utime(p, v, retval) tbuf[0].tv_usec = 0; tbuf[1].tv_sec = ub.modtime; tbuf[1].tv_usec = 0; - SCARG(&ap, tptr) = stackgap_alloc(&sg, sizeof(tbuf)); - error = copyout(tbuf, SCARG(&ap, tptr), sizeof(tbuf)); + ttp = stackgap_alloc(&sg, sizeof(tbuf)); + error = copyout(tbuf, ttp, sizeof(tbuf)); if (error) return error; + SCARG(&ap, tptr) = ttp; } else SCARG(&ap, tptr) = NULL; diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 3ac5d97a037b..e97e6e37ac21 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stream.c,v 1.18 1996/12/06 03:24:32 christos Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.19 1996/12/22 23:00:03 fvdl Exp $ */ /* * Copyright (c) 1994, 1996 Christos Zoulas. All rights reserved. * @@ -259,13 +259,16 @@ clean_pipe(p, path) int error; caddr_t sg = stackgap_init(p->p_emul); size_t l = strlen(path) + 1; + void *tpath; - SCARG(&la, path) = stackgap_alloc(&sg, l); + tpath = stackgap_alloc(&sg, l); SCARG(&la, ub) = stackgap_alloc(&sg, sizeof(struct stat)); - if ((error = copyout(path, SCARG(&la, path), l)) != 0) + if ((error = copyout(path, tpath, l)) != 0) return error; + SCARG(&la, path) = tpath; + if ((error = sys_lstat(p, &la, &retval)) != 0) return 0; @@ -797,7 +800,7 @@ ti_bind(fp, fd, ioc, p) SCARG(&ba, s) = fd; DPRINTF(("TI_BIND: fileno %d\n", fd)); - SCARG(&ba, name) = (caddr_t) sup; + SCARG(&ba, name) = (void *) sup; SCARG(&ba, namelen) = sasize; if ((error = sys_bind(p, &ba, &retval)) != 0) { @@ -1475,7 +1478,7 @@ svr4_sys_putmsg(p, v, retval) struct sys_connect_args co; co.s = SCARG(uap, fd); - co.name = (caddr_t) sup; + co.name = (void *) sup; co.namelen = (int) sasize; return sys_connect(p, &co, retval); } @@ -1625,7 +1628,7 @@ svr4_sys_getmsg(p, v, retval) */ SCARG(&ga, fdes) = SCARG(uap, fd); - SCARG(&ga, asa) = (caddr_t) sup; + SCARG(&ga, asa) = (void *) sup; SCARG(&ga, alen) = flen; if ((error = sys_getpeername(p, &ga, retval)) != 0) { @@ -1684,7 +1687,7 @@ svr4_sys_getmsg(p, v, retval) * We are after a listen, so we try to accept... */ SCARG(&aa, s) = SCARG(uap, fd); - SCARG(&aa, name) = (caddr_t) sup; + SCARG(&aa, name) = (void *) sup; SCARG(&aa, anamelen) = flen; if ((error = sys_accept(p, &aa, retval)) != 0) {