mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Don't depend in the kernel on the gcc feature of doing arithmetic on
pointers of type `void *'. Warn about this in future.
This commit is contained in:
parent
454f40052a
commit
09a8dfa260
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17971
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: qsort.c,v 1.3 1995/12/26 13:24:58 bde Exp $";
|
||||
"$Id: qsort.c,v 1.4 1996/04/19 18:40:20 bde Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -107,16 +107,16 @@ qsort(a, n, es, cmp)
|
||||
loop: SWAPINIT(a, es);
|
||||
swap_cnt = 0;
|
||||
if (n < 7) {
|
||||
for (pm = a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
pm = a + (n / 2) * es;
|
||||
pm = (char *)a + (n / 2) * es;
|
||||
if (n > 7) {
|
||||
pl = a;
|
||||
pn = a + (n - 1) * es;
|
||||
pn = (char *)a + (n - 1) * es;
|
||||
if (n > 40) {
|
||||
d = (n / 8) * es;
|
||||
pl = med3(pl, pl + d, pl + 2 * d, cmp);
|
||||
@ -126,9 +126,9 @@ loop: SWAPINIT(a, es);
|
||||
pm = med3(pl, pm, pn, cmp);
|
||||
}
|
||||
swap(a, pm);
|
||||
pa = pb = a + es;
|
||||
pa = pb = (char *)a + es;
|
||||
|
||||
pc = pd = a + (n - 1) * es;
|
||||
pc = pd = (char *)a + (n - 1) * es;
|
||||
for (;;) {
|
||||
while (pb <= pc && (r = cmp(pb, a)) <= 0) {
|
||||
if (r == 0) {
|
||||
@ -154,14 +154,14 @@ loop: SWAPINIT(a, es);
|
||||
pc -= es;
|
||||
}
|
||||
if (swap_cnt == 0) { /* Switch to insertion sort */
|
||||
for (pm = a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
|
||||
pn = a + n * es;
|
||||
pn = (char *)a + n * es;
|
||||
r = min(pa - (char *)a, pb - pa);
|
||||
vecswap(a, pb - r, r);
|
||||
r = min(pd - pc, pn - pd - es);
|
||||
|
@ -1,5 +1,5 @@
|
||||
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
|
||||
# $Id: bsd.kmod.mk,v 1.23 1996/06/24 04:24:00 jkh Exp $
|
||||
# $Id: bsd.kmod.mk,v 1.24 1996/06/30 22:16:19 jkh Exp $
|
||||
#
|
||||
# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
|
||||
# <bsd.kmod.mk> includes the file named "../Makefile.inc" if it exists,
|
||||
@ -93,7 +93,7 @@
|
||||
#
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
|
||||
CFLAGS+=${COPTS} -DKERNEL -DACTUALLY_LKM_NOT_KERNEL -I${.CURDIR}/../../sys \
|
||||
${CWARNFLAGS}
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.i386,v 1.85 1996/06/12 05:54:46 gpalmer Exp $
|
||||
# $Id: Makefile.i386,v 1.86 1996/08/21 16:31:34 ache Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -28,7 +28,7 @@ I386= ${S}/i386
|
||||
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
#
|
||||
# The following flags are next up for working on:
|
||||
# -Wall
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.i386,v 1.85 1996/06/12 05:54:46 gpalmer Exp $
|
||||
# $Id: Makefile.i386,v 1.86 1996/08/21 16:31:34 ache Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -28,7 +28,7 @@ I386= ${S}/i386
|
||||
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
#
|
||||
# The following flags are next up for working on:
|
||||
# -Wall
|
||||
|
@ -1,5 +1,5 @@
|
||||
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
|
||||
# $Id: bsd.kmod.mk,v 1.23 1996/06/24 04:24:00 jkh Exp $
|
||||
# $Id: bsd.kmod.mk,v 1.24 1996/06/30 22:16:19 jkh Exp $
|
||||
#
|
||||
# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
|
||||
# <bsd.kmod.mk> includes the file named "../Makefile.inc" if it exists,
|
||||
@ -93,7 +93,7 @@
|
||||
#
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
|
||||
CFLAGS+=${COPTS} -DKERNEL -DACTUALLY_LKM_NOT_KERNEL -I${.CURDIR}/../../sys \
|
||||
${CWARNFLAGS}
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: eisaconf.c,v 1.19 1996/04/20 21:21:49 gibbs Exp $
|
||||
* $Id: eisaconf.c,v 1.20 1996/06/12 05:02:41 gpalmer Exp $
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -700,7 +700,7 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
void *ma_prev; /* Prev Node entries relative to target address space */
|
||||
int retval;
|
||||
|
||||
offset = req->oldptr + req->oldidx;
|
||||
offset = (char *)req->oldptr + req->oldidx;
|
||||
buf = malloc(kdc->kdc_datalen, M_TEMP, M_NOWAIT);
|
||||
if (!buf)
|
||||
return 0;
|
||||
@ -710,13 +710,13 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
e_dev = bufp;
|
||||
|
||||
/* Calculate initial prev nodes */
|
||||
ioa_prev = offset + ((void *)&(e_dev->ioconf.ioaddrs.lh_first)
|
||||
- (void *)e_dev);
|
||||
ma_prev = offset + ((void *)&(e_dev->ioconf.maddrs.lh_first)
|
||||
- (void *)e_dev);
|
||||
ioa_prev = (char *)offset + ((char *)&(e_dev->ioconf.ioaddrs.lh_first)
|
||||
- (char *)e_dev);
|
||||
ma_prev = (char *)offset + ((char *)&(e_dev->ioconf.maddrs.lh_first)
|
||||
- (char *)e_dev);
|
||||
|
||||
offset += sizeof(*e_dev);
|
||||
bufp += sizeof(*e_dev);
|
||||
offset = (char *)offset + sizeof(*e_dev);
|
||||
bufp = (char *)bufp + sizeof(*e_dev);
|
||||
|
||||
if (e_dev->ioconf.ioaddrs.lh_first) {
|
||||
node = e_dev->ioconf.ioaddrs.lh_first;
|
||||
@ -726,11 +726,11 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
|
||||
bcopy(node, bufp, sizeof(resvaddr_t));
|
||||
out_node = (resvaddr_t *)bufp;
|
||||
bufp += sizeof(resvaddr_t);
|
||||
offset += sizeof(resvaddr_t);
|
||||
bufp = (char *)bufp + sizeof(resvaddr_t);
|
||||
offset = (char *)offset + sizeof(resvaddr_t);
|
||||
|
||||
out_node->links.le_prev = ioa_prev;
|
||||
ioa_prev += sizeof(resvaddr_t);
|
||||
ioa_prev = (char *)ioa_prev + sizeof(resvaddr_t);
|
||||
|
||||
if (out_node->links.le_next)
|
||||
out_node->links.le_next = offset;
|
||||
@ -744,11 +744,11 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
|
||||
bcopy(node, bufp, sizeof(resvaddr_t));
|
||||
out_node = (resvaddr_t *)bufp;
|
||||
bufp += sizeof(resvaddr_t);
|
||||
offset += sizeof(resvaddr_t);
|
||||
bufp = (char *)bufp + sizeof(resvaddr_t);
|
||||
offset = (char *)offset + sizeof(resvaddr_t);
|
||||
|
||||
out_node->links.le_prev = ma_prev;
|
||||
ma_prev += sizeof(resvaddr_t);
|
||||
ma_prev = (char *)ma_prev + sizeof(resvaddr_t);
|
||||
|
||||
if (out_node->links.le_next)
|
||||
out_node->links.le_next = offset;
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.i386,v 1.85 1996/06/12 05:54:46 gpalmer Exp $
|
||||
# $Id: Makefile.i386,v 1.86 1996/08/21 16:31:34 ache Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -28,7 +28,7 @@ I386= ${S}/i386
|
||||
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
#
|
||||
# The following flags are next up for working on:
|
||||
# -Wall
|
||||
|
@ -28,7 +28,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: eisaconf.c,v 1.19 1996/04/20 21:21:49 gibbs Exp $
|
||||
* $Id: eisaconf.c,v 1.20 1996/06/12 05:02:41 gpalmer Exp $
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -700,7 +700,7 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
void *ma_prev; /* Prev Node entries relative to target address space */
|
||||
int retval;
|
||||
|
||||
offset = req->oldptr + req->oldidx;
|
||||
offset = (char *)req->oldptr + req->oldidx;
|
||||
buf = malloc(kdc->kdc_datalen, M_TEMP, M_NOWAIT);
|
||||
if (!buf)
|
||||
return 0;
|
||||
@ -710,13 +710,13 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
e_dev = bufp;
|
||||
|
||||
/* Calculate initial prev nodes */
|
||||
ioa_prev = offset + ((void *)&(e_dev->ioconf.ioaddrs.lh_first)
|
||||
- (void *)e_dev);
|
||||
ma_prev = offset + ((void *)&(e_dev->ioconf.maddrs.lh_first)
|
||||
- (void *)e_dev);
|
||||
ioa_prev = (char *)offset + ((char *)&(e_dev->ioconf.ioaddrs.lh_first)
|
||||
- (char *)e_dev);
|
||||
ma_prev = (char *)offset + ((char *)&(e_dev->ioconf.maddrs.lh_first)
|
||||
- (char *)e_dev);
|
||||
|
||||
offset += sizeof(*e_dev);
|
||||
bufp += sizeof(*e_dev);
|
||||
offset = (char *)offset + sizeof(*e_dev);
|
||||
bufp = (char *)bufp + sizeof(*e_dev);
|
||||
|
||||
if (e_dev->ioconf.ioaddrs.lh_first) {
|
||||
node = e_dev->ioconf.ioaddrs.lh_first;
|
||||
@ -726,11 +726,11 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
|
||||
bcopy(node, bufp, sizeof(resvaddr_t));
|
||||
out_node = (resvaddr_t *)bufp;
|
||||
bufp += sizeof(resvaddr_t);
|
||||
offset += sizeof(resvaddr_t);
|
||||
bufp = (char *)bufp + sizeof(resvaddr_t);
|
||||
offset = (char *)offset + sizeof(resvaddr_t);
|
||||
|
||||
out_node->links.le_prev = ioa_prev;
|
||||
ioa_prev += sizeof(resvaddr_t);
|
||||
ioa_prev = (char *)ioa_prev + sizeof(resvaddr_t);
|
||||
|
||||
if (out_node->links.le_next)
|
||||
out_node->links.le_next = offset;
|
||||
@ -744,11 +744,11 @@ eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
|
||||
bcopy(node, bufp, sizeof(resvaddr_t));
|
||||
out_node = (resvaddr_t *)bufp;
|
||||
bufp += sizeof(resvaddr_t);
|
||||
offset += sizeof(resvaddr_t);
|
||||
bufp = (char *)bufp + sizeof(resvaddr_t);
|
||||
offset = (char *)offset + sizeof(resvaddr_t);
|
||||
|
||||
out_node->links.le_prev = ma_prev;
|
||||
ma_prev += sizeof(resvaddr_t);
|
||||
ma_prev = (char *)ma_prev + sizeof(resvaddr_t);
|
||||
|
||||
if (out_node->links.le_next)
|
||||
out_node->links.le_next = offset;
|
||||
|
@ -176,7 +176,7 @@ static struct mbuf *makembuf (void *buf, unsigned len)
|
||||
bcopy (buf, mtod (p, caddr_t) + p->m_len, n);
|
||||
|
||||
p->m_len += n;
|
||||
buf += n;
|
||||
buf = (char *)buf + n;
|
||||
len -= n;
|
||||
}
|
||||
return (m);
|
||||
|
@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: istallion.c,v 1.3 1996/06/12 04:26:35 gpalmer Exp $
|
||||
* $Id: istallion.c,v 1.4 1996/06/18 01:22:25 bde Exp $
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -2631,7 +2631,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
|
||||
ptr = 0;
|
||||
val = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % ECP_ATPAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % ECP_ATPAGESIZE);
|
||||
val = (unsigned char) (offset / ECP_ATPAGESIZE);
|
||||
}
|
||||
outb((brdp->iobase + ECP_ATMEMPR), val);
|
||||
@ -2721,7 +2721,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line
|
||||
ptr = 0;
|
||||
val = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % ECP_EIPAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % ECP_EIPAGESIZE);
|
||||
if (offset < ECP_EIPAGESIZE)
|
||||
val = ECP_EIENABLE;
|
||||
else
|
||||
@ -2773,7 +2773,7 @@ static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line
|
||||
ptr = 0;
|
||||
val = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % ECP_MCPAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % ECP_MCPAGESIZE);
|
||||
val = ((unsigned char) (offset / ECP_MCPAGESIZE)) | ECP_MCENABLE;
|
||||
}
|
||||
outb((brdp->iobase + ECP_MCCONFR), val);
|
||||
@ -2854,7 +2854,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
|
||||
__LINE__, brdp->brdnr);
|
||||
ptr = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % ONB_ATPAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % ONB_ATPAGESIZE);
|
||||
}
|
||||
return(ptr);
|
||||
}
|
||||
@ -2945,7 +2945,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
|
||||
ptr = 0;
|
||||
val = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % ONB_EIPAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % ONB_EIPAGESIZE);
|
||||
if (offset < ONB_EIPAGESIZE)
|
||||
val = ONB_EIENABLE;
|
||||
else
|
||||
@ -3014,7 +3014,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
|
||||
ptr = 0;
|
||||
val = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % BBY_PAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % BBY_PAGESIZE);
|
||||
val = (unsigned char) (offset / BBY_PAGESIZE);
|
||||
}
|
||||
outb((brdp->iobase + BBY_ATCONFR), val);
|
||||
@ -3074,7 +3074,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
|
||||
__LINE__, brdp->brdnr);
|
||||
ptr = 0;
|
||||
} else {
|
||||
ptr = brdp->vaddr + (offset % STAL_PAGESIZE);
|
||||
ptr = (char *) brdp->vaddr + (offset % STAL_PAGESIZE);
|
||||
}
|
||||
return(ptr);
|
||||
}
|
||||
@ -3090,7 +3090,7 @@ static void stli_stalreset(stlibrd_t *brdp)
|
||||
printf("stli_stalreset(brdp=%x)\n", (int) brdp);
|
||||
#endif
|
||||
|
||||
vecp = (volatile unsigned long *) (brdp->vaddr + 0x30);
|
||||
vecp = (volatile unsigned long *) ((char *) brdp->vaddr + 0x30);
|
||||
*vecp = 0xffff0000;
|
||||
outb(brdp->iobase, 0);
|
||||
for (i = 0; (i < 1000); i++)
|
||||
|
@ -20,7 +20,7 @@
|
||||
* the original CMU copyright notice.
|
||||
*
|
||||
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
|
||||
* $Id: wt.c,v 1.32 1996/04/08 19:40:57 smpatel Exp $
|
||||
* $Id: wt.c,v 1.33 1996/07/23 21:51:50 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -692,7 +692,7 @@ wtintr (int u)
|
||||
}
|
||||
|
||||
if (t->dmacount < t->dmatotal) { /* continue i/o */
|
||||
t->dmavaddr += t->bsize;
|
||||
t->dmavaddr = (char *)t->dmavaddr + t->bsize;
|
||||
wtdma (t);
|
||||
TRACE (("continue i/o, %d\n", t->dmacount));
|
||||
return;
|
||||
|
@ -22,7 +22,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kern_devconf.c,v 1.14 1996/01/31 18:05:19 gibbs Exp $
|
||||
* $Id: kern_devconf.c,v 1.15 1996/06/12 15:10:27 joerg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -159,7 +159,7 @@ sysctl_hw_devconfig SYSCTL_HANDLER_ARGS
|
||||
* determine the proper length. (dc_datalen includes the
|
||||
* externalized data so it can't be used)
|
||||
*/
|
||||
rv = SYSCTL_OUT(req, &dc, (void *)&dc.dc_data - (void *)&dc);
|
||||
rv = SYSCTL_OUT(req, &dc, (char *)&dc.dc_data - (char *)&dc);
|
||||
if(rv)
|
||||
return rv;
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
|
||||
* $Id: kern_sysctl.c,v 1.63 1996/06/06 17:17:54 phk Exp $
|
||||
* $Id: kern_sysctl.c,v 1.64 1996/06/10 16:23:30 nate Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -568,7 +568,7 @@ sysctl_old_kernel(struct sysctl_req *req, const void *p, int l)
|
||||
if (req->oldptr) {
|
||||
i = min(req->oldlen - req->oldidx, l);
|
||||
if (i > 0)
|
||||
bcopy(p, req->oldptr + req->oldidx, i);
|
||||
bcopy(p, (char *)req->oldptr + req->oldidx, i);
|
||||
}
|
||||
req->oldidx += l;
|
||||
if (req->oldptr && i != l)
|
||||
@ -583,7 +583,7 @@ sysctl_new_kernel(struct sysctl_req *req, void *p, int l)
|
||||
return 0;
|
||||
if (req->newlen - req->newidx < l)
|
||||
return (EINVAL);
|
||||
bcopy(req->newptr + req->newidx, p, l);
|
||||
bcopy((char *)req->newptr + req->newidx, p, l);
|
||||
req->newidx += l;
|
||||
return (0);
|
||||
}
|
||||
@ -662,7 +662,8 @@ sysctl_old_user(struct sysctl_req *req, const void *p, int l)
|
||||
if (req->oldptr) {
|
||||
i = min(req->oldlen - req->oldidx, l);
|
||||
if (i > 0)
|
||||
error = copyout(p, req->oldptr + req->oldidx, i);
|
||||
error = copyout(p, (char *)req->oldptr + req->oldidx,
|
||||
i);
|
||||
}
|
||||
req->oldidx += l;
|
||||
if (error)
|
||||
@ -681,7 +682,7 @@ sysctl_new_user(struct sysctl_req *req, void *p, int l)
|
||||
return 0;
|
||||
if (req->newlen - req->newidx < l)
|
||||
return (EINVAL);
|
||||
error = copyin(req->newptr + req->newidx, p, l);
|
||||
error = copyin((char *)req->newptr + req->newidx, p, l);
|
||||
req->newidx += l;
|
||||
return (error);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: sysv_msg.c,v 1.11 1995/12/15 05:00:27 peter Exp $ */
|
||||
/* $Id: sysv_msg.c,v 1.12 1996/01/05 16:37:56 wollman Exp $ */
|
||||
|
||||
/*
|
||||
* Implementation of SVID messages
|
||||
@ -652,7 +652,7 @@ msgsnd(p, uap, retval)
|
||||
wakeup((caddr_t)msqptr);
|
||||
return(eval);
|
||||
}
|
||||
user_msgp += sizeof(msghdr->msg_type);
|
||||
user_msgp = (char *)user_msgp + sizeof(msghdr->msg_type);
|
||||
|
||||
/*
|
||||
* Validate the message type
|
||||
@ -694,7 +694,7 @@ msgsnd(p, uap, retval)
|
||||
return(eval);
|
||||
}
|
||||
msgsz -= tlen;
|
||||
user_msgp += tlen;
|
||||
user_msgp = (char *)user_msgp + tlen;
|
||||
next = msgmaps[next].next;
|
||||
}
|
||||
if (next != -1)
|
||||
@ -990,7 +990,7 @@ msgrcv(p, uap, retval)
|
||||
wakeup((caddr_t)msqptr);
|
||||
return(eval);
|
||||
}
|
||||
user_msgp += sizeof(msghdr->msg_type);
|
||||
user_msgp = (char *)user_msgp + sizeof(msghdr->msg_type);
|
||||
|
||||
/*
|
||||
* Return the segments to the user
|
||||
@ -1019,7 +1019,7 @@ msgrcv(p, uap, retval)
|
||||
wakeup((caddr_t)msqptr);
|
||||
return(eval);
|
||||
}
|
||||
user_msgp += tlen;
|
||||
user_msgp = (char *)user_msgp + tlen;
|
||||
next = msgmaps[next].next;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: qsort.c,v 1.4 1996/08/28 20:32:19 bde Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -101,16 +101,16 @@ qsort(a, n, es, cmp)
|
||||
loop: SWAPINIT(a, es);
|
||||
swap_cnt = 0;
|
||||
if (n < 7) {
|
||||
for (pm = a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
pm = a + (n / 2) * es;
|
||||
pm = (char *)a + (n / 2) * es;
|
||||
if (n > 7) {
|
||||
pl = a;
|
||||
pn = a + (n - 1) * es;
|
||||
pn = (char *)a + (n - 1) * es;
|
||||
if (n > 40) {
|
||||
d = (n / 8) * es;
|
||||
pl = med3(pl, pl + d, pl + 2 * d, cmp);
|
||||
@ -120,9 +120,9 @@ loop: SWAPINIT(a, es);
|
||||
pm = med3(pl, pm, pn, cmp);
|
||||
}
|
||||
swap(a, pm);
|
||||
pa = pb = a + es;
|
||||
pa = pb = (char *)a + es;
|
||||
|
||||
pc = pd = a + (n - 1) * es;
|
||||
pc = pd = (char *)a + (n - 1) * es;
|
||||
for (;;) {
|
||||
while (pb <= pc && (r = cmp(pb, a)) <= 0) {
|
||||
if (r == 0) {
|
||||
@ -148,14 +148,14 @@ loop: SWAPINIT(a, es);
|
||||
pc -= es;
|
||||
}
|
||||
if (swap_cnt == 0) { /* Switch to insertion sort */
|
||||
for (pm = a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
|
||||
pn = a + n * es;
|
||||
pn = (char *)a + n * es;
|
||||
r = min(pa - (char *)a, pb - pa);
|
||||
vecswap(a, pb - r, r);
|
||||
r = min(pd - pc, pn - pd - es);
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lfs_segment.c 8.5 (Berkeley) 1/4/94
|
||||
* $Id: lfs_segment.c,v 1.16 1995/12/17 21:09:49 phk Exp $
|
||||
* $Id: lfs_segment.c,v 1.17 1996/06/12 05:11:41 gpalmer Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -773,7 +773,7 @@ lfs_initseg(fs)
|
||||
ssp->ss_nfinfo = ssp->ss_ninos = 0;
|
||||
|
||||
/* Set pointer to first FINFO, initialize it. */
|
||||
sp->fip = (struct finfo *)(sp->segsum + sizeof(SEGSUM));
|
||||
sp->fip = (struct finfo *)((char *)sp->segsum + sizeof(SEGSUM));
|
||||
sp->fip->fi_nblocks = 0;
|
||||
sp->start_lbp = &sp->fip->fi_blocks[0];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user