]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-64-bit-type-safety-20051105
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 19 Dec 2005 15:51:28 +0000 (15:51 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 19 Dec 2005 15:51:28 +0000 (15:51 +0000)
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
src/lwp/iomgr.c

index ca26be418cf726d865232524e535749727929675..23bcd26f3f6162119f563af5c89b995ba01669ce 100644 (file)
@@ -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
index 16a89e1f593a4b518a78762fdd5fb70153215ed1..d240103434016b7c859b8a35e8d97ac25da791a0 100644 (file)
@@ -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);
 }
 \f
 int IOMGR_Cancel(PROCESS pid)