diff -urN -xCVS pthreads.orig/GNUmakefile pthreads/GNUmakefile
--- pthreads.orig/GNUmakefile	Sun Jun 20 12:31:19 2010
+++ pthreads/GNUmakefile	Sun Jun 20 19:58:33 2010
@@ -58,13 +58,13 @@
 RANLIB  = $(CROSS)ranlib
 RC	= $(CROSS)windres
 
-OPT	= $(CLEANUP) -O3 -finline-functions
+OPT	= $(CLEANUP) -O3 -DHAVE_STRUCT_TIMESPEC -D__MINGW32__ -finline-functions
 DOPT	= $(CLEANUP) -g -O0
 XOPT	=
 
 RCFLAGS		= --include-dir=.
 # Uncomment this if config.h defines RETAIN_WSALASTERROR
-#LFLAGS		= -lwsock32
+#LFLAGS		= -lws2_32
 
 # ----------------------------------------------------------------------
 # The library can be built with some alternative behaviour to
diff -urN -xCVS pthreads.orig/context.h pthreads/context.h
--- pthreads.orig/context.h	Sat Jan  6 22:44:40 2007
+++ pthreads/context.h	Sun Jun 20 19:58:33 2010
@@ -39,7 +39,7 @@
 
 #undef PTW32_PROGCTR
 
-#if defined(_M_IX86) || defined(_X86_)
+#if defined(_M_IX86) || (defined(_X86_) && !defined(__amd64__))
 #define PTW32_PROGCTR(Context)  ((Context).Eip)
 #endif
 
diff -urN -xCVS pthreads.orig/need_errno.h pthreads/need_errno.h
--- pthreads.orig/need_errno.h	Sun Jun 20 12:31:19 2010
+++ pthreads/need_errno.h	Sun Jun 20 19:58:33 2010
@@ -59,7 +59,7 @@
 #endif
 #endif
 
-#if !defined(PTW32_STATIC_LIB)
+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__)
 #  ifdef PTW32_BUILD
 #    define PTW32_DLLPORT __declspec (dllexport)
 #  else
diff -urN -xCVS pthreads.orig/pthread.h pthreads/pthread.h
--- pthreads.orig/pthread.h	Sun Jun 20 12:31:19 2010
+++ pthreads/pthread.h	Sun Jun 20 19:58:33 2010
@@ -304,10 +304,13 @@
 
 #ifndef HAVE_STRUCT_TIMESPEC
 #define HAVE_STRUCT_TIMESPEC 1
+#ifndef _TIMESPEC_DEFINED
+#define _TIMESPEC_DEFINED
 struct timespec {
         time_t tv_sec;
         long tv_nsec;
 };
+#endif
 #endif /* HAVE_STRUCT_TIMESPEC */
 
 #ifndef SIG_BLOCK
@@ -533,7 +536,7 @@
  * do NOT define PTW32_BUILD, and then the variables/functions will
  * be imported correctly.
  */
-#if !defined(PTW32_STATIC_LIB)
+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__)
 #  ifdef PTW32_BUILD
 #    define PTW32_DLLPORT __declspec (dllexport)
 #  else
diff -urN -xCVS pthreads.orig/pthread_cancel.c pthreads/pthread_cancel.c
--- pthreads.orig/pthread_cancel.c	Sun Jun 20 12:31:19 2010
+++ pthreads/pthread_cancel.c	Sun Jun 20 19:58:33 2010
@@ -47,7 +47,7 @@
 }
 
 static void CALLBACK
-ptw32_cancel_callback (DWORD unused)
+ptw32_cancel_callback (ULONG_PTR unused)
 {
   ptw32_throw (PTW32_EPS_CANCEL);
 
@@ -157,7 +157,7 @@
 	       * this will result in a call to ptw32_RegisterCancelation and only
 	       * the threadH arg will be used.
 	       */
-	      ptw32_register_cancelation (ptw32_cancel_callback, threadH, 0);
+	      ptw32_register_cancelation ((PAPCFUNC)ptw32_cancel_callback, threadH, 0);
 	      (void) pthread_mutex_unlock (&tp->cancelLock);
 	      ResumeThread (threadH);
 	    }
diff -urN -xCVS pthreads.orig/pthread_exit.c pthreads/pthread_exit.c
--- pthreads.orig/pthread_exit.c	Tue May 15 22:46:42 2007
+++ pthreads/pthread_exit.c	Sun Jun 20 19:58:33 2010
@@ -89,7 +89,7 @@
        */
 
 #if ! defined (__MINGW32__) || defined (__MSVCRT__)  || defined (__DMC__)
-      _endthreadex ((unsigned) value_ptr);
+      _endthreadex ((unsigned) (size_t) value_ptr);
 #else
       _endthread ();
 #endif
diff -urN -xCVS pthreads.orig/pthread_spin_destroy.c pthreads/pthread_spin_destroy.c
--- pthreads.orig/pthread_spin_destroy.c	Sat Jan  1 23:36:17 2005
+++ pthreads/pthread_spin_destroy.c	Sun Jun 20 19:58:33 2010
@@ -59,9 +59,9 @@
 	       PTW32_INTERLOCKED_COMPARE_EXCHANGE ((PTW32_INTERLOCKED_LPLONG)
 						   & (s->interlock),
 						   (PTW32_INTERLOCKED_LONG)
-						   PTW32_OBJECT_INVALID,
+						   (size_t)PTW32_OBJECT_INVALID,
 						   (PTW32_INTERLOCKED_LONG)
-						   PTW32_SPIN_UNLOCKED))
+						   (size_t)PTW32_SPIN_UNLOCKED))
 	{
 	  result = EINVAL;
 	}
diff -urN -xCVS pthreads.orig/pthread_timechange_handler_np.c pthreads/pthread_timechange_handler_np.c
--- pthreads.orig/pthread_timechange_handler_np.c	Sat Jan  1 23:36:17 2005
+++ pthreads/pthread_timechange_handler_np.c	Sun Jun 20 19:58:33 2010
@@ -103,5 +103,5 @@
 
   LeaveCriticalSection (&ptw32_cond_list_lock);
 
