Windows: remove warnings from cm_daemon.c
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 20 Oct 2010 23:28:26 +0000 (19:28 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Thu, 21 Oct 2010 14:50:36 +0000 (07:50 -0700)
Properly cast void * to long and int to LPVOID to avoid warnings.

Change-Id: Iaa48bd9247df21efbbed4422a156c67208c128d6
Reviewed-on: http://gerrit.openafs.org/3019
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_daemon.c

index 72ec250..3c765cc 100644 (file)
@@ -18,6 +18,7 @@
 #include <string.h>
 
 #include "afsd.h"
+#include "smb.h"
 
 #include <rx/rx.h>
 #include <rx/rx_prototypes.h>
@@ -88,9 +89,9 @@ void cm_BkgDaemon(void * parm)
     cm_bkgRequest_t *rp;
     afs_int32 code;
     char name[32] = "";
-    long daemonID = (long)parm;
+    long daemonID = (long)(LONG_PTR)parm;
 
-    snprintf(name, sizeof(name), "cm_BkgDaemon_ShutdownEvent%d", daemonID);
+    snprintf(name, sizeof(name), "cm_BkgDaemon_ShutdownEvent%u", daemonID);
 
     cm_BkgDaemon_ShutdownEvent[daemonID] = thrd_CreateEvent(NULL, FALSE, FALSE, name);
     if ( GetLastError() == ERROR_ALREADY_EXISTS )
@@ -673,7 +674,7 @@ void cm_InitDaemon(int nDaemons)
 
        for(i=0; i < cm_nDaemons; i++) {
             phandle = thrd_Create((SecurityAttrib) 0, 0,
-                                   (ThreadFunc) cm_BkgDaemon, (LPVOID)i, 0, &pid,
+                                   (ThreadFunc) cm_BkgDaemon, (LPVOID)(LONG_PTR)i, 0, &pid,
                                    "cm_BkgDaemon");
             osi_assertx(phandle != NULL, "cm_BkgDaemon thread creation failure");
             thrd_CloseHandle(phandle);