From: Jeffrey Altman Date: Thu, 20 Jan 2011 06:20:05 +0000 (-0500) Subject: vol: remove [UN]LOCKFILE data loss warnings on Windows X-Git-Tag: upstream/1.6.0.pre2^2~60 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=cf01d49487f4bb6b9fc958b3848e1dc3ac6e18fd;p=packages%2Fo%2Fopenafs.git vol: remove [UN]LOCKFILE data loss warnings on Windows Cast to DWORD since the results of the mask and shift are guaranteed to be 32-bit. This avoids sixteen warnings. Reviewed-on: http://gerrit.openafs.org/3695 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit fe9285f77a680b6e6d0995166f3c384aac676a8c) Change-Id: Ic9a17074ce76d1676bb7d83e2e17d7c50e1c45a0 Reviewed-on: http://gerrit.openafs.org/3840 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/vol/ihandle.h b/src/vol/ihandle.h index 49721a490..6fd6bc5ce 100644 --- a/src/vol/ihandle.h +++ b/src/vol/ihandle.h @@ -378,8 +378,8 @@ extern ssize_t ih_pwrite(int fd, const void * buf, size_t count, afs_foff_t offs #define OS_PWRITE(FD, B, S, O) ih_pwrite(FD, B, S, O) #endif /* !HAVE_PIO */ #ifdef AFS_NT40_ENV -#define OS_LOCKFILE(FD, O) (!LockFile(FD, (O & 0xFFFFFFFF), (O >> 32), 2, 0)) -#define OS_UNLOCKFILE(FD, O) (!UnlockFile(FD, (O & 0xFFFFFFFF), (O >> 32), 2, 0)) +#define OS_LOCKFILE(FD, O) (!LockFile(FD, (DWORD)((O) & 0xFFFFFFFF), (DWORD)((O) >> 32), 2, 0)) +#define OS_UNLOCKFILE(FD, O) (!UnlockFile(FD, (DWORD)((O) & 0xFFFFFFFF), (DWORD)((O) >> 32), 2, 0)) #define OS_ERROR(X) nterr_nt2unix(GetLastError(), X) #define OS_UNLINK(X) nt_unlink(X) #define OS_DIRSEP "\\"