summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-15 02:32:35 +0000
committerbde <bde@FreeBSD.org>1998-07-15 02:32:35 +0000
commit863d5c8b6850a65e8b4e00a7b23bbd29bd466602 (patch)
tree503589837ac05f783d5305211b0f41aed97e2041 /sys/kern
parentb99f2f9d598baa39c296f1cf2d910a1f7e138bb1 (diff)
downloadFreeBSD-src-863d5c8b6850a65e8b4e00a7b23bbd29bd466602.zip
FreeBSD-src-863d5c8b6850a65e8b4e00a7b23bbd29bd466602.tar.gz
Cast pointers to uintptr_t/intptr_t instead of to u_long/long,
respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_intr.c10
-rw-r--r--sys/kern/kern_sig.c4
-rw-r--r--sys/kern/kern_subr.c8
-rw-r--r--sys/kern/kern_synch.c4
-rw-r--r--sys/kern/link_aout.c8
-rw-r--r--sys/kern/subr_clist.c26
-rw-r--r--sys/kern/subr_prf.c4
-rw-r--r--sys/kern/tty_subr.c26
-rw-r--r--sys/kern/uipc_usrreq.c4
-rw-r--r--sys/kern/vfs_extattr.c4
-rw-r--r--sys/kern/vfs_syscalls.c4
11 files changed, 51 insertions, 51 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 4d2ffc7..f55a0da 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -23,7 +23,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: kern_intr.c,v 1.16 1998/06/11 07:23:59 dfr Exp $
+ * $Id: kern_intr.c,v 1.17 1998/06/18 15:32:08 bde Exp $
*
*/
@@ -195,7 +195,7 @@ add_intrdesc(intrec *idesc)
idesc->maskptr, idesc->flags) != 0)
return (-1);
- update_intrname(irq, (long)idesc->devdata);
+ update_intrname(irq, (intptr_t)idesc->devdata);
/* keep reference */
intreclist_head[irq] = idesc;
} else {
@@ -324,7 +324,7 @@ intr_disconnect(intrec *idesc)
head->argument,
head->maskptr, head->flags);
if (errcode == 0)
- update_intrname(irq, (long)head->devdata);
+ update_intrname(irq, (intptr_t)head->devdata);
}
}
splx(oldspl);
@@ -416,8 +416,8 @@ register_intr(int intr, int device_id, u_int flags,
intrec *idesc;
flags |= INTR_EXCL;
- idesc = intr_create((void *)(long)device_id, intr, handler,
- (void*)(long)unit, maskptr, flags);
+ idesc = intr_create((void *)(intptr_t)device_id, intr, handler,
+ (void*)(intptr_t)unit, maskptr, flags);
return (intr_connect(idesc));
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 147717e..403b45e 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sig.c 8.7 (Berkeley) 4/18/94
- * $Id: kern_sig.c,v 1.42 1998/06/28 08:37:45 dg Exp $
+ * $Id: kern_sig.c,v 1.43 1998/07/08 06:38:39 sef Exp $
*/
#include "opt_compat.h"
@@ -1035,7 +1035,7 @@ issignal(p)
* Return the signal's number, or fall through
* to clear it from the pending mask.
*/
- switch ((int)(long)p->p_sigacts->ps_sigact[signum]) {
+ switch ((int)(intptr_t)p->p_sigacts->ps_sigact[signum]) {
case (int)SIG_DFL:
/*
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index a225192..3ab216a 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_subr.c,v 1.19 1998/02/06 12:13:25 eivind Exp $
+ * $Id: kern_subr.c,v 1.20 1998/06/07 17:11:36 dfr Exp $
*/
#include <sys/param.h>
@@ -143,9 +143,9 @@ uiomoveco(cp, n, uio, obj)
case UIO_USERISPACE:
if (uio->uio_rw == UIO_READ) {
if (vfs_ioopt && ((cnt & PAGE_MASK) == 0) &&
- ((((long) iov->iov_base) & PAGE_MASK) == 0) &&
+ ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) &&
((uio->uio_offset & PAGE_MASK) == 0) &&
- ((((long) cp) & PAGE_MASK) == 0)) {
+ ((((intptr_t) cp) & PAGE_MASK) == 0)) {
error = vm_uiomove(&curproc->p_vmspace->vm_map, obj,
uio->uio_offset, cnt,
(vm_offset_t) iov->iov_base, NULL);
@@ -208,7 +208,7 @@ uioread(n, uio, obj, nread)
cnt = n;
if ((uio->uio_segflg == UIO_USERSPACE) &&
- ((((long) iov->iov_base) & PAGE_MASK) == 0) &&
+ ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0) &&
((uio->uio_offset & PAGE_MASK) == 0) ) {
if (cnt < PAGE_SIZE)
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 6fa55d4..749595a 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
- * $Id: kern_synch.c,v 1.59 1998/06/30 21:25:54 phk Exp $
+ * $Id: kern_synch.c,v 1.60 1998/07/11 13:06:41 bde Exp $
*/
#include "opt_ktrace.h"
@@ -332,7 +332,7 @@ updatepri(p)
*/
#define TABLESIZE 128
static TAILQ_HEAD(slpquehead, proc) slpque[TABLESIZE];
-#define LOOKUP(x) (((long)(x) >> 8) & (TABLESIZE - 1))
+#define LOOKUP(x) (((intptr_t)(x) >> 8) & (TABLESIZE - 1))
/*
* During autoconfiguration or after a panic, a sleep will simply
diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c
index 3bbd072..4126ae1 100644
--- a/sys/kern/link_aout.c
+++ b/sys/kern/link_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_aout.c,v 1.6 1998/06/07 17:11:36 dfr Exp $
+ * $Id: link_aout.c,v 1.7 1998/07/07 04:31:27 bde Exp $
*/
#include <sys/param.h>
@@ -325,7 +325,7 @@ relocate_file(linker_file_t lf)
printf("link_aout: bad symbol name %s\n", sym);
relocation = 0;
} else
- relocation = (long)
+ relocation = (intptr_t)
linker_file_lookup_symbol(lf, sym + 1,
np->nz_type != (N_SETV+N_EXT));
if (!relocation) {
@@ -341,7 +341,7 @@ relocate_file(linker_file_t lf)
}
if (r->r_pcrel)
- relocation -= (long) af->address;
+ relocation -= (intptr_t) af->address;
if (r->r_copy) {
printf("link_aout: can't cope with copy relocations\n");
@@ -351,7 +351,7 @@ relocate_file(linker_file_t lf)
write_relocation(r, addr, relocation);
} else {
write_relocation(r, addr,
- (long)(read_relocation(r, addr) + af->address));
+ (intptr_t)(read_relocation(r, addr) + af->address));
}
}
diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c
index d990a12..593d00c 100644
--- a/sys/kern/subr_clist.c
+++ b/sys/kern/subr_clist.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tty_subr.c,v 1.28 1997/10/12 20:24:09 phk Exp $
+ * $Id: tty_subr.c,v 1.29 1998/04/15 17:46:27 bde Exp $
*/
/*
@@ -223,7 +223,7 @@ getc(clistp)
/* If there are characters in the list, get one */
if (clistp->c_cc) {
- cblockp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
chr = (u_char)*clistp->c_cf;
/*
@@ -280,7 +280,7 @@ q_to_b(clistp, dest, amount)
s = spltty();
while (clistp && amount && (clistp->c_cc > 0)) {
- cblockp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
cblockn = cblockp + 1; /* pointer arithmetic! */
numc = min(amount, (char *)cblockn - clistp->c_cf);
numc = min(numc, clistp->c_cc);
@@ -327,7 +327,7 @@ ndflush(clistp, amount)
s = spltty();
while (amount && (clistp->c_cc > 0)) {
- cblockp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
cblockn = cblockp + 1; /* pointer arithmetic! */
numc = min(amount, (char *)cblockn - clistp->c_cf);
numc = min(numc, clistp->c_cc);
@@ -380,8 +380,8 @@ putc(chr, clistp)
clistp->c_cf = clistp->c_cl = cblockp->c_info;
clistp->c_cc = 0;
} else {
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
- if (((long)clistp->c_cl & CROUND) == 0) {
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
+ if (((intptr_t)clistp->c_cl & CROUND) == 0) {
struct cblock *prev = (cblockp - 1);
if (clistp->c_cbcount >= clistp->c_cbreserved) {
@@ -459,14 +459,14 @@ b_to_q(src, amount, clistp)
clistp->c_cf = clistp->c_cl = cblockp->c_info;
clistp->c_cc = 0;
} else {
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
}
while (amount) {
/*
* Get another cblock if needed.
*/
- if (((long)clistp->c_cl & CROUND) == 0) {
+ if (((intptr_t)clistp->c_cl & CROUND) == 0) {
struct cblock *prev = cblockp - 1;
if (clistp->c_cbcount >= clistp->c_cbreserved) {
@@ -568,9 +568,9 @@ nextc(clistp, cp, dst)
* If the next character is beyond the end of this
* cblock, advance to the next cblock.
*/
- if (((long)cp & CROUND) == 0)
+ if (((intptr_t)cp & CROUND) == 0)
cp = ((struct cblock *)cp - 1)->c_next->c_info;
- cblockp = (struct cblock *)((long)cp & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)cp & ~CROUND);
/*
* Get the character. Set the quote flag if this character
@@ -604,7 +604,7 @@ unputc(clistp)
chr = (u_char)*clistp->c_cl;
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
/*
* Set quote flag if this character was quoted.
@@ -618,7 +618,7 @@ unputc(clistp)
* one.
*/
if (clistp->c_cc && (clistp->c_cl <= (char *)cblockp->c_info)) {
- cbp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cbp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
while (cbp->c_next != cblockp)
cbp = cbp->c_next;
@@ -640,7 +640,7 @@ unputc(clistp)
* free the last cblock.
*/
if ((clistp->c_cc == 0) && clistp->c_cl) {
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
cblock_free(cblockp);
if (--clistp->c_cbcount >= clistp->c_cbreserved)
++cslushcount;
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 9474a66..b2715e5 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
- * $Id: subr_prf.c,v 1.46 1998/05/28 09:30:20 phk Exp $
+ * $Id: subr_prf.c,v 1.47 1998/07/08 10:41:32 bde Exp $
*/
#include <sys/param.h>
@@ -495,7 +495,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
base = 8;
goto nosign;
case 'p':
- ul = (u_long)va_arg(ap, void *);
+ ul = (uintptr_t)va_arg(ap, void *);
base = 16;
sharpflag = 1;
goto nosign;
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c
index d990a12..593d00c 100644
--- a/sys/kern/tty_subr.c
+++ b/sys/kern/tty_subr.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tty_subr.c,v 1.28 1997/10/12 20:24:09 phk Exp $
+ * $Id: tty_subr.c,v 1.29 1998/04/15 17:46:27 bde Exp $
*/
/*
@@ -223,7 +223,7 @@ getc(clistp)
/* If there are characters in the list, get one */
if (clistp->c_cc) {
- cblockp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
chr = (u_char)*clistp->c_cf;
/*
@@ -280,7 +280,7 @@ q_to_b(clistp, dest, amount)
s = spltty();
while (clistp && amount && (clistp->c_cc > 0)) {
- cblockp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
cblockn = cblockp + 1; /* pointer arithmetic! */
numc = min(amount, (char *)cblockn - clistp->c_cf);
numc = min(numc, clistp->c_cc);
@@ -327,7 +327,7 @@ ndflush(clistp, amount)
s = spltty();
while (amount && (clistp->c_cc > 0)) {
- cblockp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
cblockn = cblockp + 1; /* pointer arithmetic! */
numc = min(amount, (char *)cblockn - clistp->c_cf);
numc = min(numc, clistp->c_cc);
@@ -380,8 +380,8 @@ putc(chr, clistp)
clistp->c_cf = clistp->c_cl = cblockp->c_info;
clistp->c_cc = 0;
} else {
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
- if (((long)clistp->c_cl & CROUND) == 0) {
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
+ if (((intptr_t)clistp->c_cl & CROUND) == 0) {
struct cblock *prev = (cblockp - 1);
if (clistp->c_cbcount >= clistp->c_cbreserved) {
@@ -459,14 +459,14 @@ b_to_q(src, amount, clistp)
clistp->c_cf = clistp->c_cl = cblockp->c_info;
clistp->c_cc = 0;
} else {
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
}
while (amount) {
/*
* Get another cblock if needed.
*/
- if (((long)clistp->c_cl & CROUND) == 0) {
+ if (((intptr_t)clistp->c_cl & CROUND) == 0) {
struct cblock *prev = cblockp - 1;
if (clistp->c_cbcount >= clistp->c_cbreserved) {
@@ -568,9 +568,9 @@ nextc(clistp, cp, dst)
* If the next character is beyond the end of this
* cblock, advance to the next cblock.
*/
- if (((long)cp & CROUND) == 0)
+ if (((intptr_t)cp & CROUND) == 0)
cp = ((struct cblock *)cp - 1)->c_next->c_info;
- cblockp = (struct cblock *)((long)cp & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)cp & ~CROUND);
/*
* Get the character. Set the quote flag if this character
@@ -604,7 +604,7 @@ unputc(clistp)
chr = (u_char)*clistp->c_cl;
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
/*
* Set quote flag if this character was quoted.
@@ -618,7 +618,7 @@ unputc(clistp)
* one.
*/
if (clistp->c_cc && (clistp->c_cl <= (char *)cblockp->c_info)) {
- cbp = (struct cblock *)((long)clistp->c_cf & ~CROUND);
+ cbp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND);
while (cbp->c_next != cblockp)
cbp = cbp->c_next;
@@ -640,7 +640,7 @@ unputc(clistp)
* free the last cblock.
*/
if ((clistp->c_cc == 0) && clistp->c_cl) {
- cblockp = (struct cblock *)((long)clistp->c_cl & ~CROUND);
+ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND);
cblock_free(cblockp);
if (--clistp->c_cbcount >= clistp->c_cbreserved)
++cslushcount;
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 3921513..0799791 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94
- * $Id: uipc_usrreq.c,v 1.34 1998/05/07 04:58:21 msmith Exp $
+ * $Id: uipc_usrreq.c,v 1.35 1998/05/15 20:11:31 wollman Exp $
*/
#include <sys/param.h>
@@ -715,7 +715,7 @@ unp_pcblist SYSCTL_HANDLER_ARGS
struct xunpgen xug;
struct unp_head *head;
- head = ((long)arg1 == SOCK_DGRAM ? &unp_dhead : &unp_shead);
+ head = ((intptr_t)arg1 == SOCK_DGRAM ? &unp_dhead : &unp_shead);
/*
* The process of preparing the PCB list is too time-consuming and
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 4d7dff3..805afb9 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.103 1998/06/08 18:18:28 dyson Exp $
+ * $Id: vfs_syscalls.c,v 1.104 1998/07/03 03:47:24 dg Exp $
*/
/* For 4.3 integer FS ID compatibility */
@@ -213,7 +213,7 @@ mount(p, uap)
* get an integer for the filesystem type instead of a string, we
* check to see if it matches one of the historic filesystem types.
*/
- fstypenum = (u_long)SCARG(uap, type);
+ fstypenum = (uintptr_t)SCARG(uap, type);
if (fstypenum < maxvfsconf) {
for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
if (vfsp->vfc_typenum == fstypenum)
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 4d7dff3..805afb9 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.103 1998/06/08 18:18:28 dyson Exp $
+ * $Id: vfs_syscalls.c,v 1.104 1998/07/03 03:47:24 dg Exp $
*/
/* For 4.3 integer FS ID compatibility */
@@ -213,7 +213,7 @@ mount(p, uap)
* get an integer for the filesystem type instead of a string, we
* check to see if it matches one of the historic filesystem types.
*/
- fstypenum = (u_long)SCARG(uap, type);
+ fstypenum = (uintptr_t)SCARG(uap, type);
if (fstypenum < maxvfsconf) {
for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
if (vfsp->vfc_typenum == fstypenum)
OpenPOWER on IntegriCloud