-  return (void *) (result != 0 ? EAGAIN : 0);
+  return (void *) (size_t) (result != 0 ? EAGAIN : 0);
 }
diff -urN -xCVS pthreads.orig/ptw32_MCS_lock.c pthreads/ptw32_MCS_lock.c
--- pthreads.orig/ptw32_MCS_lock.c	Sun Jun 20 12:31:19 2010
+++ pthreads/ptw32_MCS_lock.c	Sun Jun 20 19:54:50 2010
@@ -101,10 +101,10 @@
 INLINE void 
 ptw32_mcs_flag_set (LONG * flag)
 {
-  HANDLE e = (HANDLE)PTW32_INTERLOCKED_COMPARE_EXCHANGE(
+  HANDLE e = (HANDLE)(size_t) PTW32_INTERLOCKED_COMPARE_EXCHANGE(
 						(PTW32_INTERLOCKED_LPLONG)flag,
-						(PTW32_INTERLOCKED_LONG)-1,
-						(PTW32_INTERLOCKED_LONG)0);
+						(PTW32_INTERLOCKED_LONG)(size_t)-1,
+						(PTW32_INTERLOCKED_LONG)(size_t)0);
   if ((HANDLE)0 != e)
     {
       /* another thread has already stored an event handle in the flag */
@@ -129,8 +129,8 @@
 
       if (0 == PTW32_INTERLOCKED_COMPARE_EXCHANGE(
 			                  (PTW32_INTERLOCKED_LPLONG)flag,
-			                  (PTW32_INTERLOCKED_LONG)e,
-			                  (PTW32_INTERLOCKED_LONG)0))
+			                  (PTW32_INTERLOCKED_LONG)(size_t)e,
+			                  (PTW32_INTERLOCKED_LONG)(size_t)0))
 	{
 	  /* stored handle in the flag. wait on it now. */
 	  WaitForSingleObject(e, INFINITE);
@@ -159,8 +159,8 @@
   node->next = 0; /* initially, no successor */
   
   /* queue for the lock */
-  pred = (ptw32_mcs_local_node_t *)PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_LPLONG)lock,
-						              (PTW32_INTERLOCKED_LONG)node);
+  pred = (ptw32_mcs_local_node_t *)InterlockedExchangePointer((PVOID volatile *)lock,
+						              (void*)node);
 
   if (0 != pred)
     {
@@ -184,17 +184,21 @@
 {
   ptw32_mcs_lock_t *lock = node->lock;
   ptw32_mcs_local_node_t *next = (ptw32_mcs_local_node_t *)
+#ifndef _WIN64
     InterlockedExchangeAdd((LPLONG)&node->next,
                            (LONG)0); /* MBR fence */
+#else
+    InterlockedExchangeAdd64((LONG64 *)&node->next, 0); /* MBR fence */
+#endif
 
   if (0 == next)
     {
       /* no known successor */
 
       if (node == (ptw32_mcs_local_node_t *)
-	  PTW32_INTERLOCKED_COMPARE_EXCHANGE((PTW32_INTERLOCKED_LPLONG)lock,
-					     (PTW32_INTERLOCKED_LONG)0,
-					     (PTW32_INTERLOCKED_LONG)node))
+	  InterlockedCompareExchangePointer((LPVOID volatile *)lock,
+					     (PVOID)0,
+					     (PVOID)node))
 	{
 	  /* no successor, lock is free now */
 	  return;
@@ -203,7 +207,11 @@
       /* wait for successor */
       ptw32_mcs_flag_wait(&node->nextFlag);
       next = (ptw32_mcs_local_node_t *)
+#ifndef _WIN64
 	InterlockedExchangeAdd((LPLONG)&node->next, 0); /* MBR fence */
+#else
+    InterlockedExchangeAdd64((LONG64 *)&node->next, 0); /* MBR fence */
+#endif
     }
 
   /* pass the lock */
diff -urN -xCVS pthreads.orig/ptw32_threadStart.c pthreads/ptw32_threadStart.c
--- pthreads.orig/ptw32_threadStart.c	Mon May 16 00:28:27 2005
+++ pthreads/ptw32_threadStart.c	Sun Jun 20 19:58:33 2010
@@ -344,7 +344,7 @@
 #endif
 
 #if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
-  _endthreadex ((unsigned) status);
+  _endthreadex ((unsigned) (size_t) status);
 #else
   _endthread ();
 #endif
@@ -354,7 +354,7 @@
    */
 
 #if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
-  return (unsigned) status;
+  return (unsigned) (size_t) status;
 #endif
 
 }				/* ptw32_threadStart */
diff -urN -xCVS pthreads.orig/ptw32_throw.c pthreads/ptw32_throw.c
--- pthreads.orig/ptw32_throw.c	Fri Jun  6 09:23:20 2008
+++ pthreads/ptw32_throw.c	Sun Jun 20 19:58:33 2010
@@ -79,12 +79,12 @@
       switch (exception)
 	{
 	case PTW32_EPS_CANCEL:
-	  exitCode = (unsigned) PTHREAD_CANCELED;
+	  exitCode = (unsigned) (size_t) PTHREAD_CANCELED;
 	  break;
 	case PTW32_EPS_EXIT:
 	  if (NULL != sp)
 	    {
-	      exitCode = (unsigned) sp->exitStatus;
+	      exitCode = (unsigned) (size_t) sp->exitStatus;
 	    }
 	  break;
 	}
@@ -166,7 +166,7 @@
 
 #else
 
-  return (DWORD) NULL;
+  return (DWORD) (size_t) NULL;
 
 #endif
 }
diff -urN -xCVS pthreads.orig/sched.h pthreads/sched.h
--- pthreads.orig/sched.h	Sun Jun 20 12:31:19 2010
+++ pthreads/sched.h	Sun Jun 20 19:58:33 2010
@@ -76,7 +76,7 @@
  * do NOT define PTW32_BUILD, and then the variables/functions will
  * be imported correctly.
  */
