libc: Remove a single use of vm_offset_t type.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 11 Sep 2019 11:36:48 +0000 (14:36 +0300)
committerzrj <rimvydas.jasinskas@gmail.com>
Wed, 11 Sep 2019 17:50:01 +0000 (20:50 +0300)
 Use (uintptr_t) for casting (void *) like it is already used elsewhere
 for consistency.

 v2: use (uintptr_t) instead of (u_long) as suggested by swildner

lib/libc/sysvipc/shm.c

index a90b008..2adf107 100644 (file)
@@ -33,6 +33,7 @@
 #include <sys/queue.h>
 #include <sys/mman.h>
 #include <sys/shm.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -244,8 +245,8 @@ sysvipc_shmat(int shmid, const void *shmaddr, int shmflg)
        flags = MAP_SHARED;
        if (shmaddr) {
                if (shmflg & SHM_RND) {
-                       addr = (void *)((vm_offset_t)shmaddr & ~(SHMLBA-1));
-               } else if (((vm_offset_t)shmaddr & (SHMLBA-1)) == 0) {
+                       addr = (void *)((uintptr_t)shmaddr & ~(SHMLBA-1));
+               } else if (((uintptr_t)shmaddr & (SHMLBA-1)) == 0) {
                        addr = __DECONST(void *, shmaddr);
                } else {
                        errno = EINVAL;