Replace uintptr_t type cast with uintptrsz in afs_vcache.c
authorAntoine Verheijen <antoine@ualberta.ca>
Tue, 17 May 2011 15:40:15 +0000 (09:40 -0600)
committerDerrick Brashear <shadow@dementia.org>
Sun, 22 May 2011 14:06:51 +0000 (07:06 -0700)
A recent change (commit 80fe111f0044aa7a67215ad92210dc72cb7eb2c0)
to afs_vcache.c contains a call to afs_warn() whose second parameter
contains a "(uintptr_t)" type cast as part of a double type cast.
This presents an issue on some systems, such as OpenBSD, where this
object type is defined in a header that is not presently included.
This change modifies that type cast to instead use the AFS-internal
"(uintptrsz)" type which should provide the same effect.

Note that an earlier version of this patch ateempted to remove the
"offending" type cast as redundant but it was pointed out that some
systems require this kind of cascading type cast when casting pointers
to integers to deal with possible size issues.

Change-Id: Iea81b2be1050a1c929978a99c518d86c6d1f2118
Reviewed-on: http://gerrit.openafs.org/4671
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_vcache.c

index b6d2915..aac212b 100644 (file)
@@ -846,7 +846,7 @@ afs_FlushAllVCaches(void)
 
            nvc = tvc->hnext;
            if (afs_FlushVCache(tvc, &slept)) {
-               afs_warn("Failed to flush vcache 0x%lx\n", (unsigned long)(uintptr_t)tvc);
+               afs_warn("Failed to flush vcache 0x%lx\n", (unsigned long)(uintptrsz)tvc);
            }
            if (slept) {
                goto retry;