-#if !defined(PTW32_STATIC_LIB)
+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__)
 #  ifdef PTW32_BUILD
 #    define PTW32_DLLPORT __declspec (dllexport)
 #  else
diff -urN -xCVS pthreads.orig/semaphore.h pthreads/semaphore.h
--- pthreads.orig/semaphore.h	Sun Jun 20 12:31:19 2010
+++ pthreads/semaphore.h	Sun Jun 20 19:58:33 2010
@@ -75,7 +75,7 @@
  * do NOT define PTW32_BUILD, and then the variables/functions will
  * be imported correctly.
  */
-#if !defined(PTW32_STATIC_LIB)
+#if !defined(PTW32_STATIC_LIB) && !defined(__MINGW32__)
 #  ifdef PTW32_BUILD
 #    define PTW32_DLLPORT __declspec (dllexport)
 #  else
diff -urN -xCVS pthreads.orig/tests/GNUmakefile pthreads/tests/GNUmakefile
--- pthreads.orig/tests/GNUmakefile	Sun Jun 20 13:26:26 2010
+++ pthreads/tests/GNUmakefile	Sun Jun 20 19:58:33 2010
@@ -51,7 +51,7 @@
 #
 XXCFLAGS	= 
 XXLIBS	= -lws2_32 -lgomp
-#CFLAGS	= -O3 -UNDEBUG -Wall $(XXCFLAGS)
+#CFLAGS	= -O3 -D_M_AMD64 -UNDEBUG -Wall $(XXCFLAGS)
 CFLAGS	= -O3 -UNDEBUG -Wall $(XXCFLAGS)
 BUILD_DIR	= ..
 INCLUDES	= -I.
@@ -70,7 +70,7 @@
 # The next path is relative to $BUILD_DIR
 QAPC	= ../QueueUserAPCEx/User/quserex.dll
 
-COPYFILES	= $(HDR) $(LIB) $(DLL) $(QAPC)
+COPYFILES	= $(HDR) $(LIB) $(DLL)
 
 # If a test case returns a non-zero exit code to the shell, make will
 # stop.
@@ -167,7 +167,7 @@
 	@ $(MAKE) clean GCE
 
 GC:
-	$(MAKE) TEST=GC CC=gcc XXCFLAGS="-fopenmp -D__CLEANUP_C" all-pass
+	$(MAKE) TEST=GC CC=x86_64-pc-mingw32-gcc XXCFLAGS="-fopenmp -D__CLEANUP_C" all-pass
 
 GCE:
 	$(MAKE) TEST=GCE CC=g++ XXCFLAGS="-fopenmp -mthreads -D__CLEANUP_CXX" all-pass
@@ -348,24 +348,24 @@
 
 sizes.pass: sizes.exe
 	@ $(ECHO) Running $*
-	$< > SIZES.$(TEST)
+	./$< > SIZES.$(TEST)
 	@ $(CAT) SIZES.$(TEST)
 	@ $(ECHO) Passed
 	@ $(TOUCH) $@
 
 %.pass: %.exe
 	@ $(ECHO) Running $*
-	$*
+	./$*
 	@ $(ECHO) Passed
 	@ $(TOUCH) $@
 
-%.bench: $(LIB) $(DLL) $(HDR) $(QAPC) $(XXLIBS) %.exe
+%.bench: $(LIB) $(DLL) $(HDR)  $(XXLIBS) %.exe
 	@ $(ECHO) Running $*
 	$*
 	@ $(ECHO) Done
 	@ $(TOUCH) $@
 
-%.exe: %.c $(LIB) $(DLL) $(HDR) $(QAPC)
+%.exe: %.c $(LIB) $(DLL) $(HDR)
 	@ $(ECHO) Compiling $@
 	@ $(ECHO) $(CC) $(CFLAGS) -o $@ $< $(INCLUDES) -L. -lpthread$(GCX) -lsupc++ $(XXLIBS)
 	@ $(CC) $(CFLAGS) -o $@ $< $(INCLUDES) -L. -lpthread$(GCX) -lsupc++ $(XXLIBS)
diff -urN -xCVS pthreads.orig/tests/barrier3.c pthreads/tests/barrier3.c
--- pthreads.orig/tests/barrier3.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/barrier3.c	Sun Jun 20 19:58:33 2010
@@ -41,7 +41,7 @@
 #include "test.h"
  
 pthread_barrier_t barrier = NULL;
