diff options
author | dillon <dillon@FreeBSD.org> | 1999-01-28 01:59:53 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-01-28 01:59:53 +0000 |
commit | 9328688fc8b9743439e9dbe6f6364cb0317e387f (patch) | |
tree | 4f99904371de94ee7846eb8f747ab1e5a1fa463b /sys/i386/ibcs2 | |
parent | c970e06ccf646c8d420b2216f605eefeef3cdc0d (diff) | |
download | FreeBSD-src-9328688fc8b9743439e9dbe6f6364cb0317e387f.zip FreeBSD-src-9328688fc8b9743439e9dbe6f6364cb0317e387f.tar.gz |
Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
Diffstat (limited to 'sys/i386/ibcs2')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_ioctl.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_misc.c | 36 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_msg.c | 12 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_socksys.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_stat.c | 20 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_sysi86.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_xenix.c | 6 | ||||
-rw-r--r-- | sys/i386/ibcs2/imgact_coff.c | 42 |
8 files changed, 61 insertions, 61 deletions
diff --git a/sys/i386/ibcs2/ibcs2_ioctl.c b/sys/i386/ibcs2/ibcs2_ioctl.c index e285071..e0f3824 100644 --- a/sys/i386/ibcs2/ibcs2_ioctl.c +++ b/sys/i386/ibcs2/ibcs2_ioctl.c @@ -508,7 +508,7 @@ ibcs2_ioctl(p, uap) SCARG(&sa, pid) = 0; SCARG(&sa, pgid) = (int)SCARG(uap, data); - if (error = setpgid(p, &sa)) + if ((error = setpgid(p, &sa)) != 0) return error; return 0; } diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index c2b1a55..6cbb575 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -45,7 +45,7 @@ * * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * - * $Id: ibcs2_misc.c,v 1.29 1998/08/17 18:12:52 bde Exp $ + * $Id: ibcs2_misc.c,v 1.30 1998/09/26 00:55:53 des Exp $ */ /* @@ -346,7 +346,7 @@ again: * First we read into the malloc'ed buffer, then * we massage it into user space, one record at a time. */ - if (error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, &cookies)) + if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, &cookies)) != 0) goto out; inp = buf; outp = SCARG(uap, buf); @@ -454,7 +454,7 @@ ibcs2_read(p, uap) u_long *cookies = NULL, *cookiep; int ncookies; - if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) { + if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) { if (error == EINVAL) return read(p, (struct read_args *)uap); else @@ -493,7 +493,7 @@ again: * First we read into the malloc'ed buffer, then * we massage it into user space, one record at a time. */ - if (error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, &cookies)) { + if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, &cookies)) != 0) { DPRINTF(("VOP_READDIR failed: %d\n", error)); goto out; } @@ -556,7 +556,7 @@ again: BSD_DIRENT(inp)->d_fileno; (void)copystr(BSD_DIRENT(inp)->d_name, idb.name, 14, &size); bzero(idb.name + size, 14 - size); - if (error = copyout(&idb, outp, sizeof(struct ibcs2_direct))) + if ((error = copyout(&idb, outp, sizeof(struct ibcs2_direct))) != 0) goto out; /* advance past this real entry */ if (cookiep) { @@ -623,7 +623,7 @@ ibcs2_getgroups(p, uap) iset = stackgap_alloc(&sg, SCARG(uap, gidsetsize) * sizeof(ibcs2_gid_t)); } - if (error = getgroups(p, &sa)) + if ((error = getgroups(p, &sa)) != 0) return error; if (SCARG(uap, gidsetsize) == 0) return 0; @@ -654,9 +654,9 @@ ibcs2_setgroups(p, uap) iset = stackgap_alloc(&sg, SCARG(&sa, gidsetsize) * sizeof(ibcs2_gid_t *)); if (SCARG(&sa, gidsetsize)) { - if (error = copyin((caddr_t)SCARG(uap, gidset), (caddr_t)iset, + if ((error = copyin((caddr_t)SCARG(uap, gidset), (caddr_t)iset, sizeof(ibcs2_gid_t *) * - SCARG(uap, gidsetsize))) + SCARG(uap, gidsetsize))) != 0) return error; } for (i = 0, gp = SCARG(&sa, gidset); i < SCARG(&sa, gidsetsize); i++) @@ -740,7 +740,7 @@ ibcs2_sysconf(p, uap) SCARG(&ga, which) = RLIMIT_NPROC; SCARG(&ga, rlp) = stackgap_alloc(&sg, sizeof(struct rlimit *)); - if (error = getrlimit(p, &ga)) + if ((error = getrlimit(p, &ga)) != 0) return error; p->p_retval[0] = SCARG(&ga, rlp)->rlim_cur; return 0; @@ -760,7 +760,7 @@ ibcs2_sysconf(p, uap) SCARG(&ga, which) = RLIMIT_NOFILE; SCARG(&ga, rlp) = stackgap_alloc(&sg, sizeof(struct rlimit *)); - if (error = getrlimit(p, &ga)) + if ((error = getrlimit(p, &ga)) != 0) return error; p->p_retval[0] = SCARG(&ga, rlp)->rlim_cur; return 0; @@ -798,7 +798,7 @@ ibcs2_sysconf(p, uap) SCARG(&sa, oldlenp) = &len; SCARG(&sa, new) = NULL; SCARG(&sa, newlen) = 0; - if (error = __sysctl(p, &sa)) + if ((error = __sysctl(p, &sa)) != 0) return error; p->p_retval[0] = value; return 0; @@ -878,11 +878,11 @@ ibcs2_stime(p, uap) SCARG(&sa, tv) = stackgap_alloc(&sg, sizeof(*SCARG(&sa, tv))); SCARG(&sa, tzp) = NULL; - if (error = copyin((caddr_t)SCARG(uap, timep), - &(SCARG(&sa, tv)->tv_sec), sizeof(long))) + if ((error = copyin((caddr_t)SCARG(uap, timep), + &(SCARG(&sa, tv)->tv_sec), sizeof(long))) != 0) return error; SCARG(&sa, tv)->tv_usec = 0; - if (error = settimeofday(p, &sa)) + if ((error = settimeofday(p, &sa)) != 0) return EPERM; return 0; } @@ -902,8 +902,8 @@ ibcs2_utime(p, uap) if (SCARG(uap, buf)) { struct ibcs2_utimbuf ubuf; - if (error = copyin((caddr_t)SCARG(uap, buf), (caddr_t)&ubuf, - sizeof(ubuf))) + if ((error = copyin((caddr_t)SCARG(uap, buf), (caddr_t)&ubuf, + sizeof(ubuf))) != 0) return error; SCARG(&sa, tptr) = stackgap_alloc(&sg, 2 * sizeof(struct timeval *)); @@ -929,7 +929,7 @@ ibcs2_nice(p, uap) SCARG(&sa, which) = PRIO_PROCESS; SCARG(&sa, who) = 0; SCARG(&sa, prio) = p->p_nice + SCARG(uap, incr); - if (error = setpriority(p, &sa)) + if ((error = setpriority(p, &sa)) != 0) return EPERM; p->p_retval[0] = p->p_nice; return 0; @@ -993,7 +993,7 @@ ibcs2_plock(p, uap) #define IBCS2_DATALOCK 4 - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return EPERM; switch(SCARG(uap, cmd)) { case IBCS2_UNLOCK: diff --git a/sys/i386/ibcs2/ibcs2_msg.c b/sys/i386/ibcs2/ibcs2_msg.c index ba2af2d..8b7429b 100644 --- a/sys/i386/ibcs2/ibcs2_msg.c +++ b/sys/i386/ibcs2/ibcs2_msg.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_msg.c,v 1.4 1997/07/20 09:39:44 bde Exp $ + * $Id: ibcs2_msg.c,v 1.5 1997/11/06 19:28:34 phk Exp $ */ /* @@ -93,8 +93,8 @@ ibcs2_poll(p, uap) tmp_select.tv = timeout; for (i = 0; i < uap->nfds; i++) { - if (error = copyin(uap->fds + i*sizeof(struct ibcs2_poll), - &conv, sizeof(conv))) + if ((error = copyin(uap->fds + i*sizeof(struct ibcs2_poll), + &conv, sizeof(conv))) != 0) return error; conv.revents = 0; if (conv.fd < 0 || conv.fd > FD_SETSIZE) @@ -107,7 +107,7 @@ ibcs2_poll(p, uap) FD_SET(conv.fd, writefds); FD_SET(conv.fd, exceptfds); } - if (error = select(p, &tmp_select)) + if ((error = select(p, &tmp_select)) != 0) return error; if (p->p_retval[0] == 0) return 0; @@ -129,9 +129,9 @@ ibcs2_poll(p, uap) if (conv.revents) ++p->p_retval[0]; } - if (error = copyout(&conv, + if ((error = copyout(&conv, uap->fds + i*sizeof(struct ibcs2_poll), - sizeof(conv))) + sizeof(conv))) != 0) return error; } return 0; diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c index c7f109a..0f5ee4d 100644 --- a/sys/i386/ibcs2/ibcs2_socksys.c +++ b/sys/i386/ibcs2/ibcs2_socksys.c @@ -68,7 +68,7 @@ ibcs2_socksys(p, uap) * The others are (and should be) only legal on sockets. */ - if (error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs))) + if ((error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs))) != 0) return error; DPRINTF(("ibcs2_socksys: %08x %08x %08x %08x %08x %08x %08x\n", realargs[0], realargs[1], realargs[2], realargs[3], diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c index d3bf6ae..36990c3 100644 --- a/sys/i386/ibcs2/ibcs2_stat.c +++ b/sys/i386/ibcs2/ibcs2_stat.c @@ -104,12 +104,12 @@ ibcs2_statfs(p, uap) CHECKALTEXIST(p, &sg, SCARG(uap, path)); NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return (error); mp = nd.ni_vp->v_mount; sp = &mp->mnt_stat; vrele(nd.ni_vp); - if (error = VFS_STATFS(mp, sp, p)) + if ((error = VFS_STATFS(mp, sp, p)) != 0) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len)); @@ -125,11 +125,11 @@ ibcs2_fstatfs(p, uap) register struct statfs *sp; int error; - if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) + if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); mp = ((struct vnode *)fp->f_data)->v_mount; sp = &mp->mnt_stat; - if (error = VFS_STATFS(mp, sp, p)) + if ((error = VFS_STATFS(mp, sp, p)) != 0) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len)); @@ -150,10 +150,10 @@ ibcs2_stat(p, uap) SCARG(&cup, path) = SCARG(uap, path); SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); - if (error = stat(p, &cup)) + if ((error = stat(p, &cup)) != 0) return error; - if (error = copyin(SCARG(&cup, ub), &st, sizeof(st))) + if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0) return error; bsd_stat2ibcs_stat(&st, &ibcs2_st); return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st), @@ -175,10 +175,10 @@ ibcs2_lstat(p, uap) SCARG(&cup, path) = SCARG(uap, path); SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); - if (error = lstat(p, &cup)) + if ((error = lstat(p, &cup)) != 0) return error; - if (error = copyin(SCARG(&cup, ub), &st, sizeof(st))) + if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0) return error; bsd_stat2ibcs_stat(&st, &ibcs2_st); return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st), @@ -199,10 +199,10 @@ ibcs2_fstat(p, uap) SCARG(&cup, fd) = SCARG(uap, fd); SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(st)); - if (error = fstat(p, &cup)) + if ((error = fstat(p, &cup)) != 0) return error; - if (error = copyin(SCARG(&cup, sb), &st, sizeof(st))) + if ((error = copyin(SCARG(&cup, sb), &st, sizeof(st))) != 0) return error; bsd_stat2ibcs_stat(&st, &ibcs2_st); return copyout((caddr_t)&ibcs2_st, (caddr_t)SCARG(uap, st), diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c index ba9c12f..210c268 100644 --- a/sys/i386/ibcs2/ibcs2_sysi86.c +++ b/sys/i386/ibcs2/ibcs2_sysi86.c @@ -60,7 +60,7 @@ ibcs2_sysi86(struct proc *p, struct ibcs2_sysi86_args *args) if (hw_float) val = IBCS2_FP_387; /* FPU hardware */ else val = IBCS2_FP_SW; /* FPU emulator */ - if (error = copyout(&val, SCARG(args, arg), sizeof(val))) + if ((error = copyout(&val, SCARG(args, arg), sizeof(val))) != 0) return error; return 0; } diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c index 8ab5556..89506bf 100644 --- a/sys/i386/ibcs2/ibcs2_xenix.c +++ b/sys/i386/ibcs2/ibcs2_xenix.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_xenix.c,v 1.16 1998/08/16 01:21:49 bde Exp $ + * $Id: ibcs2_xenix.c,v 1.17 1998/12/04 22:54:46 archie Exp $ */ #include <sys/param.h> @@ -80,7 +80,7 @@ xenix_rdchk(p, uap) SCARG(&sa, fd) = SCARG(uap, fd); SCARG(&sa, com) = FIONREAD; SCARG(&sa, data) = stackgap_alloc(&sg, sizeof(int)); - if (error = ioctl(p, &sa)) + if ((error = ioctl(p, &sa)) != 0) return error; p->p_retval[0] = (*((int*)SCARG(&sa, data))) ? 1 : 0; return 0; @@ -202,7 +202,7 @@ xenix_eaccess(struct proc *p, struct xenix_eaccess_args *uap) NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return error; vp = nd.ni_vp; diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c index 3632b74..da41412 100644 --- a/sys/i386/ibcs2/imgact_coff.c +++ b/sys/i386/ibcs2/imgact_coff.c @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: imgact_coff.c,v 1.33 1998/10/16 03:55:00 peter Exp $ + * $Id: imgact_coff.c,v 1.34 1999/01/17 20:39:08 peter Exp $ */ #include <sys/param.h> @@ -92,14 +92,14 @@ load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, "VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, vp, 0x%x)\n", __FILE__, __LINE__, map_addr, map_len, prot, map_offset)); - if (error = vm_mmap(&vmspace->vm_map, + if ((error = vm_mmap(&vmspace->vm_map, &map_addr, map_len, prot, VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, (caddr_t) vp, - map_offset)) + map_offset)) != 0) return error; if (memsz == filsz) { @@ -128,14 +128,14 @@ load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, return error; } - if (error = vm_mmap(kernel_map, + if ((error = vm_mmap(kernel_map, (vm_offset_t *) &data_buf, PAGE_SIZE, VM_PROT_READ, VM_PROT_READ, 0, (caddr_t) vp, - trunc_page(offset + filsz))) + trunc_page(offset + filsz))) != 0) return error; error = copyout(data_buf, (caddr_t) map_addr, copy_len); @@ -182,7 +182,7 @@ coff_load_file(struct proc *p, char *name) goto fail; } - if (error = VOP_GETATTR(vp, &attr, p->p_ucred, p)) + if ((error = VOP_GETATTR(vp, &attr, p->p_ucred, p)) != 0) goto fail; if ((vp->v_mount->mnt_flag & MNT_NOEXEC) @@ -195,10 +195,10 @@ coff_load_file(struct proc *p, char *name) goto fail; } - if (error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p)) + if ((error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p)) != 0) goto fail; - if (error = VOP_OPEN(vp, FREAD, p->p_ucred, p)) + if ((error = VOP_OPEN(vp, FREAD, p->p_ucred, p)) != 0) goto fail; /* @@ -207,14 +207,14 @@ coff_load_file(struct proc *p, char *name) */ VOP_UNLOCK(vp, 0, p); - if (error = vm_mmap(kernel_map, + if ((error = vm_mmap(kernel_map, (vm_offset_t *) &ptr, PAGE_SIZE, VM_PROT_READ, VM_PROT_READ, 0, (caddr_t) vp, - 0)) + 0)) != 0) goto fail; fhdr = (struct filehdr *)ptr; @@ -256,16 +256,16 @@ coff_load_file(struct proc *p, char *name) } } - if (error = load_coff_section(vmspace, vp, text_offset, + if ((error = load_coff_section(vmspace, vp, text_offset, (caddr_t)(void *)(uintptr_t)text_address, text_size, text_size, - VM_PROT_READ | VM_PROT_EXECUTE)) { + VM_PROT_READ | VM_PROT_EXECUTE)) != 0) { goto dealloc_and_fail; } - if (error = load_coff_section(vmspace, vp, data_offset, + if ((error = load_coff_section(vmspace, vp, data_offset, (caddr_t)(void *)(uintptr_t)data_address, data_size + bss_size, data_size, - VM_PROT_ALL)) { + VM_PROT_ALL)) != 0) { goto dealloc_and_fail; } @@ -325,7 +325,7 @@ exec_coff_imgact(imgp) ((const char*)(imgp->image_header) + sizeof(struct filehdr) + sizeof(struct aouthdr)); - if (error = exec_extract_strings(imgp)) { + if ((error = exec_extract_strings(imgp)) != 0) { DPRINTF(("%s(%d): return %d\n", __FILE__, __LINE__, error)); return error; } @@ -364,14 +364,14 @@ exec_coff_imgact(imgp) int len = round_page(scns[i].s_size + PAGE_SIZE); int j; - if (error = vm_mmap(kernel_map, + if ((error = vm_mmap(kernel_map, (vm_offset_t *) &buf, len, VM_PROT_READ, VM_PROT_READ, 0, (caddr_t) imgp->vp, - foff)) { + foff)) != 0) { return ENOEXEC; } if(scns[i].s_size) { @@ -416,11 +416,11 @@ exec_coff_imgact(imgp) "imgp->vp, %08lx, %08lx, 0x%x, 0x%x, 0x%x)\n", __FILE__, __LINE__, text_offset, text_address, text_size, text_size, VM_PROT_READ | VM_PROT_EXECUTE)); - if (error = load_coff_section(vmspace, imgp->vp, + if ((error = load_coff_section(vmspace, imgp->vp, text_offset, (caddr_t)(void *)(uintptr_t)text_address, text_size, text_size, - VM_PROT_READ | VM_PROT_EXECUTE)) { + VM_PROT_READ | VM_PROT_EXECUTE)) != 0) { DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error)); return error; } @@ -433,11 +433,11 @@ exec_coff_imgact(imgp) "imgp->vp, 0x%08lx, 0x%08lx, 0x%x, 0x%x, 0x%x)\n", __FILE__, __LINE__, data_offset, data_address, data_size + bss_size, data_size, VM_PROT_ALL)); - if (error = load_coff_section(vmspace, imgp->vp, + if ((error = load_coff_section(vmspace, imgp->vp, data_offset, (caddr_t)(void *)(uintptr_t)data_address, data_size + bss_size, data_size, - VM_PROT_ALL)) { + VM_PROT_ALL)) != 0) { DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error)); return error; |