OSDN Git Service

configure and patch pthreadw32 so it will build under mingw64
[handbrake-jp/handbrake-jp-git.git] / contrib / pthreadw32 / P00-mingw-w64.patch
1 # Bazaar merge directive format 2 (Bazaar 0.90)
2 # revision_id: dmitrij.ledkov@ubuntu.com-20100710232946-\
3 #   1vpsymidgi7alpwt
4 # target_branch: ../pthreads.bzr/
5 # testament_sha1: 521ee14bce6f871b77f9d6797b4460612a673359
6 # timestamp: 2010-07-11 02:10:15 +0100
7 # source_branch: .
8 # base_revision_id: git-v1:fe3f4b4cd92c4d6fc37139dd6cf8214c558676ca
9
10 # Begin patch
11 === modified file 'GNUmakefile'
12 --- pthreadw32/GNUmakefile      2010-06-20 03:31:18 +0000
13 +++ pthreadw32/GNUmakefile      2010-07-10 23:29:46 +0000
14 @@ -49,14 +49,27 @@
15  
16  # For cross compiling use e.g.
17  # make CROSS=i386-mingw32msvc- clean GC-inlined
18 -CROSS  = 
19 -
20 -AR     = $(CROSS)ar
21 -DLLTOOL = $(CROSS)dlltool
22 -CC      = $(CROSS)gcc
23 -CXX     = $(CROSS)g++
24 -RANLIB  = $(CROSS)ranlib
25 -RC     = $(CROSS)windres
26 +target  = 
27 +prefix = /usr/local
28 +
29 +ifeq (,$(findstring x86_64, $(target)))
30 +#32bit
31 +BITNESS=-m32
32 +DLLFLAG=-m i386
33 +WINDRESFLAG=pe-i386
34 +else
35 +#64bit
36 +BITNESS=-m64
37 +DLLFLAG=-m i386:x86-64
38 +WINDRESFLAG=pe-x86-64
39 +endif
40 +
41 +AR     = $(target)ar
42 +DLLTOOL = $(target)dlltool $(DLLFLAG)
43 +CC      = $(target)gcc $(BITNESS)
44 +CXX     = $(target)g++ $(BITNESS)
45 +RANLIB  = $(target)ranlib
46 +RC     = $(target)windres -F $(WINDRESFLAG)
47  
48  OPT    = $(CLEANUP) -O3 -finline-functions
49  DOPT   = $(CLEANUP) -g -O0
50 @@ -268,7 +281,7 @@
51                 version.o
52  
53  INCL   = \
54 -               config.h \
55 +               pthreads_win32_config.h \
56                 implement.h \
57                 semaphore.h \
58                 pthread.h \
59 @@ -585,3 +598,11 @@
60  sync.o:                sync.c $(SYNC_SRCS) $(INCL)
61  tsd.o:         tsd.c $(TSD_SRCS) $(INCL)
62  version.o:     version.rc $(INCL)
63 +
64 +install:
65 +       install -d $(prefix)/$(target)/bin
66 +       install -d $(prefix)/$(target)/lib
67 +       install -d $(prefix)/$(target)/include
68 +       install pthreadGC$(DLL_VER).dll $(prefix)/$(target)/bin/pthreadGC$(DLL_VER).dll
69 +       install pthreadGC$(DLL_VER).dll $(prefix)/$(target)/lib/libpthread.a
70 +       install pthreads_win32_config.h pthread.h sched.h semaphore.h $(prefix)/$(target)/include
71
72 === modified file 'context.h'
73 --- pthreadw32/context.h        2007-01-06 13:44:39 +0000
74 +++ pthreadw32/context.h        2010-07-10 23:05:44 +0000
75 @@ -39,7 +39,7 @@
76  
77  #undef PTW32_PROGCTR
78  
79 -#if defined(_M_IX86) || defined(_X86_)
80 +#if defined(_M_IX86) || (defined(_X86_) && !defined(__amd64__))
81  #define PTW32_PROGCTR(Context)  ((Context).Eip)
82  #endif
83  
84
85 === modified file 'pthread.h'
86 --- pthreadw32/pthread.h        2010-06-20 03:31:18 +0000
87 +++ pthreadw32/pthread.h        2010-07-10 23:29:46 +0000
88 @@ -112,7 +112,7 @@
89  #ifdef _UWIN
90  #   define HAVE_STRUCT_TIMESPEC 1
91  #   define HAVE_SIGNAL_H        1
92 -#   undef HAVE_CONFIG_H
93 +#   undef 1
94  #   pragma comment(lib, "pthread")
95  #endif
96  
97 @@ -210,9 +210,17 @@
98   * -----------------
99   */
100  
101 -#if HAVE_CONFIG_H
102 -#include "config.h"
103 -#endif /* HAVE_CONFIG_H */
104 +#if 1
105 +#include "pthreads_win32_config.h"
106 +#endif /* 1 */
107 +
108 +#ifdef __MINGW32__
109 +# include <_mingw.h>
110 +# ifdef __MINGW64_VERSION_MAJOR
111 +  /* MinGW-w64 already has it: */
112 +#   define HAVE_STRUCT_TIMESPEC 1
113 +# endif
114 +#endif
115  
116  #ifndef NEED_FTIME
117  #include <time.h>
118 @@ -236,7 +244,7 @@
119  };
120  
121  /*
122 - * This is a duplicate of what is in the autoconf config.h,
123 + * This is a duplicate of what is in the autoconf pthreads_win32_config.h,
124   * which is only used when building the pthread-win32 libraries.
125   */
126  
127
128 --- pthreadsw32/pthread_win32_attach_detach_np.c        2010-09-11 13:08:31.120188567 -0700
129 +++ xxx/pthread_win32_attach_detach_np.c        2010-09-11 13:08:40.209188369 -0700
130 @@ -97,6 +97,10 @@
131   * InterlockedCompareExchange routine in WIN64 is an intrinsic function.
132   * See PTW32_INTERLOCKED_COMPARE_EXCHANGE implement.h
133   */
134 +  ptw32_interlocked_compare_exchange = 
135 +    (PTW32_INTERLOCKED_LONG (WINAPI *)
136 +     (PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG,
137 +      PTW32_INTERLOCKED_LONG)) InterlockedCompareExchange;
138  
139  #else
140  
141 === modified file 'pthread_cancel.c'
142 --- pthreadw32/pthread_cancel.c 2010-06-20 03:31:18 +0000
143 +++ pthreadw32/pthread_cancel.c 2010-07-10 23:29:46 +0000
144 @@ -47,7 +47,7 @@
145  }
146  
147  static void CALLBACK
148 -ptw32_cancel_callback (DWORD unused)
149 +ptw32_cancel_callback (ULONG_PTR unused)
150  {
151    ptw32_throw (PTW32_EPS_CANCEL);
152  
153 @@ -157,7 +157,7 @@
154                * this will result in a call to ptw32_RegisterCancelation and only
155                * the threadH arg will be used.
156                */
157 -             ptw32_register_cancelation (ptw32_cancel_callback, threadH, 0);
158 +             ptw32_register_cancelation ((PAPCFUNC)ptw32_cancel_callback, threadH, 0);
159               (void) pthread_mutex_unlock (&tp->cancelLock);
160               ResumeThread (threadH);
161             }
162
163 === modified file 'pthread_exit.c'
164 --- pthreadw32/pthread_exit.c   2007-05-15 13:46:42 +0000
165 +++ pthreadw32/pthread_exit.c   2010-07-10 23:05:44 +0000
166 @@ -89,7 +89,7 @@
167         */
168  
169  #if ! defined (__MINGW32__) || defined (__MSVCRT__)  || defined (__DMC__)
170 -      _endthreadex ((unsigned) value_ptr);
171 +      _endthreadex ((unsigned) (size_t) value_ptr);
172  #else
173        _endthread ();
174  #endif
175
176 === modified file 'pthread_spin_destroy.c'
177 --- pthreadw32/pthread_spin_destroy.c   2005-01-01 14:36:17 +0000
178 +++ pthreadw32/pthread_spin_destroy.c   2010-07-10 23:05:44 +0000
179 @@ -59,9 +59,9 @@
180                PTW32_INTERLOCKED_COMPARE_EXCHANGE ((PTW32_INTERLOCKED_LPLONG)
181                                                    & (s->interlock),
182                                                    (PTW32_INTERLOCKED_LONG)
183 -                                                  PTW32_OBJECT_INVALID,
184 +                                                  (size_t)PTW32_OBJECT_INVALID,
185                                                    (PTW32_INTERLOCKED_LONG)
186 -                                                  PTW32_SPIN_UNLOCKED))
187 +                                                  (size_t)PTW32_SPIN_UNLOCKED))
188         {
189           result = EINVAL;
190         }
191
192 === modified file 'pthread_timechange_handler_np.c'
193 --- pthreadw32/pthread_timechange_handler_np.c  2005-01-01 14:36:17 +0000
194 +++ pthreadw32/pthread_timechange_handler_np.c  2010-07-10 23:05:44 +0000
195 @@ -103,5 +103,5 @@
196  
197    LeaveCriticalSection (&ptw32_cond_list_lock);
198  
199 -  return (void *) (result != 0 ? EAGAIN : 0);
200 +  return (void *) (size_t) (result != 0 ? EAGAIN : 0);
201  }
202
203 === renamed file 'config.h' => 'pthreads_win32_config.h'
204 === modified file 'ptw32_MCS_lock.c'
205 --- pthreadw32/ptw32_MCS_lock.c 2010-06-20 03:31:18 +0000
206 +++ pthreadw32/ptw32_MCS_lock.c 2010-07-10 23:29:46 +0000
207 @@ -101,10 +101,10 @@
208  INLINE void 
209  ptw32_mcs_flag_set (LONG * flag)
210  {
211 -  HANDLE e = (HANDLE)PTW32_INTERLOCKED_COMPARE_EXCHANGE(
212 +  HANDLE e = (HANDLE)(size_t) PTW32_INTERLOCKED_COMPARE_EXCHANGE(
213                                                 (PTW32_INTERLOCKED_LPLONG)flag,
214 -                                               (PTW32_INTERLOCKED_LONG)-1,
215 -                                               (PTW32_INTERLOCKED_LONG)0);
216 +                                               (PTW32_INTERLOCKED_LONG)(size_t)-1,
217 +                                               (PTW32_INTERLOCKED_LONG)(size_t)0);
218    if ((HANDLE)0 != e)
219      {
220        /* another thread has already stored an event handle in the flag */
221 @@ -129,8 +129,8 @@
222  
223        if (0 == PTW32_INTERLOCKED_COMPARE_EXCHANGE(
224                                           (PTW32_INTERLOCKED_LPLONG)flag,
225 -                                         (PTW32_INTERLOCKED_LONG)e,
226 -                                         (PTW32_INTERLOCKED_LONG)0))
227 +                                         (PTW32_INTERLOCKED_LONG)(size_t)e,
228 +                                         (PTW32_INTERLOCKED_LONG)(size_t)0))
229         {
230           /* stored handle in the flag. wait on it now. */
231           WaitForSingleObject(e, INFINITE);
232 @@ -159,8 +159,8 @@
233    node->next = 0; /* initially, no successor */
234    
235    /* queue for the lock */
236 -  pred = (ptw32_mcs_local_node_t *)PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_LPLONG)lock,
237 -                                                             (PTW32_INTERLOCKED_LONG)node);
238 +  pred = (ptw32_mcs_local_node_t *)InterlockedExchangePointer((PVOID volatile *)lock,
239 +                                                             (void*)node);
240  
241    if (0 != pred)
242      {
243 @@ -184,17 +184,19 @@
244  {
245    ptw32_mcs_lock_t *lock = node->lock;
246    ptw32_mcs_local_node_t *next = (ptw32_mcs_local_node_t *)
247 -    InterlockedExchangeAdd((LPLONG)&node->next,
248 -                           (LONG)0); /* MBR fence */
249 -
250 +#ifndef _WIN64
251 +    InterlockedExchangeAdd((LPLONG)&node->next, 0); /* MBR fence */
252 +#else
253 +    InterlockedExchangeAdd64((LONG64 *)&node->next, 0); /* MBR fence */
254 +#endif
255    if (0 == next)
256      {
257        /* no known successor */
258  
259        if (node == (ptw32_mcs_local_node_t *)
260 -         PTW32_INTERLOCKED_COMPARE_EXCHANGE((PTW32_INTERLOCKED_LPLONG)lock,
261 -                                            (PTW32_INTERLOCKED_LONG)0,
262 -                                            (PTW32_INTERLOCKED_LONG)node))
263 +         InterlockedCompareExchangePointer((LPVOID volatile *)lock,
264 +                                            (PVOID)0,
265 +                                            (PVOID)node))
266         {
267           /* no successor, lock is free now */
268           return;
269 @@ -203,7 +205,11 @@
270        /* wait for successor */
271        ptw32_mcs_flag_wait(&node->nextFlag);
272        next = (ptw32_mcs_local_node_t *)
273 +#ifndef _WIN64
274         InterlockedExchangeAdd((LPLONG)&node->next, 0); /* MBR fence */
275 +#else
276 +       InterlockedExchangeAdd64((LONG64 *)&node->next, 0); /* MBR fence */
277 +#endif
278      }
279  
280    /* pass the lock */
281
282 === modified file 'ptw32_threadStart.c'
283 --- pthreadw32/ptw32_threadStart.c      2005-05-15 15:28:24 +0000
284 +++ pthreadw32/ptw32_threadStart.c      2010-07-10 23:05:44 +0000
285 @@ -344,7 +344,7 @@
286  #endif
287  
288  #if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
289 -  _endthreadex ((unsigned) status);
290 +  _endthreadex ((unsigned) (size_t) status);
291  #else
292    _endthread ();
293  #endif
294 @@ -354,7 +354,7 @@
295     */
296  
297  #if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
298 -  return (unsigned) status;
299 +  return (unsigned) (size_t) status;
300  #endif
301  
302  }                              /* ptw32_threadStart */
303
304 === modified file 'ptw32_throw.c'
305 --- pthreadw32/ptw32_throw.c    2008-06-06 00:23:20 +0000
306 +++ pthreadw32/ptw32_throw.c    2010-07-10 23:05:44 +0000
307 @@ -79,12 +79,12 @@
308        switch (exception)
309         {
310         case PTW32_EPS_CANCEL:
311 -         exitCode = (unsigned) PTHREAD_CANCELED;
312 +         exitCode = (unsigned) (size_t) PTHREAD_CANCELED;
313           break;
314         case PTW32_EPS_EXIT:
315           if (NULL != sp)
316             {
317 -             exitCode = (unsigned) sp->exitStatus;
318 +             exitCode = (unsigned) (size_t) sp->exitStatus;
319             }
320           break;
321         }
322 @@ -166,7 +166,7 @@
323  
324  #else
325  
326 -  return (DWORD) NULL;
327 +  return (DWORD) (size_t) NULL;
328  
329  #endif
330  }
331
332 === modified file 'tests/GNUmakefile'
333 --- pthreadw32/tests/GNUmakefile        2010-06-20 04:26:26 +0000
334 +++ pthreadw32/tests/GNUmakefile        2010-07-10 23:29:46 +0000
335 @@ -33,6 +33,11 @@
336  
337  DLL_VER        = 2
338  
339 +# For cross compiling use, e.g. CROSS=x86_64-w64-mingw32msvc-
340 +# Although testing is supposed to be done on windows, this may still be
341 +# needed, because one may as well use an x86-hosted toolchain on an x64.
342 +CROSS  = 
343 +
344  CP     = cp -f
345  MV     = mv -f
346  RM     = rm -f
347 @@ -167,34 +172,34 @@
348         @ $(MAKE) clean GCE
349  
350  GC:
351 -       $(MAKE) TEST=GC CC=gcc XXCFLAGS="-fopenmp -D__CLEANUP_C" all-pass
352 +       $(MAKE) TEST=GC CC=$(CROSS)gcc XXCFLAGS="-fopenmp -D__CLEANUP_C" all-pass
353  
354  GCE:
355 -       $(MAKE) TEST=GCE CC=g++ XXCFLAGS="-fopenmp -mthreads -D__CLEANUP_CXX" all-pass
356 +       $(MAKE) TEST=GCE CC=$(CROSS)g++ XXCFLAGS="-fopenmp -mthreads -D__CLEANUP_CXX" all-pass
357  
358  GCX:
359 -       $(MAKE) TEST=GC CC=g++ XXCFLAGS="-fopenmp -mthreads -D__CLEANUP_C" all-pass
360 +       $(MAKE) TEST=GC CC=$(CROSS)g++ XXCFLAGS="-fopenmp -mthreads -D__CLEANUP_C" all-pass
361  
362  GC-bench:
363 -       $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C" XXLIBS="benchlib.o" all-bench
364 +       $(MAKE) TEST=GC CC=$(CROSS)gcc XXCFLAGS="-D__CLEANUP_C" XXLIBS="benchlib.o" all-bench
365  
366  GCE-bench:
367 -       $(MAKE) TEST=GCE  CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" XXLIBS="benchlib." all-bench
368 +       $(MAKE) TEST=GCE  CC=$(CROSS)g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" XXLIBS="benchlib." all-bench
369  
370  GC-debug:
371 -       $(MAKE) TEST=GC CC=gcc XXCFLAGS="-fopenmp -D__CLEANUP_C" DLL_VER="$(DLL_VER)d" all-pass
372 +       $(MAKE) TEST=GC CC=$(CROSS)gcc XXCFLAGS="-fopenmp -D__CLEANUP_C" DLL_VER="$(DLL_VER)d" all-pass
373  
374  GC-static:
375 -       $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C -DPTW32_STATIC_LIB" XXLIBS="-lws2_32" DLL="" all-static
376 +       $(MAKE) TEST=GC CC=$(CROSS)gcc XXCFLAGS="-D__CLEANUP_C -DPTW32_STATIC_LIB" XXLIBS="-lws2_32" DLL="" all-static
377  
378  GC-stress:
379         $(ECHO) Stress tests can take a long time since they are trying to
380         $(ECHO) expose weaknesses that may be intermittant or statistically rare.
381         $(ECHO) A pass does not prove correctness, but may give greater confidence.
382 -       $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C" XXLIBS="" all-stress
383 +       $(MAKE) TEST=GC CC=$(CROSS)gcc XXCFLAGS="-D__CLEANUP_C" XXLIBS="" all-stress
384  
385  GCE-stress:
386 -       $(MAKE) TEST=GCE  CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" XXLIBS="" all-stress
387 +       $(MAKE) TEST=GCE  CC=$(CROSS)g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" XXLIBS="" all-stress
388  
389  all-pass: $(PASSES)
390         @ $(ECHO) ALL TESTS PASSED! Congratulations!
391
392 === modified file 'tests/barrier3.c'
393 --- pthreadw32/tests/barrier3.c 2005-01-01 14:36:17 +0000
394 +++ pthreadw32/tests/barrier3.c 2010-07-10 23:05:44 +0000
395 @@ -41,7 +41,7 @@
396  #include "test.h"
397   
398  pthread_barrier_t barrier = NULL;
399 -static int result = 1;
400 +static DWORD_PTR result = 1;
401  
402  void * func(void * arg)
403  {
404
405 === modified file 'tests/barrier5.c'
406 --- pthreadw32/tests/barrier5.c 2010-06-20 03:31:18 +0000
407 +++ pthreadw32/tests/barrier5.c 2010-07-10 23:29:46 +0000
408 @@ -79,7 +79,7 @@
409  main()
410  {
411    int i, j;
412 -  int result;
413 +  DWORD_PTR result;
414    int serialThreadsTotal;
415    LONG Crossings;
416    pthread_t t[NUMTHREADS + 1];
417 @@ -104,7 +104,7 @@
418        for (i = 1; i <= j; i++)
419          {
420            assert(pthread_join(t[i], (void **) &result) == 0);
421 -          serialThreadsTotal += result;
422 +          serialThreadsTotal += (int)result;
423          }
424  
425        assert(serialThreadsTotal == BARRIERMULTIPLE);
426
427 === modified file 'tests/cancel2.c'
428 --- pthreadw32/tests/cancel2.c  2005-01-01 14:36:17 +0000
429 +++ pthreadw32/tests/cancel2.c  2010-07-10 23:05:44 +0000
430 @@ -217,7 +217,7 @@
431    for (i = 1; i <= NUMTHREADS; i++)
432      {
433        int fail = 0;
434 -      int result = 0;
435 +      DWORD_PTR result = 0;
436  
437        assert(pthread_join(t[i], (void **) &result) == 0);
438        fail = (result != (int) PTHREAD_CANCELED);
439
440 === modified file 'tests/cancel3.c'
441 --- pthreadw32/tests/cancel3.c  2010-06-22 01:19:08 +0000
442 +++ pthreadw32/tests/cancel3.c  2010-07-10 23:29:46 +0000
443 @@ -173,7 +173,7 @@
444    for (i = 1; i <= NUMTHREADS; i++)
445      {
446        int fail = 0;
447 -      int result = 0;
448 +      DWORD_PTR result = 0;
449  
450        /*
451         * The thread does not contain any cancelation points, so
452
453 === modified file 'tests/cancel4.c'
454 --- pthreadw32/tests/cancel4.c  2005-05-06 07:31:28 +0000
455 +++ pthreadw32/tests/cancel4.c  2010-07-10 23:05:44 +0000
456 @@ -98,7 +98,7 @@
457  void *
458  mythread(void * arg)
459  {
460 -  int result = ((int)PTHREAD_CANCELED + 1);
461 +  int result = ((int)(size_t)PTHREAD_CANCELED + 1);
462    bag_t * bag = (bag_t *) arg;
463  
464    assert(bag == &threadbag[bag->threadnum]);
465 @@ -118,7 +118,7 @@
466    for (bag->count = 0; bag->count < 20; bag->count++)
467      Sleep(100);
468  
469 -  return (void *) result;
470 +  return (void *) (size_t)result;
471  }
472  
473  int
474 @@ -173,7 +173,7 @@
475    for (i = 1; i <= NUMTHREADS; i++)
476      {
477        int fail = 0;
478 -      int result = 0;
479 +      DWORD_PTR result = 0;
480  
481        /*
482         * The thread does not contain any cancelation points, so
483 @@ -182,7 +182,7 @@
484         */
485        assert(pthread_join(t[i], (void **) &result) == 0);
486  
487 -      fail = (result == (int) PTHREAD_CANCELED);
488 +      fail = (result == (int) (size_t) PTHREAD_CANCELED);
489  
490        if (fail)
491         {
492
493 === modified file 'tests/cancel5.c'
494 --- pthreadw32/tests/cancel5.c  2005-01-01 14:36:17 +0000
495 +++ pthreadw32/tests/cancel5.c  2010-07-10 23:05:44 +0000
496 @@ -171,7 +171,7 @@
497    for (i = 1; i <= NUMTHREADS; i++)
498      {
499        int fail = 0;
500 -      int result = 0;
501 +      DWORD_PTR result = 0;
502  
503        /*
504         * The thread does not contain any cancelation points, so
505
506 === modified file 'tests/cancel6a.c'
507 --- pthreadw32/tests/cancel6a.c 2004-11-03 01:08:41 +0000
508 +++ pthreadw32/tests/cancel6a.c 2010-07-10 23:05:44 +0000
509 @@ -85,7 +85,7 @@
510  void *
511  mythread(void * arg)
512  {
513 -  int result = ((int)PTHREAD_CANCELED + 1);
514 +  int result = ((int)(size_t)PTHREAD_CANCELED + 1);
515    bag_t * bag = (bag_t *) arg;
516  
517    assert(bag == &threadbag[bag->threadnum]);
518 @@ -105,7 +105,7 @@
519    for (bag->count = 0; bag->count < 100; bag->count++)
520      Sleep(100);
521  
522 -  return (void *) result;
523 +  return (void *) (size_t)result;
524  }
525  
526  int
527 @@ -161,7 +161,7 @@
528    for (i = 1; i <= NUMTHREADS; i++)
529      {
530        int fail = 0;
531 -      int result = 0;
532 +      DWORD_PTR result = 0;
533  
534        /*
535         * The thread does not contain any cancelation points, so
536 @@ -170,7 +170,7 @@
537         */
538        assert(pthread_join(t[i], (void **) &result) == 0);
539  
540 -      fail = (result != (int) PTHREAD_CANCELED);
541 +      fail = (result != (int) (size_t) PTHREAD_CANCELED);
542  
543        if (fail)
544         {
545
546 === modified file 'tests/cancel6d.c'
547 --- pthreadw32/tests/cancel6d.c 2004-11-03 01:08:41 +0000
548 +++ pthreadw32/tests/cancel6d.c 2010-07-10 23:05:44 +0000
549 @@ -86,7 +86,7 @@
550  void *
551  mythread(void * arg)
552  {
553 -  int result = ((int)PTHREAD_CANCELED + 1);
554 +  int result = ((int) (size_t) PTHREAD_CANCELED + 1);
555    bag_t * bag = (bag_t *) arg;
556  
557    assert(bag == &threadbag[bag->threadnum]);
558 @@ -109,7 +109,7 @@
559        pthread_testcancel();
560      }
561  
562 -  return (void *) result;
563 +  return (void *) (size_t) result;
564  }
565  
566  int
567 @@ -165,11 +165,11 @@
568    for (i = 1; i <= NUMTHREADS; i++)
569      {
570        int fail = 0;
571 -      int result = 0;
572 +      DWORD_PTR result = 0;
573  
574        assert(pthread_join(t[i], (void **) &result) == 0);
575  
576 -      fail = (result != (int) PTHREAD_CANCELED);
577 +      fail = (result != (int) (size_t) PTHREAD_CANCELED);
578  
579        if (fail)
580         {
581
582 === modified file 'tests/cancel8.c'
583 --- pthreadw32/tests/cancel8.c  2005-01-01 14:36:17 +0000
584 +++ pthreadw32/tests/cancel8.c  2010-07-10 23:05:44 +0000
585 @@ -195,7 +195,7 @@
586        assert(threadbag[i].self.p != NULL);
587        assert(pthread_kill(threadbag[i].self, 0) == ESRCH);
588  
589 -      fail = (result != (int) PTHREAD_CANCELED);
590 +      fail = (result != (int) (size_t) PTHREAD_CANCELED);
591  
592        if (fail)
593         {
594
595 === modified file 'tests/cleanup0.c'
596 --- pthreadw32/tests/cleanup0.c 2005-04-06 02:16:29 +0000
597 +++ pthreadw32/tests/cleanup0.c 2010-07-10 23:05:44 +0000
598 @@ -189,7 +189,7 @@
599    for (i = 1; i <= NUMTHREADS; i++)
600      {
601        int fail = 0;
602 -      int result = 0;
603 +      DWORD_PTR result = 0;
604  
605        assert(pthread_join(t[i], (void **) &result) == 0);
606  
607
608 === modified file 'tests/cleanup1.c'
609 --- pthreadw32/tests/cleanup1.c 2005-04-06 02:16:29 +0000
610 +++ pthreadw32/tests/cleanup1.c 2010-07-10 23:05:44 +0000
611 @@ -203,7 +203,7 @@
612    for (i = 1; i <= NUMTHREADS; i++)
613      {
614        int fail = 0;
615 -      int result = 0;
616 +      DWORD_PTR result = 0;
617  
618        assert(pthread_join(t[i], (void **) &result) == 0);
619  
620
621 === modified file 'tests/cleanup2.c'
622 --- pthreadw32/tests/cleanup2.c 2005-04-06 02:16:29 +0000
623 +++ pthreadw32/tests/cleanup2.c 2010-07-10 23:05:44 +0000
624 @@ -178,7 +178,7 @@
625    for (i = 1; i <= NUMTHREADS; i++)
626      {
627        int fail = 0;
628 -      int result = 0;
629 +      DWORD_PTR result = 0;
630  
631        assert(pthread_join(t[i], (void **) &result) == 0);
632  
633
634 === modified file 'tests/cleanup3.c'
635 --- pthreadw32/tests/cleanup3.c 2005-04-06 02:16:29 +0000
636 +++ pthreadw32/tests/cleanup3.c 2010-07-10 23:05:44 +0000
637 @@ -183,7 +183,7 @@
638    for (i = 1; i <= NUMTHREADS; i++)
639      {
640        int fail = 0;
641 -      int result = 0;
642 +      DWORD_PTR result = 0;
643  
644        assert(pthread_join(t[i], (void **) &result) == 0);
645  
646
647 === modified file 'tests/condvar1_2.c'
648 --- pthreadw32/tests/condvar1_2.c       2005-01-01 14:36:17 +0000
649 +++ pthreadw32/tests/condvar1_2.c       2010-07-10 23:05:44 +0000
650 @@ -89,7 +89,7 @@
651  main()
652  {
653    int i, j, k;
654 -  int result = -1;
655 +  DWORD_PTR result = -1;
656    pthread_t t;
657  
658    for (k = 0; k < NUM_LOOPS; k++)
659
660 === modified file 'tests/condvar2.c'
661 --- pthreadw32/tests/condvar2.c 2005-05-06 07:31:28 +0000
662 +++ pthreadw32/tests/condvar2.c 2010-07-10 23:05:44 +0000
663 @@ -99,7 +99,7 @@
664    /* get current system time */
665    _ftime(&currSysTime);
666  
667 -  abstime.tv_sec = currSysTime.time;
668 +  abstime.tv_sec = (long)currSysTime.time;
669    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
670  
671    abstime.tv_sec += 1;
672 @@ -109,7 +109,7 @@
673    assert(pthread_mutex_unlock(&mutex) == 0);
674  
675    {
676 -  int result = pthread_cond_destroy(&cv);
677 +  DWORD_PTR result = pthread_cond_destroy(&cv);
678    if (result != 0)
679      {
680        fprintf(stderr, "Result = %s\n", error_string[result]);
681
682 === modified file 'tests/condvar2_1.c'
683 --- pthreadw32/tests/condvar2_1.c       2005-01-01 14:36:17 +0000
684 +++ pthreadw32/tests/condvar2_1.c       2010-07-10 23:05:44 +0000
685 @@ -105,7 +105,7 @@
686  {
687    int i;
688    pthread_t t[NUMTHREADS + 1];
689 -  int result = 0;
690 +  DWORD_PTR result = 0;
691    struct _timeb currSysTime;
692    const DWORD NANOSEC_PER_MILLISEC = 1000000;
693  
694 @@ -116,7 +116,7 @@
695    /* get current system time */
696    _ftime(&currSysTime);
697  
698 -  abstime.tv_sec = currSysTime.time;
699 +  abstime.tv_sec = (long)currSysTime.time;
700    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
701  
702    abstime.tv_sec += 5;
703
704 === modified file 'tests/condvar3.c'
705 --- pthreadw32/tests/condvar3.c 2005-04-25 14:42:37 +0000
706 +++ pthreadw32/tests/condvar3.c 2010-07-10 23:05:44 +0000
707 @@ -126,7 +126,7 @@
708    /* get current system time */
709    _ftime(&currSysTime);
710  
711 -  abstime.tv_sec = currSysTime.time;
712 +  abstime.tv_sec = (long)currSysTime.time;
713    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
714  
715    assert(pthread_create(&t[1], NULL, mythread, (void *) 1) == 0);
716
717 === modified file 'tests/condvar3_1.c'
718 --- pthreadw32/tests/condvar3_1.c       2005-04-25 14:42:37 +0000
719 +++ pthreadw32/tests/condvar3_1.c       2010-07-10 23:05:44 +0000
720 @@ -126,7 +126,7 @@
721  {
722    int i;
723    pthread_t t[NUMTHREADS + 1];
724 -  int result = 0;
725 +  DWORD_PTR result = 0;
726    struct _timeb currSysTime;
727    const DWORD NANOSEC_PER_MILLISEC = 1000000;
728  
729 @@ -139,7 +139,7 @@
730    /* get current system time */
731    _ftime(&currSysTime);
732  
733 -  abstime.tv_sec = currSysTime.time;
734 +  abstime.tv_sec = (long)currSysTime.time;
735    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
736  
737    abstime.tv_sec += 5;
738
739 === modified file 'tests/condvar3_2.c'
740 --- pthreadw32/tests/condvar3_2.c       2005-04-25 14:42:37 +0000
741 +++ pthreadw32/tests/condvar3_2.c       2010-07-10 23:05:44 +0000
742 @@ -127,7 +127,7 @@
743  {
744    int i;
745    pthread_t t[NUMTHREADS + 1];
746 -  int result = 0;
747 +  DWORD_PTR result = 0;
748    struct _timeb currSysTime;
749    const DWORD NANOSEC_PER_MILLISEC = 1000000;
750  
751 @@ -138,7 +138,7 @@
752    /* get current system time */
753    _ftime(&currSysTime);
754  
755 -  abstime.tv_sec = abstime.tv_sec = currSysTime.time + 5;
756 +  abstime.tv_sec = abstime.tv_sec = (long)currSysTime.time + 5;
757    abstime.tv_nsec = abstime2.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
758  
759    assert(pthread_mutex_lock(&mutex) == 0);
760
761 === modified file 'tests/condvar3_3.c'
762 --- pthreadw32/tests/condvar3_3.c       2005-04-25 14:42:37 +0000
763 +++ pthreadw32/tests/condvar3_3.c       2010-07-10 23:05:44 +0000
764 @@ -96,7 +96,7 @@
765     /* get current system time */
766     _ftime(&currSysTime);
767  
768 -   abstime.tv_sec = currSysTime.time;
769 +   abstime.tv_sec = (long)currSysTime.time;
770     abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
771     abstime.tv_sec += 1;
772  
773 @@ -120,7 +120,7 @@
774  
775     assert(pthread_mutex_lock(&mtx) == 0);
776  
777 -   abstime.tv_sec = currSysTime.time;
778 +   abstime.tv_sec = (long)currSysTime.time;
779     abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
780     abstime.tv_sec += 1;
781  
782
783 === modified file 'tests/condvar4.c'
784 --- pthreadw32/tests/condvar4.c 2005-04-25 14:42:37 +0000
785 +++ pthreadw32/tests/condvar4.c 2010-07-10 23:05:44 +0000
786 @@ -130,7 +130,7 @@
787    /* get current system time */
788    _ftime(&currSysTime);
789  
790 -  abstime.tv_sec = currSysTime.time;
791 +  abstime.tv_sec = (long)currSysTime.time;
792    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
793  
794    abstime.tv_sec += 5;
795 @@ -143,7 +143,7 @@
796  
797    _ftime(&currSysTime);
798  
799 -  abstime.tv_sec = currSysTime.time;
800 +  abstime.tv_sec = (long)currSysTime.time;
801    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
802  
803    abstime.tv_sec += 5;
804
805 === modified file 'tests/condvar5.c'
806 --- pthreadw32/tests/condvar5.c 2005-04-25 14:42:37 +0000
807 +++ pthreadw32/tests/condvar5.c 2010-07-10 23:05:44 +0000
808 @@ -129,7 +129,7 @@
809    /* get current system time */
810    _ftime(&currSysTime);
811  
812 -  abstime.tv_sec = currSysTime.time;
813 +  abstime.tv_sec = (long)currSysTime.time;
814    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
815  
816    abstime.tv_sec += 5;
817 @@ -142,7 +142,7 @@
818  
819    _ftime(&currSysTime);
820  
821 -  abstime.tv_sec = currSysTime.time;
822 +  abstime.tv_sec = (long)currSysTime.time;
823    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
824  
825    abstime.tv_sec += 5;
826
827 === modified file 'tests/condvar6.c'
828 --- pthreadw32/tests/condvar6.c 2005-04-25 14:42:37 +0000
829 +++ pthreadw32/tests/condvar6.c 2010-07-10 23:05:44 +0000
830 @@ -159,7 +159,7 @@
831  
832    _ftime(&currSysTime);
833  
834 -  abstime.tv_sec = currSysTime.time;
835 +  abstime.tv_sec = (long)currSysTime.time;
836    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
837  
838    abstime.tv_sec += 5;
839
840 === modified file 'tests/condvar7.c'
841 --- pthreadw32/tests/condvar7.c 2005-04-25 14:42:37 +0000
842 +++ pthreadw32/tests/condvar7.c 2010-07-10 23:05:44 +0000
843 @@ -169,7 +169,7 @@
844  
845    _ftime(&currSysTime);
846  
847 -  abstime.tv_sec = currSysTime.time;
848 +  abstime.tv_sec = (long)currSysTime.time;
849    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
850  
851    abstime.tv_sec += 10;
852
853 === modified file 'tests/condvar8.c'
854 --- pthreadw32/tests/condvar8.c 2005-04-25 14:42:37 +0000
855 +++ pthreadw32/tests/condvar8.c 2010-07-10 23:05:44 +0000
856 @@ -166,7 +166,7 @@
857  
858    _ftime(&currSysTime);
859  
860 -  abstime.tv_sec = currSysTime.time;
861 +  abstime.tv_sec = (long)currSysTime.time;
862    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
863  
864    abstime.tv_sec += 10;
865
866 === modified file 'tests/condvar9.c'
867 --- pthreadw32/tests/condvar9.c 2005-04-25 14:42:37 +0000
868 +++ pthreadw32/tests/condvar9.c 2010-07-10 23:05:44 +0000
869 @@ -174,7 +174,7 @@
870  
871    _ftime(&currSysTime);
872  
873 -  abstime.tv_sec = currSysTime.time;
874 +  abstime.tv_sec = (long)currSysTime.time;
875    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
876  
877    abstime.tv_sec += 5;
878
879 === modified file 'tests/delay2.c'
880 --- pthreadw32/tests/delay2.c   2005-01-01 14:36:17 +0000
881 +++ pthreadw32/tests/delay2.c   2010-07-10 23:05:44 +0000
882 @@ -65,7 +65,7 @@
883  main(int argc, char * argv[])
884  {
885    pthread_t t;
886 -  int result = 0;
887 +  DWORD_PTR result = 0;
888  
889    assert(pthread_mutex_lock(&mx) == 0);
890  
891
892 === modified file 'tests/exception1.c'
893 --- pthreadw32/tests/exception1.c       2005-01-01 14:36:17 +0000
894 +++ pthreadw32/tests/exception1.c       2010-07-10 23:05:44 +0000
895 @@ -226,7 +226,7 @@
896    for (i = 0; i < NUMTHREADS; i++)
897      {
898        int fail = 0;
899 -      int result = 0;
900 +      DWORD_PTR result = 0;
901  
902         /* Canceled thread */
903        assert(pthread_join(ct[i], (void **) &result) == 0);
904
905 === modified file 'tests/inherit1.c'
906 --- pthreadw32/tests/inherit1.c 2005-01-01 14:36:17 +0000
907 +++ pthreadw32/tests/inherit1.c 2010-07-10 23:05:44 +0000
908 @@ -89,7 +89,7 @@
909    struct sched_param param;
910  
911    assert(pthread_getschedparam(pthread_self(), &policy, &param) == 0);
912 -  return (void *) param.sched_priority;
913 +  return (void *) (size_t) param.sched_priority;
914  }
915  
916  
917 @@ -169,7 +169,7 @@
918            assert(pthread_attr_setschedparam(&attr, &param) == 0);
919            assert(pthread_create(&t, &attr, func, NULL) == 0);
920            pthread_join(t, &result);
921 -          assert((int) result == mainParam.sched_priority);
922 +          assert((int) (size_t)result == mainParam.sched_priority);
923          }
924      }
925  
926
927 === modified file 'tests/join0.c'
928 --- pthreadw32/tests/join0.c    2005-05-15 15:28:24 +0000
929 +++ pthreadw32/tests/join0.c    2010-07-10 23:05:44 +0000
930 @@ -53,7 +53,7 @@
931  main(int argc, char * argv[])
932  {
933    pthread_t id;
934 -  int result;
935 +  DWORD_PTR result;
936  
937    /* Create a single thread and wait for it to exit. */
938    assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
939
940 === modified file 'tests/join1.c'
941 --- pthreadw32/tests/join1.c    2005-05-15 15:28:24 +0000
942 +++ pthreadw32/tests/join1.c    2010-07-10 23:05:44 +0000
943 @@ -56,7 +56,7 @@
944  {
945         pthread_t id[4];
946         int i;
947 -       int result;
948 +       DWORD_PTR result;
949  
950         /* Create a few threads and then exit. */
951         for (i = 0; i < 4; i++)
952
953 === modified file 'tests/join2.c'
954 --- pthreadw32/tests/join2.c    2005-05-15 15:28:24 +0000
955 +++ pthreadw32/tests/join2.c    2010-07-10 23:05:44 +0000
956 @@ -50,7 +50,7 @@
957  {
958         pthread_t id[4];
959         int i;
960 -       int result;
961 +       DWORD_PTR result;
962  
963         /* Create a few threads and then exit. */
964         for (i = 0; i < 4; i++)
965
966 === modified file 'tests/join3.c'
967 --- pthreadw32/tests/join3.c    2005-05-15 15:28:24 +0000
968 +++ pthreadw32/tests/join3.c    2010-07-10 23:05:44 +0000
969 @@ -50,7 +50,7 @@
970  {
971         pthread_t id[4];
972         int i;
973 -       int result;
974 +       DWORD_PTR result;
975  
976         /* Create a few threads and then exit. */
977         for (i = 0; i < 4; i++)
978
979 === modified file 'tests/mutex6e.c'
980 --- pthreadw32/tests/mutex6e.c  2005-01-01 14:36:17 +0000
981 +++ pthreadw32/tests/mutex6e.c  2010-07-10 23:05:44 +0000
982 @@ -74,7 +74,7 @@
983  main()
984  {
985    pthread_t t;
986 -  int result = 0;
987 +  DWORD_PTR result = 0;
988    int mxType = -1;
989  
990    assert(pthread_mutexattr_init(&mxAttr) == 0);
991
992 === modified file 'tests/mutex6es.c'
993 --- pthreadw32/tests/mutex6es.c 2005-01-01 14:36:17 +0000
994 +++ pthreadw32/tests/mutex6es.c 2010-07-10 23:05:44 +0000
995 @@ -73,7 +73,7 @@
996  main()
997  {
998    pthread_t t;
999 -  int result = 0;
1000 +  DWORD_PTR result = 0;
1001  
1002    assert(mutex == PTHREAD_ERRORCHECK_MUTEX_INITIALIZER);
1003  
1004
1005 === modified file 'tests/mutex6r.c'
1006 --- pthreadw32/tests/mutex6r.c  2005-01-01 14:36:17 +0000
1007 +++ pthreadw32/tests/mutex6r.c  2010-07-10 23:05:44 +0000
1008 @@ -73,7 +73,7 @@
1009  main()
1010  {
1011    pthread_t t;
1012 -  int result = 0;
1013 +  DWORD_PTR result = 0;
1014    int mxType = -1;
1015  
1016    assert(pthread_mutexattr_init(&mxAttr) == 0);
1017
1018 === modified file 'tests/mutex6rs.c'
1019 --- pthreadw32/tests/mutex6rs.c 2005-01-01 14:36:17 +0000
1020 +++ pthreadw32/tests/mutex6rs.c 2010-07-10 23:05:44 +0000
1021 @@ -72,7 +72,7 @@
1022  main()
1023  {
1024    pthread_t t;
1025 -  int result = 0;
1026 +  DWORD_PTR result = 0;
1027  
1028    assert(mutex == PTHREAD_RECURSIVE_MUTEX_INITIALIZER);
1029  
1030
1031 === modified file 'tests/mutex7e.c'
1032 --- pthreadw32/tests/mutex7e.c  2005-01-01 14:36:17 +0000
1033 +++ pthreadw32/tests/mutex7e.c  2010-07-10 23:05:44 +0000
1034 @@ -74,7 +74,7 @@
1035  main()
1036  {
1037    pthread_t t;
1038 -  int result = 0;
1039 +  DWORD_PTR result = 0;
1040    int mxType = -1;
1041  
1042    assert(pthread_mutexattr_init(&mxAttr) == 0);
1043
1044 === modified file 'tests/mutex7r.c'
1045 --- pthreadw32/tests/mutex7r.c  2005-01-01 14:36:17 +0000
1046 +++ pthreadw32/tests/mutex7r.c  2010-07-10 23:05:44 +0000
1047 @@ -73,7 +73,7 @@
1048  main()
1049  {
1050    pthread_t t;
1051 -  int result = 0;
1052 +  DWORD_PTR result = 0;
1053    int mxType = -1;
1054  
1055    assert(pthread_mutexattr_init(&mxAttr) == 0);
1056
1057 === modified file 'tests/mutex8.c'
1058 --- pthreadw32/tests/mutex8.c   2002-02-20 04:39:56 +0000
1059 +++ pthreadw32/tests/mutex8.c   2010-07-10 23:05:44 +0000
1060 @@ -49,7 +49,7 @@
1061  
1062    _ftime(&currSysTime);
1063  
1064 -  abstime.tv_sec = currSysTime.time;
1065 +  abstime.tv_sec = (long)currSysTime.time;
1066    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1067  
1068    abstime.tv_sec += 1;
1069
1070 === modified file 'tests/mutex8e.c'
1071 --- pthreadw32/tests/mutex8e.c  2002-02-20 04:39:56 +0000
1072 +++ pthreadw32/tests/mutex8e.c  2010-07-10 23:05:44 +0000
1073 @@ -57,7 +57,7 @@
1074  
1075    _ftime(&currSysTime);
1076  
1077 -  abstime.tv_sec = currSysTime.time;
1078 +  abstime.tv_sec = (long)currSysTime.time;
1079    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1080  
1081    abstime.tv_sec += 1;
1082
1083 === modified file 'tests/mutex8n.c'
1084 --- pthreadw32/tests/mutex8n.c  2002-02-20 04:39:56 +0000
1085 +++ pthreadw32/tests/mutex8n.c  2010-07-10 23:05:44 +0000
1086 @@ -57,7 +57,7 @@
1087  
1088    _ftime(&currSysTime);
1089  
1090 -  abstime.tv_sec = currSysTime.time;
1091 +  abstime.tv_sec = (long)currSysTime.time;
1092    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1093  
1094    abstime.tv_sec += 1;
1095
1096 === modified file 'tests/mutex8r.c'
1097 --- pthreadw32/tests/mutex8r.c  2002-02-20 04:39:56 +0000
1098 +++ pthreadw32/tests/mutex8r.c  2010-07-10 23:05:44 +0000
1099 @@ -57,7 +57,7 @@
1100  
1101    _ftime(&currSysTime);
1102  
1103 -  abstime.tv_sec = currSysTime.time;
1104 +  abstime.tv_sec = (long)currSysTime.time;
1105    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1106  
1107    abstime.tv_sec += 1;
1108
1109 === modified file 'tests/priority1.c'
1110 --- pthreadw32/tests/priority1.c        2005-01-01 14:36:17 +0000
1111 +++ pthreadw32/tests/priority1.c        2010-07-10 23:05:44 +0000
1112 @@ -91,7 +91,7 @@
1113  
1114    assert(pthread_getschedparam(threadID, &policy, &param) == 0);
1115    assert(policy == SCHED_OTHER);
1116 -  return (void *) (param.sched_priority);
1117 +  return (void *) (size_t) (param.sched_priority);
1118  }
1119  
1120  void *
1121 @@ -164,8 +164,8 @@
1122  
1123        assert(pthread_join(t, &result) == 0);
1124  
1125 -      assert(param.sched_priority == (int) result);
1126 -      printf("%10d %10d %10d\n", param.sched_priority, (int) result, prio);
1127 +      assert(param.sched_priority == (int) (size_t) result);
1128 +      printf("%10d %10d %10d\n", param.sched_priority, (int) (size_t) result, prio);
1129      }
1130  
1131    return 0;
1132
1133 === modified file 'tests/priority2.c'
1134 --- pthreadw32/tests/priority2.c        2005-01-01 14:36:17 +0000
1135 +++ pthreadw32/tests/priority2.c        2010-07-10 23:05:44 +0000
1136 @@ -95,7 +95,7 @@
1137    assert(policy == SCHED_OTHER);
1138    result = pthread_barrier_wait(&endBarrier);
1139    assert(result == 0 || result == PTHREAD_BARRIER_SERIAL_THREAD);
1140 -  return (void *) param.sched_priority;
1141 +  return (void *) (size_t) param.sched_priority;
1142  }
1143  
1144  
1145 @@ -162,7 +162,7 @@
1146        assert(GetThreadPriority(pthread_getw32threadhandle_np(t)) ==
1147           validPriorities[param.sched_priority+(PTW32TEST_MAXPRIORITIES/2)]);
1148        pthread_join(t, &result);
1149 -      assert(param.sched_priority == (int)result);
1150 +      assert(param.sched_priority == (int)(size_t)result);
1151      }
1152  
1153    return 0;
1154
1155 === modified file 'tests/rwlock2_t.c'
1156 --- pthreadw32/tests/rwlock2_t.c        2005-01-01 14:36:17 +0000
1157 +++ pthreadw32/tests/rwlock2_t.c        2010-07-10 23:05:44 +0000
1158 @@ -55,7 +55,7 @@
1159  
1160    _ftime(&currSysTime);
1161  
1162 -  abstime.tv_sec = currSysTime.time;
1163 +  abstime.tv_sec = (long)currSysTime.time;
1164    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1165  
1166    abstime.tv_sec += 1;
1167
1168 === modified file 'tests/rwlock3_t.c'
1169 --- pthreadw32/tests/rwlock3_t.c        2005-01-01 14:36:17 +0000
1170 +++ pthreadw32/tests/rwlock3_t.c        2010-07-10 23:05:44 +0000
1171 @@ -68,7 +68,7 @@
1172  
1173    _ftime(&currSysTime);
1174  
1175 -  abstime.tv_sec = currSysTime.time;
1176 +  abstime.tv_sec = (long)currSysTime.time;
1177    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1178  
1179    abstime.tv_sec += 1;
1180
1181 === modified file 'tests/rwlock4_t.c'
1182 --- pthreadw32/tests/rwlock4_t.c        2005-01-01 14:36:17 +0000
1183 +++ pthreadw32/tests/rwlock4_t.c        2010-07-10 23:05:44 +0000
1184 @@ -68,7 +68,7 @@
1185  
1186    _ftime(&currSysTime);
1187  
1188 -  abstime.tv_sec = currSysTime.time;
1189 +  abstime.tv_sec = (long)currSysTime.time;
1190    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1191  
1192    abstime.tv_sec += 1;
1193
1194 === modified file 'tests/rwlock5_t.c'
1195 --- pthreadw32/tests/rwlock5_t.c        2005-01-01 14:36:17 +0000
1196 +++ pthreadw32/tests/rwlock5_t.c        2010-07-10 23:05:44 +0000
1197 @@ -70,7 +70,7 @@
1198  
1199    _ftime(&currSysTime);
1200  
1201 -  abstime.tv_sec = currSysTime.time;
1202 +  abstime.tv_sec = (long)currSysTime.time;
1203    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1204  
1205    abstime.tv_sec += 1;
1206
1207 === modified file 'tests/rwlock6.c'
1208 --- pthreadw32/tests/rwlock6.c  2005-01-01 14:36:17 +0000
1209 +++ pthreadw32/tests/rwlock6.c  2010-07-10 23:05:44 +0000
1210 @@ -77,9 +77,9 @@
1211    pthread_t wrt1;
1212    pthread_t wrt2;
1213    pthread_t rdt;
1214 -  int wr1Result = 0;
1215 -  int wr2Result = 0;
1216 -  int rdResult = 0;
1217 +  DWORD_PTR wr1Result = 0;
1218 +  DWORD_PTR wr2Result = 0;
1219 +  DWORD_PTR rdResult = 0;
1220  
1221    bankAccount = 0;
1222  
1223
1224 === modified file 'tests/rwlock6_t.c'
1225 --- pthreadw32/tests/rwlock6_t.c        2005-01-01 14:36:17 +0000
1226 +++ pthreadw32/tests/rwlock6_t.c        2010-07-10 23:05:44 +0000
1227 @@ -55,7 +55,7 @@
1228    bankAccount += 10;
1229    assert(pthread_rwlock_unlock(&rwlock1) == 0);
1230  
1231 -  return ((void *) bankAccount);
1232 +  return ((void *) (size_t) bankAccount);
1233  }
1234  
1235  void * rdfunc(void * arg)
1236 @@ -67,17 +67,17 @@
1237  
1238    _ftime(&currSysTime);
1239  
1240 -  abstime.tv_sec = currSysTime.time;
1241 +  abstime.tv_sec = (long)currSysTime.time;
1242    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1243  
1244  
1245 -  if ((int) arg == 1)
1246 +  if ((int) ((size_t) arg) == 1)
1247      {
1248        abstime.tv_sec += 1;
1249        assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == ETIMEDOUT);
1250        ba = 0;
1251      }
1252 -  else if ((int) arg == 2)
1253 +  else if ((int) ((size_t) arg) == 2)
1254      {
1255        abstime.tv_sec += 3;
1256        assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == 0);
1257 @@ -85,7 +85,7 @@
1258        assert(pthread_rwlock_unlock(&rwlock1) == 0);
1259      }
1260  
1261 -  return ((void *) ba);
1262 +  return ((void *) (size_t) ba);
1263  }
1264  
1265  int
1266 @@ -95,10 +95,10 @@
1267    pthread_t wrt2;
1268    pthread_t rdt1;
1269    pthread_t rdt2;
1270 -  int wr1Result = 0;
1271 -  int wr2Result = 0;
1272 -  int rd1Result = 0;
1273 -  int rd2Result = 0;
1274 +  DWORD_PTR wr1Result = 0;
1275 +  DWORD_PTR wr2Result = 0;
1276 +  DWORD_PTR rd1Result = 0;
1277 +  DWORD_PTR rd2Result = 0;
1278  
1279    bankAccount = 0;
1280  
1281
1282 === modified file 'tests/rwlock6_t2.c'
1283 --- pthreadw32/tests/rwlock6_t2.c       2005-01-01 14:36:17 +0000
1284 +++ pthreadw32/tests/rwlock6_t2.c       2010-07-10 23:05:44 +0000
1285 @@ -54,21 +54,21 @@
1286    int result;
1287  
1288    result = pthread_rwlock_timedwrlock(&rwlock1, &abstime);
1289 -  if ((int) arg == 1)
1290 +  if ((int) ((size_t)arg) == 1)
1291      {
1292        assert(result == 0);
1293        Sleep(2000);
1294        bankAccount += 10;
1295        assert(pthread_rwlock_unlock(&rwlock1) == 0);
1296 -      return ((void *) bankAccount);
1297 +      return ((void *) (size_t) bankAccount);
1298      }
1299 -  else if ((int) arg == 2)
1300 +  else if ((int) ((size_t)arg) == 2)
1301      {
1302        assert(result == ETIMEDOUT);
1303 -      return ((void *) 100);
1304 +      return ((void *) (size_t) 100);
1305      }
1306  
1307 -  return ((void *) -1);
1308 +  return ((void *) (size_t) -1);
1309  }
1310  
1311  void * rdfunc(void * arg)
1312 @@ -77,7 +77,7 @@
1313  
1314    assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == ETIMEDOUT);
1315  
1316 -  return ((void *) ba);
1317 +  return ((void *) (size_t) ba);
1318  }
1319  
1320  int
1321 @@ -86,15 +86,15 @@
1322    pthread_t wrt1;
1323    pthread_t wrt2;
1324    pthread_t rdt;
1325 -  int wr1Result = 0;
1326 -  int wr2Result = 0;
1327 -  int rdResult = 0;
1328 +  DWORD_PTR wr1Result = 0;
1329 +  DWORD_PTR wr2Result = 0;
1330 +  DWORD_PTR rdResult = 0;
1331    struct _timeb currSysTime;
1332    const DWORD NANOSEC_PER_MILLISEC = 1000000;
1333  
1334    _ftime(&currSysTime);
1335  
1336 -  abstime.tv_sec = currSysTime.time;
1337 +  abstime.tv_sec = (long)currSysTime.time;
1338    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
1339  
1340    abstime.tv_sec += 1;
1341
1342 === modified file 'tests/semaphore1.c'
1343 --- pthreadw32/tests/semaphore1.c       2005-05-08 16:52:50 +0000
1344 +++ pthreadw32/tests/semaphore1.c       2010-07-10 23:05:44 +0000
1345 @@ -119,7 +119,7 @@
1346  {
1347    pthread_t t;
1348    sem_t s;
1349 -  int result;
1350 +  DWORD_PTR result;
1351  
1352    assert(pthread_create(&t, NULL, thr, NULL) == 0);
1353    assert(pthread_join(t, (void **)&result) == 0);
1354
1355 === modified file 'tests/semaphore4.c'
1356 --- pthreadw32/tests/semaphore4.c       2005-01-01 14:36:17 +0000
1357 +++ pthreadw32/tests/semaphore4.c       2010-07-10 23:05:44 +0000
1358 @@ -113,7 +113,7 @@
1359  //printf("value = %d\n", -value); fflush(stdout);
1360         assert(pthread_cancel(t[50]) == 0);
1361           {
1362 -           int result;
1363 +           DWORD_PTR result;
1364             assert(pthread_join(t[50], (void **) &result) == 0);
1365  //         printf("result = %d\n", result); fflush(stdout);
1366           }
1367
1368 === modified file 'tests/spin3.c'
1369 --- pthreadw32/tests/spin3.c    2005-01-01 14:36:17 +0000
1370 +++ pthreadw32/tests/spin3.c    2010-07-10 23:05:44 +0000
1371 @@ -46,7 +46,7 @@
1372   
1373  void * unlocker(void * arg)
1374  {
1375 -  int expectedResult = (int) arg;
1376 +  int expectedResult = (int) (size_t) arg;
1377  
1378    wasHere++;
1379    assert(pthread_spin_unlock(&spin) == expectedResult);
1380
1381 === modified file 'tests/spin4.c'
1382 --- pthreadw32/tests/spin4.c    2005-01-01 14:36:17 +0000
1383 +++ pthreadw32/tests/spin4.c    2010-07-10 23:05:44 +0000
1384 @@ -63,7 +63,7 @@
1385  int
1386  main()
1387  {
1388 -  long result = 0;
1389 +  DWORD_PTR result = 0;
1390    pthread_t t;
1391    int CPUs;
1392    struct _timeb sysTime;
1393
1394 === modified file 'tests/stress1.c'
1395 --- pthreadw32/tests/stress1.c  2010-06-20 03:31:18 +0000
1396 +++ pthreadw32/tests/stress1.c  2010-07-10 23:29:46 +0000
1397 @@ -141,9 +141,9 @@
1398  void *
1399  masterThread (void * arg)
1400  {
1401 -  int dither = (int) arg;
1402 +  int dither = (int) (size_t)arg;
1403  
1404 -  timeout = (int) arg;
1405 +  timeout = (int) (size_t)arg;
1406  
1407    pthread_barrier_wait(&startBarrier);
1408  
1409 @@ -239,7 +239,7 @@
1410    assert(pthread_barrier_init(&readyBarrier, NULL, 3) == 0);
1411    assert(pthread_barrier_init(&holdBarrier, NULL, 3) == 0);
1412  
1413 -  assert(pthread_create(&master, NULL, masterThread, (void *) timeout) == 0);
1414 +  assert(pthread_create(&master, NULL, masterThread, (void *) (size_t)timeout) == 0);
1415    assert(pthread_create(&slave, NULL, slaveThread, NULL) == 0);
1416  
1417    allExit = FALSE;
1418
1419 === modified file 'tests/tsd1.c'
1420 --- pthreadw32/tests/tsd1.c     2005-05-08 16:52:50 +0000
1421 +++ pthreadw32/tests/tsd1.c     2010-07-10 23:05:44 +0000
1422 @@ -179,7 +179,7 @@
1423     */
1424    for (i = 1; i < NUM_THREADS; i++)
1425      {
1426 -       int result = 0;
1427 +       DWORD_PTR result = 0;
1428  
1429         assert(pthread_join(thread[i], (void **) &result) == 0);
1430      }
1431
1432 === modified file 'tests/tsd2.c'
1433 --- pthreadw32/tests/tsd2.c     2005-05-08 16:52:50 +0000
1434 +++ pthreadw32/tests/tsd2.c     2010-07-10 23:05:44 +0000
1435 @@ -183,7 +183,7 @@
1436     */
1437    for (i = 1; i < NUM_THREADS; i++)
1438      {
1439 -       int result = 0;
1440 +       DWORD_PTR result = 0;
1441  
1442         assert(pthread_join(thread[i], (void **) &result) == 0);
1443      }
1444
1445 === modified file 'version.rc'
1446 --- pthreadw32/version.rc       2005-05-19 04:19:35 +0000
1447 +++ pthreadw32/version.rc       2010-07-10 23:05:44 +0000
1448 @@ -102,7 +102,7 @@
1449      BEGIN
1450          BLOCK "040904b0"
1451          BEGIN
1452 -            VALUE "FileDescription", "POSIX Threads for Windows32 Library\0"
1453 +            VALUE "FileDescription", "POSIX Threads for Windows Library\0"
1454              VALUE "ProductVersion", PTW32_VERSION_STRING
1455              VALUE "FileVersion", PTW32_VERSION_STRING
1456              VALUE "InternalName", PTW32_VERSIONINFO_NAME
1457