From 1b73452ba85993d990665d15031f2e1872929f1b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 19 Dec 2005 15:51:28 +0000 Subject: [PATCH] windows-64-bit-type-safety-20051105 SIZE_MAX should be UINT_MAX if not defined ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== 64-bit type safety changes required for successful compilation on Windows 64-bit systems with the VS 2005 compiler --- src/WINNT/afsd/cm_callback.c | 2 +- src/lwp/iomgr.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index ca26be418..23bcd26f3 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -1399,7 +1399,7 @@ int SRXAFSCB_GetCacheConfig(struct rx_call *callp, *serverVersion = AFS_CLIENT_RETRIEVAL_FIRST_EDITION; #ifdef DEBUG #ifndef SIZE_MAX -#define SIZE_MAX sizeof(afs_int32) +#define SIZE_MAX UINT_MAX #endif osi_assert(allocsize < SIZE_MAX); #endif diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c index 16a89e1f5..d24010343 100644 --- a/src/lwp/iomgr.c +++ b/src/lwp/iomgr.c @@ -129,7 +129,9 @@ struct IoRequest { struct TM_Elem timeout; /* Result of select call */ - size_t result; + int result; + + struct IoRequest *next; /* for iorFreeList */ #ifdef AFS_DJGPP_ENV NCB *ncbp; @@ -228,14 +230,14 @@ fd_set *IOMGR_AllocFDSet(void) } } -#define FreeRequest(x) ((x)->result = (size_t)iorFreeList, iorFreeList = (x)) +#define FreeRequest(x) ((x)->next = iorFreeList, iorFreeList = (x)) static struct IoRequest *NewRequest() { struct IoRequest *request; if ((request=iorFreeList)) - iorFreeList = (struct IoRequest *) (request->result); + iorFreeList = (struct IoRequest *) (request->next); else request = (struct IoRequest *) malloc(sizeof(struct IoRequest)); memset((char*)request, 0, sizeof(struct IoRequest)); @@ -304,7 +306,10 @@ static int FDSetCmp(int nfds, fd_set *fd_set1, fd_set *fd_set2) */ static void FDSetSet(int nfds, fd_set *fd_set1, fd_set *fd_set2) { - unsigned int i, n; + unsigned int i; +#ifndef AFS_NT40_ENV + unsigned int n; +#endif if (fd_set1 == (fd_set*)0 || fd_set2 == (fd_set*)0) return; @@ -918,7 +923,7 @@ int IOMGR_Select(fds, readfds, writefds, exceptfds, timeout) struct timeval *timeout; { register struct IoRequest *request; - size_t result; + int result; #ifndef AFS_NT40_ENV if(fds > FD_SETSIZE) { @@ -1007,7 +1012,7 @@ again: result = request -> result; FreeRequest(request); - return (result > 1 ? 1 : (int)result); + return (result > 1 ? 1 : result); } int IOMGR_Cancel(PROCESS pid) -- 2.39.5