Commit
830cb48c enabled new warnings when building UKERNEL, which
causes builds with --enable-checking to fail. These are 64-bit
specific warnings from int to pointer conversions and one printf
warning.
Changes:
- cast printf argument to (int) in afs_usrops.c
- use (iparmtype)(uintptrsz) to convert 32-bit integers to
pointers
- move the definition of uintptrsz to src/afs/afs.h so its
available to other source files, and remove the original definition
in afs_syscall.c
Change-Id: Id0a5fd762cf10a741f89e3a2ed0a85556137df49
Reviewed-on: http://gerrit.openafs.org/1748
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
printf("\tinode=%d, name='%s'\n", currp->d_ino,
currp->d_name);
#else
- printf("\tinode=%d, reclen=%d, name='%s'\n", currp->d_ino,
+ printf("\tinode=%d, reclen=%d, name='%s'\n", (int)currp->d_ino,
currp->d_reclen, currp->d_name);
#endif
}
#endif
#endif
+#if SIZEOF_VOID_P == SIZEOF_UNSIGNED_INT
+# define uintptrsz unsigned int
+#elif SIZEOF_VOID_P == SIZEOF_UNSIGNED_LONG
+# define uintptrsz unsigned long
+#elif SIZEOF_VOID_P == SIZEOF_UNSIGNED_LONG_LONG
+# define uintptrsz unsigned long long
+#else
+# error "Unable to determine casting for pointers"
+#endif
+
struct afs_ioctl {
uparmtype in; /* input buffer */
uparmtype out; /* output buffer */
while (1) {
if (alock->count == 0) {
/* lock not held, we win */
- alock->proc = afs_int_to_pointer(MyPidxx2Pid(MyPidxx));
+ alock->proc = afs_int_to_pointer((iparmtype)(uintptrsz)MyPidxx2Pid(MyPidxx));
alock->count = 1;
return;
- } else if (alock->proc == afs_int_to_pointer(MyPidxx2Pid(MyPidxx))) {
+ } else if (alock->proc == afs_int_to_pointer((iparmtype)(uintptrsz)MyPidxx2Pid(MyPidxx))) {
/* lock is held, but by us, so we win anyway */
alock->count++;
return;
{
AFS_STATCNT(afs_CheckBozonLockBlocking);
if (alock->count || (alock->flags & AFS_BOZONWAITING))
- if (alock->proc != afs_int_to_pointer(MyPidxx2Pid(MyPidxx)))
+ if (alock->proc != afs_int_to_pointer((iparmtype)(uintptrsz)MyPidxx2Pid(MyPidxx)))
return 1;
return 0;
}
#if defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV)) || defined(NEED_IOCTL32)
-#if SIZEOF_VOID_P == SIZEOF_UNSIGNED_INT
-# define uintptrsz unsigned int
-#elif SIZEOF_VOID_P == SIZEOF_UNSIGNED_LONG
-# define uintptrsz unsigned long
-#elif SIZEOF_VOID_P == SIZEOF_UNSIGNED_LONG_LONG
-# define uintptrsz unsigned long long
-#else
-# error "Unable to determine casting for pointers"
-#endif
static void
iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
{