-static int result = 1;
+static DWORD_PTR result = 1;
 
 void * func(void * arg)
 {
diff -urN -xCVS pthreads.orig/tests/barrier5.c pthreads/tests/barrier5.c
--- pthreads.orig/tests/barrier5.c	Sun Jun 20 12:31:20 2010
+++ pthreads/tests/barrier5.c	Sun Jun 20 19:58:33 2010
@@ -79,7 +79,7 @@
 main()
 {
   int i, j;
-  int result;
+  DWORD_PTR result;
   int serialThreadsTotal;
   LONG Crossings;
   pthread_t t[NUMTHREADS + 1];
@@ -104,7 +104,7 @@
       for (i = 1; i <= j; i++)
         {
           assert(pthread_join(t[i], (void **) &result) == 0);
-          serialThreadsTotal += result;
+           serialThreadsTotal += (int)result;
         }
 
       assert(serialThreadsTotal == BARRIERMULTIPLE);
diff -urN -xCVS pthreads.orig/tests/cancel2.c pthreads/tests/cancel2.c
--- pthreads.orig/tests/cancel2.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/cancel2.c	Sun Jun 20 19:58:33 2010
@@ -217,7 +217,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
       fail = (result != (int) PTHREAD_CANCELED);
diff -urN -xCVS pthreads.orig/tests/cancel3.c pthreads/tests/cancel3.c
--- pthreads.orig/tests/cancel3.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/cancel3.c	Sun Jun 20 19:58:33 2010
@@ -173,7 +173,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
diff -urN -xCVS pthreads.orig/tests/cancel4.c pthreads/tests/cancel4.c
--- pthreads.orig/tests/cancel4.c	Fri May  6 16:31:32 2005
+++ pthreads/tests/cancel4.c	Sun Jun 20 19:58:33 2010
@@ -98,7 +98,7 @@
 void *
 mythread(void * arg)
 {
-  int result = ((int)PTHREAD_CANCELED + 1);
+  int result = ((int)(size_t)PTHREAD_CANCELED + 1);
   bag_t * bag = (bag_t *) arg;
 
   assert(bag == &threadbag[bag->threadnum]);
@@ -118,7 +118,7 @@
   for (bag->count = 0; bag->count < 20; bag->count++)
     Sleep(100);
 
-  return (void *) result;
+  return (void *) (size_t)result;
 }
 
 int
@@ -173,7 +173,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
@@ -182,7 +182,7 @@
        */
       assert(pthread_join(t[i], (void **) &result) == 0);
 
-      fail = (result == (int) PTHREAD_CANCELED);
+      fail = (result == (int) (size_t) PTHREAD_CANCELED);
 
       if (fail)
 	{
diff -urN -xCVS pthreads.orig/tests/cancel5.c pthreads/tests/cancel5.c
--- pthreads.orig/tests/cancel5.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/cancel5.c	Sun Jun 20 19:58:33 2010
@@ -171,7 +171,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
diff -urN -xCVS pthreads.orig/tests/cancel6a.c pthreads/tests/cancel6a.c
--- pthreads.orig/tests/cancel6a.c	Wed Nov  3 10:08:44 2004
+++ pthreads/tests/cancel6a.c	Sun Jun 20 19:58:33 2010
@@ -85,7 +85,7 @@
 void *
 mythread(void * arg)
 {
-  int result = ((int)PTHREAD_CANCELED + 1);
+  int result = ((int)(size_t)PTHREAD_CANCELED + 1);
   bag_t * bag = (bag_t *) arg;
 
   assert(bag == &threadbag[bag->threadnum]);
@@ -105,7 +105,7 @@
   for (bag->count = 0; bag->count < 100; bag->count++)
     Sleep(100);
 
-  return (void *) result;
+  return (void *) (size_t)result;
 }
 
 int
@@ -161,7 +161,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
@@ -170,7 +170,7 @@
        */
       assert(pthread_join(t[i], (void **) &result) == 0);
 
-      fail = (result != (int) PTHREAD_CANCELED);
+      fail = (result != (int) (size_t) PTHREAD_CANCELED);
 
       if (fail)
 	{
diff -urN -xCVS pthreads.orig/tests/cancel6d.c pthreads/tests/cancel6d.c
--- pthreads.orig/tests/cancel6d.c	Wed Nov  3 10:08:44 2004
+++ pthreads/tests/cancel6d.c	Sun Jun 20 19:58:33 2010
@@ -86,7 +86,7 @@
 void *
 mythread(void * arg)
 {
-  int result = ((int)PTHREAD_CANCELED + 1);
+  int result = ((int) (size_t) PTHREAD_CANCELED + 1);
   bag_t * bag = (bag_t *) arg;
 
   assert(bag == &threadbag[bag->threadnum]);
@@ -109,7 +109,7 @@
       pthread_testcancel();
     }
 
-  return (void *) result;
+  return (void *) (size_t) result;
 }
 
 int
@@ -165,11 +165,11 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
-      fail = (result != (int) PTHREAD_CANCELED);
+      fail = (result != (int) (size_t) PTHREAD_CANCELED);
 
       if (fail)
 	{
diff -urN -xCVS pthreads.orig/tests/cancel8.c pthreads/tests/cancel8.c
--- pthreads.orig/tests/cancel8.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/cancel8.c	Sun Jun 20 19:58:33 2010
@@ -195,7 +195,7 @@
       assert(threadbag[i].self.p != NULL);
       assert(pthread_kill(threadbag[i].self, 0) == ESRCH);
 
-      fail = (result != (int) PTHREAD_CANCELED);
+      fail = (result != (int) (size_t) PTHREAD_CANCELED);
 
       if (fail)
 	{
diff -urN -xCVS pthreads.orig/tests/cleanup0.c pthreads/tests/cleanup0.c
--- pthreads.orig/tests/cleanup0.c	Wed Apr  6 11:16:29 2005
+++ pthreads/tests/cleanup0.c	Sun Jun 20 19:58:33 2010
@@ -189,7 +189,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
diff -urN -xCVS pthreads.orig/tests/cleanup1.c pthreads/tests/cleanup1.c
--- pthreads.orig/tests/cleanup1.c	Wed Apr  6 11:16:29 2005
+++ pthreads/tests/cleanup1.c	Sun Jun 20 19:58:33 2010
@@ -203,7 +203,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
diff -urN -xCVS pthreads.orig/tests/cleanup2.c pthreads/tests/cleanup2.c
--- pthreads.orig/tests/cleanup2.c	Wed Apr  6 11:16:29 2005
+++ pthreads/tests/cleanup2.c	Sun Jun 20 19:58:33 2010
@@ -178,7 +178,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
diff -urN -xCVS pthreads.orig/tests/cleanup3.c pthreads/tests/cleanup3.c
--- pthreads.orig/tests/cleanup3.c	Wed Apr  6 11:16:29 2005
+++ pthreads/tests/cleanup3.c	Sun Jun 20 19:58:33 2010
@@ -183,7 +183,7 @@
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
diff -urN -xCVS pthreads.orig/tests/condvar1_2.c pthreads/tests/condvar1_2.c
--- pthreads.orig/tests/condvar1_2.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/condvar1_2.c	Sun Jun 20 19:58:33 2010
@@ -89,7 +89,7 @@
 main()
 {
   int i, j, k;
-  int result = -1;
+  DWORD_PTR result = -1;
   pthread_t t;
 
   for (k = 0; k < NUM_LOOPS; k++)
diff -urN -xCVS pthreads.orig/tests/condvar2.c pthreads/tests/condvar2.c
--- pthreads.orig/tests/condvar2.c	Fri May  6 16:31:32 2005
+++ pthreads/tests/condvar2.c	Sun Jun 20 19:58:33 2010
@@ -99,7 +99,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
@@ -109,7 +109,7 @@
   assert(pthread_mutex_unlock(&mutex) == 0);
 
   {
-  int result = pthread_cond_destroy(&cv);
+  DWORD_PTR result = pthread_cond_destroy(&cv);
   if (result != 0)
     {
       fprintf(stderr, "Result = %s\n", error_string[result]);
diff -urN -xCVS pthreads.orig/tests/condvar2_1.c pthreads/tests/condvar2_1.c
--- pthreads.orig/tests/condvar2_1.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/condvar2_1.c	Sun Jun 20 19:58:33 2010
@@ -105,7 +105,7 @@
 {
   int i;
   pthread_t t[NUMTHREADS + 1];
-  int result = 0;
+  DWORD_PTR result = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
@@ -116,7 +116,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
diff -urN -xCVS pthreads.orig/tests/condvar3.c pthreads/tests/condvar3.c
--- pthreads.orig/tests/condvar3.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar3.c	Sun Jun 20 19:58:33 2010
@@ -126,7 +126,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   assert(pthread_create(&t[1], NULL, mythread, (void *) 1) == 0);
diff -urN -xCVS pthreads.orig/tests/condvar3_1.c pthreads/tests/condvar3_1.c
--- pthreads.orig/tests/condvar3_1.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar3_1.c	Sun Jun 20 19:58:33 2010
@@ -126,7 +126,7 @@
 {
   int i;
   pthread_t t[NUMTHREADS + 1];
-  int result = 0;
+  DWORD_PTR result = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
@@ -139,7 +139,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
diff -urN -xCVS pthreads.orig/tests/condvar3_2.c pthreads/tests/condvar3_2.c
--- pthreads.orig/tests/condvar3_2.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar3_2.c	Sun Jun 20 19:58:33 2010
@@ -127,7 +127,7 @@
 {
   int i;
   pthread_t t[NUMTHREADS + 1];
-  int result = 0;
+  DWORD_PTR result = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
@@ -138,7 +138,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = abstime.tv_sec = currSysTime.time + 5;
+  abstime.tv_sec = abstime.tv_sec = (long)currSysTime.time + 5;
   abstime.tv_nsec = abstime2.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   assert(pthread_mutex_lock(&mutex) == 0);
diff -urN -xCVS pthreads.orig/tests/condvar3_3.c pthreads/tests/condvar3_3.c
--- pthreads.orig/tests/condvar3_3.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar3_3.c	Sun Jun 20 19:58:33 2010
@@ -96,7 +96,7 @@
    /* get current system time */
    _ftime(&currSysTime);
 
-   abstime.tv_sec = currSysTime.time;
+   abstime.tv_sec = (long)currSysTime.time;
    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
    abstime.tv_sec += 1;
 
@@ -120,7 +120,7 @@
 
    assert(pthread_mutex_lock(&mtx) == 0);
 
-   abstime.tv_sec = currSysTime.time;
+   abstime.tv_sec = (long)currSysTime.time;
    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
    abstime.tv_sec += 1;
 
diff -urN -xCVS pthreads.orig/tests/condvar4.c pthreads/tests/condvar4.c
--- pthreads.orig/tests/condvar4.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar4.c	Sun Jun 20 19:58:33 2010
@@ -130,7 +130,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
@@ -143,7 +143,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
diff -urN -xCVS pthreads.orig/tests/condvar5.c pthreads/tests/condvar5.c
--- pthreads.orig/tests/condvar5.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar5.c	Sun Jun 20 19:58:33 2010
@@ -129,7 +129,7 @@
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
@@ -142,7 +142,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
diff -urN -xCVS pthreads.orig/tests/condvar6.c pthreads/tests/condvar6.c
--- pthreads.orig/tests/condvar6.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar6.c	Sun Jun 20 19:58:33 2010
@@ -159,7 +159,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
diff -urN -xCVS pthreads.orig/tests/condvar7.c pthreads/tests/condvar7.c
--- pthreads.orig/tests/condvar7.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar7.c	Sun Jun 20 19:58:33 2010
@@ -169,7 +169,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 10;
diff -urN -xCVS pthreads.orig/tests/condvar8.c pthreads/tests/condvar8.c
--- pthreads.orig/tests/condvar8.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar8.c	Sun Jun 20 19:58:33 2010
@@ -166,7 +166,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 10;
diff -urN -xCVS pthreads.orig/tests/condvar9.c pthreads/tests/condvar9.c
--- pthreads.orig/tests/condvar9.c	Mon Apr 25 23:42:44 2005
+++ pthreads/tests/condvar9.c	Sun Jun 20 19:58:33 2010
@@ -174,7 +174,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
diff -urN -xCVS pthreads.orig/tests/delay2.c pthreads/tests/delay2.c
--- pthreads.orig/tests/delay2.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/delay2.c	Sun Jun 20 19:58:33 2010
@@ -65,7 +65,7 @@
 main(int argc, char * argv[])
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
 
   assert(pthread_mutex_lock(&mx) == 0);
 
diff -urN -xCVS pthreads.orig/tests/exception1.c pthreads/tests/exception1.c
--- pthreads.orig/tests/exception1.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/exception1.c	Sun Jun 20 19:58:33 2010
@@ -226,7 +226,7 @@
   for (i = 0; i < NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
 	/* Canceled thread */
       assert(pthread_join(ct[i], (void **) &result) == 0);
diff -urN -xCVS pthreads.orig/tests/inherit1.c pthreads/tests/inherit1.c
--- pthreads.orig/tests/inherit1.c	Sat Jan  1 23:36:18 2005
+++ pthreads/tests/inherit1.c	Sun Jun 20 19:58:33 2010
@@ -89,7 +89,7 @@
   struct sched_param param;
 
   assert(pthread_getschedparam(pthread_self(), &policy, &param) == 0);
-  return (void *) param.sched_priority;
+  return (void *) (size_t) param.sched_priority;
 }
 
 
@@ -169,7 +169,7 @@
           assert(pthread_attr_setschedparam(&attr, &param) == 0);
           assert(pthread_create(&t, &attr, func, NULL) == 0);
           pthread_join(t, &result);
-          assert((int) result == mainParam.sched_priority);
+          assert((int) (size_t)result == mainParam.sched_priority);
         }
     }
 
diff -urN -xCVS pthreads.orig/tests/join0.c pthreads/tests/join0.c
--- pthreads.orig/tests/join0.c	Mon May 16 00:28:28 2005
+++ pthreads/tests/join0.c	Sun Jun 20 19:58:33 2010
@@ -53,7 +53,7 @@
 main(int argc, char * argv[])
 {
   pthread_t id;
-  int result;
+  DWORD_PTR result;
 
   /* Create a single thread and wait for it to exit. */
   assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
diff -urN -xCVS pthreads.orig/tests/join1.c pthreads/tests/join1.c
--- pthreads.orig/tests/join1.c	Mon May 16 00:28:28 2005
+++ pthreads/tests/join1.c	Sun Jun 20 19:58:33 2010
@@ -56,7 +56,7 @@
 {
 	pthread_t id[4];
 	int i;
-	int result;
+	DWORD_PTR result;
 
 	/* Create a few threads and then exit. */
 	for (i = 0; i < 4; i++)
diff -urN -xCVS pthreads.orig/tests/join2.c pthreads/tests/join2.c
--- pthreads.orig/tests/join2.c	Mon May 16 00:28:28 2005
+++ pthreads/tests/join2.c	Sun Jun 20 19:58:33 2010
@@ -50,7 +50,7 @@
 {
 	pthread_t id[4];
 	int i;
-	int result;
+	DWORD_PTR result;
 
 	/* Create a few threads and then exit. */
 	for (i = 0; i < 4; i++)
diff -urN -xCVS pthreads.orig/tests/join3.c pthreads/tests/join3.c
--- pthreads.orig/tests/join3.c	Mon May 16 00:28:28 2005
+++ pthreads/tests/join3.c	Sun Jun 20 19:58:33 2010
@@ -50,7 +50,7 @@
 {
 	pthread_t id[4];
 	int i;
-	int result;
+	DWORD_PTR result;
 
 	/* Create a few threads and then exit. */
 	for (i = 0; i < 4; i++)
diff -urN -xCVS pthreads.orig/tests/mutex6e.c pthreads/tests/mutex6e.c
--- pthreads.orig/tests/mutex6e.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/mutex6e.c	Sun Jun 20 19:58:33 2010
@@ -74,7 +74,7 @@
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
diff -urN -xCVS pthreads.orig/tests/mutex6es.c pthreads/tests/mutex6es.c
--- pthreads.orig/tests/mutex6es.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/mutex6es.c	Sun Jun 20 19:58:33 2010
@@ -73,7 +73,7 @@
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
 
   assert(mutex == PTHREAD_ERRORCHECK_MUTEX_INITIALIZER);
 
diff -urN -xCVS pthreads.orig/tests/mutex6r.c pthreads/tests/mutex6r.c
--- pthreads.orig/tests/mutex6r.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/mutex6r.c	Sun Jun 20 19:58:34 2010
@@ -73,7 +73,7 @@
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
diff -urN -xCVS pthreads.orig/tests/mutex6rs.c pthreads/tests/mutex6rs.c
--- pthreads.orig/tests/mutex6rs.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/mutex6rs.c	Sun Jun 20 19:58:34 2010
@@ -72,7 +72,7 @@
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
 
   assert(mutex == PTHREAD_RECURSIVE_MUTEX_INITIALIZER);
 
diff -urN -xCVS pthreads.orig/tests/mutex7e.c pthreads/tests/mutex7e.c
--- pthreads.orig/tests/mutex7e.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/mutex7e.c	Sun Jun 20 19:58:34 2010
@@ -74,7 +74,7 @@
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
diff -urN -xCVS pthreads.orig/tests/mutex7r.c pthreads/tests/mutex7r.c
--- pthreads.orig/tests/mutex7r.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/mutex7r.c	Sun Jun 20 19:58:34 2010
@@ -73,7 +73,7 @@
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
diff -urN -xCVS pthreads.orig/tests/mutex8.c pthreads/tests/mutex8.c
--- pthreads.orig/tests/mutex8.c	Wed Feb 20 13:39:56 2002
+++ pthreads/tests/mutex8.c	Sun Jun 20 19:58:34 2010
@@ -49,7 +49,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/mutex8e.c pthreads/tests/mutex8e.c
--- pthreads.orig/tests/mutex8e.c	Wed Feb 20 13:39:56 2002
+++ pthreads/tests/mutex8e.c	Sun Jun 20 19:58:34 2010
@@ -57,7 +57,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/mutex8n.c pthreads/tests/mutex8n.c
--- pthreads.orig/tests/mutex8n.c	Wed Feb 20 13:39:56 2002
+++ pthreads/tests/mutex8n.c	Sun Jun 20 19:58:34 2010
@@ -57,7 +57,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/mutex8r.c pthreads/tests/mutex8r.c
--- pthreads.orig/tests/mutex8r.c	Wed Feb 20 13:39:56 2002
+++ pthreads/tests/mutex8r.c	Sun Jun 20 19:58:34 2010
@@ -57,7 +57,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/priority1.c pthreads/tests/priority1.c
--- pthreads.orig/tests/priority1.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/priority1.c	Sun Jun 20 19:58:34 2010
@@ -91,7 +91,7 @@
 
   assert(pthread_getschedparam(threadID, &policy, &param) == 0);
   assert(policy == SCHED_OTHER);
-  return (void *) (param.sched_priority);
+  return (void *) (size_t) (param.sched_priority);
 }
 
 void *
@@ -164,8 +164,8 @@
 
       assert(pthread_join(t, &result) == 0);
 
-      assert(param.sched_priority == (int) result);
-      printf("%10d %10d %10d\n", param.sched_priority, (int) result, prio);
+      assert(param.sched_priority == (int) (size_t) result);
+      printf("%10d %10d %10d\n", param.sched_priority, (int) (size_t) result, prio);
     }
 
   return 0;
diff -urN -xCVS pthreads.orig/tests/priority2.c pthreads/tests/priority2.c
--- pthreads.orig/tests/priority2.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/priority2.c	Sun Jun 20 19:58:34 2010
@@ -95,7 +95,7 @@
   assert(policy == SCHED_OTHER);
   result = pthread_barrier_wait(&endBarrier);
   assert(result == 0 || result == PTHREAD_BARRIER_SERIAL_THREAD);
-  return (void *) param.sched_priority;
+  return (void *) (size_t) param.sched_priority;
 }
 
 
@@ -162,7 +162,7 @@
       assert(GetThreadPriority(pthread_getw32threadhandle_np(t)) ==
 	  validPriorities[param.sched_priority+(PTW32TEST_MAXPRIORITIES/2)]);
       pthread_join(t, &result);
-      assert(param.sched_priority == (int)result);
+      assert(param.sched_priority == (int)(size_t)result);
     }
 
   return 0;
diff -urN -xCVS pthreads.orig/tests/rwlock2_t.c pthreads/tests/rwlock2_t.c
--- pthreads.orig/tests/rwlock2_t.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock2_t.c	Sun Jun 20 19:58:34 2010
@@ -55,7 +55,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/rwlock3_t.c pthreads/tests/rwlock3_t.c
--- pthreads.orig/tests/rwlock3_t.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock3_t.c	Sun Jun 20 19:58:34 2010
@@ -68,7 +68,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/rwlock4_t.c pthreads/tests/rwlock4_t.c
--- pthreads.orig/tests/rwlock4_t.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock4_t.c	Sun Jun 20 19:58:34 2010
@@ -68,7 +68,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/rwlock5_t.c pthreads/tests/rwlock5_t.c
--- pthreads.orig/tests/rwlock5_t.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock5_t.c	Sun Jun 20 19:58:34 2010
@@ -70,7 +70,7 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/rwlock6.c pthreads/tests/rwlock6.c
--- pthreads.orig/tests/rwlock6.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock6.c	Sun Jun 20 19:58:34 2010
@@ -77,9 +77,9 @@
   pthread_t wrt1;
   pthread_t wrt2;
   pthread_t rdt;
-  int wr1Result = 0;
-  int wr2Result = 0;
-  int rdResult = 0;
+  DWORD_PTR wr1Result = 0;
+  DWORD_PTR wr2Result = 0;
+  DWORD_PTR rdResult = 0;
 
   bankAccount = 0;
 
diff -urN -xCVS pthreads.orig/tests/rwlock6_t.c pthreads/tests/rwlock6_t.c
--- pthreads.orig/tests/rwlock6_t.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock6_t.c	Sun Jun 20 19:58:34 2010
@@ -55,7 +55,7 @@
   bankAccount += 10;
   assert(pthread_rwlock_unlock(&rwlock1) == 0);
 
-  return ((void *) bankAccount);
+  return ((void *) (size_t) bankAccount);
 }
 
 void * rdfunc(void * arg)
@@ -67,17 +67,17 @@
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
 
-  if ((int) arg == 1)
+  if ((int) ((size_t) arg) == 1)
     {
       abstime.tv_sec += 1;
       assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == ETIMEDOUT);
       ba = 0;
     }
-  else if ((int) arg == 2)
+  else if ((int) ((size_t) arg) == 2)
     {
       abstime.tv_sec += 3;
       assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == 0);
@@ -85,7 +85,7 @@
       assert(pthread_rwlock_unlock(&rwlock1) == 0);
     }
 
-  return ((void *) ba);
+  return ((void *) (size_t) ba);
 }
 
 int
@@ -95,10 +95,10 @@
   pthread_t wrt2;
   pthread_t rdt1;
   pthread_t rdt2;
-  int wr1Result = 0;
-  int wr2Result = 0;
-  int rd1Result = 0;
-  int rd2Result = 0;
+  DWORD_PTR wr1Result = 0;
+  DWORD_PTR wr2Result = 0;
+  DWORD_PTR rd1Result = 0;
+  DWORD_PTR rd2Result = 0;
 
   bankAccount = 0;
 
diff -urN -xCVS pthreads.orig/tests/rwlock6_t2.c pthreads/tests/rwlock6_t2.c
--- pthreads.orig/tests/rwlock6_t2.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/rwlock6_t2.c	Sun Jun 20 19:58:34 2010
@@ -54,21 +54,21 @@
   int result;
 
   result = pthread_rwlock_timedwrlock(&rwlock1, &abstime);
-  if ((int) arg == 1)
+  if ((int) ((size_t)arg) == 1)
     {
       assert(result == 0);
       Sleep(2000);
       bankAccount += 10;
       assert(pthread_rwlock_unlock(&rwlock1) == 0);
-      return ((void *) bankAccount);
+      return ((void *) (size_t) bankAccount);
     }
-  else if ((int) arg == 2)
+  else if ((int) ((size_t)arg) == 2)
     {
       assert(result == ETIMEDOUT);
-      return ((void *) 100);
+      return ((void *) (size_t) 100);
     }
 
-  return ((void *) -1);
+  return ((void *) (size_t) -1);
 }
 
 void * rdfunc(void * arg)
@@ -77,7 +77,7 @@
 
   assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == ETIMEDOUT);
 
-  return ((void *) ba);
+  return ((void *) (size_t) ba);
 }
 
 int
@@ -86,15 +86,15 @@
   pthread_t wrt1;
   pthread_t wrt2;
   pthread_t rdt;
-  int wr1Result = 0;
-  int wr2Result = 0;
-  int rdResult = 0;
+  DWORD_PTR wr1Result = 0;
+  DWORD_PTR wr2Result = 0;
+  DWORD_PTR rdResult = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
diff -urN -xCVS pthreads.orig/tests/semaphore1.c pthreads/tests/semaphore1.c
--- pthreads.orig/tests/semaphore1.c	Mon May  9 01:52:52 2005
+++ pthreads/tests/semaphore1.c	Sun Jun 20 19:58:34 2010
@@ -119,7 +119,7 @@
 {
   pthread_t t;
   sem_t s;
-  int result;
+  DWORD_PTR result;
 
   assert(pthread_create(&t, NULL, thr, NULL) == 0);
   assert(pthread_join(t, (void **)&result) == 0);
diff -urN -xCVS pthreads.orig/tests/semaphore4.c pthreads/tests/semaphore4.c
--- pthreads.orig/tests/semaphore4.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/semaphore4.c	Sun Jun 20 19:58:34 2010
@@ -113,7 +113,7 @@
 //printf("value = %d\n", -value); fflush(stdout);
 	assert(pthread_cancel(t[50]) == 0);
 	  {
-	    int result;
+	    DWORD_PTR result;
 	    assert(pthread_join(t[50], (void **) &result) == 0);
 //	    printf("result = %d\n", result); fflush(stdout);
 	  }
diff -urN -xCVS pthreads.orig/tests/spin3.c pthreads/tests/spin3.c
--- pthreads.orig/tests/spin3.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/spin3.c	Sun Jun 20 19:58:34 2010
@@ -46,7 +46,7 @@
  
 void * unlocker(void * arg)
 {
-  int expectedResult = (int) arg;
+  int expectedResult = (int) (size_t) arg;
 
   wasHere++;
   assert(pthread_spin_unlock(&spin) == expectedResult);
diff -urN -xCVS pthreads.orig/tests/spin4.c pthreads/tests/spin4.c
--- pthreads.orig/tests/spin4.c	Sat Jan  1 23:36:19 2005
+++ pthreads/tests/spin4.c	Sun Jun 20 19:58:34 2010
@@ -63,7 +63,7 @@
 int
 main()
 {
-  long result = 0;
+  DWORD_PTR result = 0;
   pthread_t t;
   int CPUs;
   struct _timeb sysTime;
diff -urN -xCVS pthreads.orig/tests/stress1.c pthreads/tests/stress1.c
--- pthreads.orig/tests/stress1.c	Sun Jun 20 12:31:20 2010
+++ pthreads/tests/stress1.c	Sun Jun 20 19:58:34 2010
@@ -141,9 +141,9 @@
 void *
 masterThread (void * arg)
 {
-  int dither = (int) arg;
+  int dither = (int) (size_t)arg;
 
-  timeout = (int) arg;
+  timeout = (int) (size_t)arg;
 
   pthread_barrier_wait(&startBarrier);
 
@@ -239,7 +239,7 @@
   assert(pthread_barrier_init(&readyBarrier, NULL, 3) == 0);
   assert(pthread_barrier_init(&holdBarrier, NULL, 3) == 0);
 
-  assert(pthread_create(&master, NULL, masterThread, (void *) timeout) == 0);
+  assert(pthread_create(&master, NULL, masterThread, (void *) (size_t)timeout) == 0);
   assert(pthread_create(&slave, NULL, slaveThread, NULL) == 0);
 
   allExit = FALSE;
diff -urN -xCVS pthreads.orig/tests/tsd1.c pthreads/tests/tsd1.c
--- pthreads.orig/tests/tsd1.c	Mon May  9 01:52:52 2005
+++ pthreads/tests/tsd1.c	Sun Jun 20 19:58:34 2010
@@ -179,7 +179,7 @@
    */
   for (i = 1; i < NUM_THREADS; i++)
     {
-	int result = 0;
+	DWORD_PTR result = 0;
 
 	assert(pthread_join(thread[i], (void **) &result) == 0);
     }
diff -urN -xCVS pthreads.orig/tests/tsd2.c pthreads/tests/tsd2.c
--- pthreads.orig/tests/tsd2.c	Mon May  9 01:52:52 2005
+++ pthreads/tests/tsd2.c	Sun Jun 20 19:58:34 2010
@@ -183,7 +183,7 @@
    */
   for (i = 1; i < NUM_THREADS; i++)
     {
-	int result = 0;
+	DWORD_PTR result = 0;
 
 	assert(pthread_join(thread[i], (void **) &result) == 0);
     }
diff -urN -xCVS pthreads.orig/version.rc pthreads/version.rc
--- pthreads.orig/version.rc	Thu May 19 13:19:35 2005
+++ pthreads/version.rc	Sun Jun 20 19:58:34 2010
@@ -58,10 +58,10 @@
 #elif defined(__GNUC__)
 #  if defined(__CLEANUP_C)
 #    define PTW32_VERSIONINFO_NAME "pthreadGC\0"
-#    define PTW32_VERSIONINFO_COMMENT "GNU C build -- longjmp thread exiting\0"
+#    define PTW32_VERSIONINFO_COMMENT "GNU C build bit -- longjmp thread exiting\0"
 #  elif defined(__CLEANUP_CXX)
 #    define PTW32_VERSIONINFO_NAME "pthreadGCE\0"
-#    define PTW32_VERSIONINFO_COMMENT "GNU C++ build -- C++ exception thread exiting\0"
+#    define PTW32_VERSIONINFO_COMMENT "GNU C++ build bit -- C++ exception thread exiting\0"
 #  else
 #    error Resource compiler doesn't know which cleanup style you're using - see version.rc
 #  endif
@@ -102,7 +102,7 @@
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "FileDescription", "POSIX Threads for Windows32 Library\0"
+            VALUE "FileDescription", "POSIX Threads for Windows Library\0"
             VALUE "ProductVersion", PTW32_VERSION_STRING
             VALUE "FileVersion", PTW32_VERSION_STRING
             VALUE "InternalName", PTW32_VERSIONINFO_NAME
