Ravenports generated: 22 Oct 2019 13:49
[ravenports.git] / bucket_D2 / nspr
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               nspr
4 VERSION=                4.23
5 KEYWORDS=               devel
6 VARIANTS=               standard
7 SDESC[standard]=        Platform-neutral API for system-like functions
8 HOMEPAGE=               http://www.mozilla.org/projects/nspr/index.html
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            MOZILLA/nspr/releases/v4.23/src
13 DISTFILE[1]=            nspr-4.23.tar.gz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 USES=                   cpe gmake
21
22 DISTNAME=               nspr-4.23/nspr
23
24 CPE_PRODUCT=            netscape_portable_runtime
25 CPE_VENDOR=             mozilla
26 FPC_EQUIVALENT=         devel/nspr
27
28 MUST_CONFIGURE=         gnu
29 CONFIGURE_ARGS=         --enable-64bit
30
31 post-patch:
32         # Do not install tools to build itself
33         ${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
34                 ${WRKSRC}/pr/src/misc/Makefile.in
35
36 post-install:
37         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.${LIBEXT}
38
39 [FILE:207:descriptions/desc.single]
40 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
41 system level and libc like functions. The API is used in the Mozilla
42 client, many of Netscape/AOL/iPlanet's and other software offerings.
43
44
45 [FILE:95:distinfo]
46 4b9d821037faf5723da901515ed9cac8b23ef1ea3729022259777393453477a4      1078660 nspr-4.23.tar.gz
47
48
49 [FILE:1157:manifests/plist.single]
50 %%ONLY-DRAGONFLY%%include/nspr/md/_dragonfly.cfg
51 bin/nspr-config
52 include/nspr/
53  nspr.h
54  plarena.h
55  plarenas.h
56  plbase64.h
57  plerror.h
58  plgetopt.h
59  plhash.h
60  plstr.h
61  pratom.h
62  prbit.h
63  prclist.h
64  prcmon.h
65  prcountr.h
66  prcpucfg.h
67  prcvar.h
68  prdtoa.h
69  prenv.h
70  prerr.h
71  prerror.h
72  prinet.h
73  prinit.h
74  prinrval.h
75  prio.h
76  pripcsem.h
77  prlink.h
78  prlock.h
79  prlog.h
80  prlong.h
81  prmem.h
82  prmon.h
83  prmwait.h
84  prnetdb.h
85  prolock.h
86  prpdce.h
87  prprf.h
88  prproces.h
89  prrng.h
90  prrwlock.h
91  prshm.h
92  prshma.h
93  prsystem.h
94  prthread.h
95  prtime.h
96  prtpool.h
97  prtrace.h
98  prtypes.h
99  prvrsion.h
100  prwin16.h
101 include/nspr/md/
102  _aix32.cfg
103  _aix64.cfg
104  _bsdi.cfg
105  _darwin.cfg
106  _freebsd.cfg
107  _hpux32.cfg
108  _hpux64.cfg
109  _linux.cfg
110  _netbsd.cfg
111  _nto.cfg
112  _openbsd.cfg
113  _os2.cfg
114  _qnx.cfg
115  _riscos.cfg
116  _scoos.cfg
117  _solaris.cfg
118  _unixware.cfg
119  _unixware7.cfg
120  _win95.cfg
121  _winnt.cfg
122 include/nspr/obsolete/
123  pralarm.h
124  probslet.h
125  protypes.h
126  prsem.h
127 include/nspr/private/
128  pprio.h
129  pprthred.h
130  prpriv.h
131 @(,,444) lib/libnspr4.a
132 @(,,444) lib/libnspr4.so
133 @(,,444) lib/libplc4.a
134 @(,,444) lib/libplc4.so
135 @(,,444) lib/libplds4.a
136 @(,,444) lib/libplds4.so
137 lib/pkgconfig/nspr.pc
138 share/aclocal/nspr.m4
139
140
141 [FILE:1192:patches/patch-bug301986]
142 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
143 Better to just keep calling it pthread_t isntead of casting to anything.
144
145         -mi
146
147 --- pr/include/private/pprthred.h.orig  2019-10-15 14:21:38 UTC
148 +++ pr/include/private/pprthred.h
149 @@ -11,6 +11,7 @@
150  ** developers only.
151  */
152  #include "nspr.h"
153 +#include <pthread.h>
154  
155  #if defined(XP_OS2)
156  #define INCL_DOS
157 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
158  ** Get the id of the named thread. Each thread is assigned a unique id
159  ** when it is created or attached.
160  */
161 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
162 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
163  
164  /*
165  ** Set the procedure that is called when a thread is dumped. The procedure
166 --- pr/src/pthreads/ptthread.c.orig     2019-10-15 14:21:38 UTC
167 +++ pr/src/pthreads/ptthread.c
168 @@ -1183,9 +1183,9 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
169      _exit(status);
170  }
171  
172 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
173 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
174  {
175 -    return (PRUint32)thred->id;  /* and I don't know what they will do with it */
176 +    return thred->id;  /* and I don't know what they will do with it */
177  }
178  
179  /*
180
181
182 [FILE:916:patches/patch-bug782109]
183 --- pr/include/md/_freebsd.h.orig       2018-08-28 12:42:28 UTC
184 +++ pr/include/md/_freebsd.h
185 @@ -59,6 +59,14 @@
186  #define _PR_HAVE_LARGE_OFF_T
187  
188  #if defined(_PR_PTHREADS)
189 +#if __FreeBSD_version >= 602000
190 +#define _PR_HAVE_GETPROTO_R
191 +#define _PR_HAVE_5_ARG_GETPROTO_R
192 +#endif
193 +#if __FreeBSD_version >= 700016
194 +#define _PR_HAVE_GETHOST_R
195 +#define _PR_HAVE_GETHOST_R_INT
196 +#endif
197  #if __FreeBSD_version >= 400008
198  /*
199   * libc_r before this version of FreeBSD doesn't have poll().
200 --- pr/src/misc/prnetdb.c.orig  2018-08-28 12:42:28 UTC
201 +++ pr/src/misc/prnetdb.c
202 @@ -81,11 +81,6 @@ PRLock *_pr_dnsLock = NULL;
203  #define _PR_HAVE_GETPROTO_R_INT
204  #endif
205  
206 -#if __FreeBSD_version >= 602000
207 -#define _PR_HAVE_GETPROTO_R
208 -#define _PR_HAVE_5_ARG_GETPROTO_R
209 -#endif
210 -
211  /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
212  #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
213  #define _PR_HAVE_GETPROTO_R
214
215
216 [FILE:489:patches/patch-config_nspr.pc.in]
217 --- config/nspr.pc.in.orig      2019-10-15 14:21:38 UTC
218 +++ config/nspr.pc.in
219 @@ -6,5 +6,5 @@ includedir=@includedir@
220  Name: NSPR
221  Description: The Netscape Portable Runtime
222  Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
223 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
224 -Cflags: -I@includedir@
225 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
226 +Cflags: -I${includedir}
227
228
229 [FILE:2589:patches/patch-configure]
230 --- configure.orig      2019-10-15 14:21:38 UTC
231 +++ configure
232 @@ -6559,6 +6559,21 @@ tools are selected during the Xcode/Deve
233      fi
234      ;;
235  
236 +*-dragonfly*)
237 +    if test -z "$USE_NSPR_THREADS"; then
238 +        USE_PTHREADS=1
239 +    fi
240 +    $as_echo "#define XP_UNIX 1" >>confdefs.h
241 +    $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
242 +    $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
243 +    CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
244 +    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
245 +    DSO_CFLAGS=-fPIC
246 +    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
247 +    MDCPUCFG_H=_dragonfly.cfg
248 +    PR_MD_CSRCS=freebsd.c
249 +    ;;
250 +
251  *-freebsd*)
252      if test -z "$USE_NSPR_THREADS"; then
253          USE_PTHREADS=1
254 @@ -7228,7 +7243,6 @@ $as_echo "$as_me: WARNING: Unknown versi
255      CPU_ARCH=`uname -p`
256      MDCPUCFG_H=_solaris.cfg
257      PR_MD_CSRCS=solaris.c
258 -    LD=/usr/ccs/bin/ld
259      MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
260      RESOLVE_LINK_SYMBOLS=1
261      case "${OS_RELEASE}" in
262 @@ -7236,7 +7250,6 @@ $as_echo "$as_me: WARNING: Unknown versi
263          ;;
264      *)
265          # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
266 -        USE_B_DIRECT=1
267          ;;
268      esac
269      if test -n "$GNU_CC"; then
270 @@ -7932,7 +7945,7 @@ $as_echo_n "checking whether ${CC-cc} ac
271         if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
272             ac_cv_have_dash_pthread=yes
273                 case "$target_os" in
274 -           freebsd*)
275 +           freebsd*|dragonfly*)
276  # Freebsd doesn't use -pthread for compiles, it uses them for linking
277              ;;
278             *)
279 @@ -7970,7 +7983,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
280              _PTHREAD_LDFLAGS=
281          fi
282             ;;
283 -    *-freebsd*)
284 +    *-freebsd*|*-dragonfly*)
285             $as_echo "#define _REENTRANT 1" >>confdefs.h
286  
287             $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
288 @@ -8060,7 +8073,7 @@ case "$target" in
289  
290      fi
291      ;;
292 -*-freebsd*)
293 +*-freebsd*|*-dragonfly*)
294      if test -n "$USE_NSPR_THREADS"; then
295          $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
296  
297 @@ -8113,17 +8126,7 @@ _ACEOF
298  
299          $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
300  
301 -        if test "$OS_TEST" = "i86pc"; then
302 -            if test -n "$USE_64"; then
303 -               PR_MD_ASFILES=os_SunOS_x86_64.s
304 -            else
305 -               PR_MD_ASFILES=os_SunOS_x86.s
306 -            fi
307 -        else
308 -            if test -n "$USE_64"; then
309 -                PR_MD_ASFILES=os_SunOS_sparcv9.s
310 -            fi
311 -        fi
312 +        PR_MD_ASFILES=os_SunOS_x86_64.s
313      fi
314      ;;
315  *-nto*)
316
317
318 [FILE:29818:patches/patch-libtests]
319 --- lib/tests/arena.c.orig      2019-10-15 14:21:38 UTC
320 +++ lib/tests/arena.c
321 @@ -36,6 +36,7 @@ void DumpAll( void )
322      return;
323  }
324  
325 +#if 0
326  /*
327  ** Test Arena allocation.
328  */
329 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
330  
331      return;
332  } /* end ArenaGrow() */
333 +#endif
334  
335  
336  /*
337 --- lib/tests/base64t.c.orig    2019-10-15 14:21:38 UTC
338 +++ lib/tests/base64t.c
339 @@ -2362,7 +2362,6 @@ PRBool test_008(void)
340      for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
341      {
342          PRUint32 plen = PL_strlen(array[i].plaintext);
343 -        PRUint32 clen = ((plen + 2)/3)*4;
344  
345          char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
346  
347 @@ -3122,9 +3121,6 @@ PRBool test_024(void)
348  
349      for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
350      {
351 -        PRUint32 plen = PL_strlen(array[i].plaintext);
352 -        PRUint32 clen = ((plen + 2)/3)*4;
353 -
354          char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
355  
356          if( (char *)0 == rv )
357 @@ -3258,8 +3254,6 @@ PRBool test_027(void)
358  
359      for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
360      {
361 -        PRUint32 clen = PL_strlen(array[i].cyphertext);
362 -
363          char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
364  
365          if( (char *)0 == rv )
366 --- lib/tests/string.c.orig     2019-10-15 14:21:38 UTC
367 +++ lib/tests/string.c
368 @@ -127,7 +127,7 @@ PRBool test_003(void)
369          rv = PL_strcpy(array[i].dest, array[i].str);
370          if( array[i].rv != rv )
371          {
372 -            printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
373 +            printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
374                     array[i].str ? array[i].str : "(null)", rv);
375              return PR_FALSE;
376          }
377 @@ -240,8 +240,8 @@ PRBool test_004(void)
378          rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
379          if( array[i].rv != rv )
380          {
381 -            printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
382 -                   array[i].str ? array[i].str : "(null)", array[i].len, rv);
383 +            printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
384 +                   array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
385              return PR_FALSE;
386          }
387  
388 @@ -367,8 +367,8 @@ PRBool test_005(void)
389          rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
390          if( array[i].rv != rv )
391          {
392 -            printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
393 -                   array[i].str ? array[i].str : "(null)", array[i].len, rv);
394 +            printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
395 +                   array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
396              return PR_FALSE;
397          }
398  
399 @@ -421,7 +421,7 @@ PRBool test_006(void)
400  
401          if( (char *)0 == rv )
402          {
403 -            printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
404 +            printf("FAIL %d: %p -> 0\n", i, array[i]);
405              return PR_FALSE;
406          }
407  
408 @@ -507,8 +507,8 @@ PRBool test_007(void)
409  
410          if( (char *)0 == rv )
411          {
412 -            printf("FAIL %d: %s,%lu -> 0\n", i,
413 -                   array[i].str ? array[i].str : "(null)", array[i].len);
414 +            printf("FAIL %d: %s,%u -> 0\n", i,
415 +                   array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
416              return PR_FALSE;
417          }
418  
419 @@ -700,10 +700,10 @@ PRBool test_009(void)
420          {
421              if( (char *)0 != rv )
422              {
423 -                printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
424 +                printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
425                         array[i].first ? array[i].first : "(null)",
426                         array[i].second ? array[i].second : "(null)",
427 -                       array[i].length, rv);
428 +                       (unsigned)array[i].length, rv);
429                  return PR_FALSE;
430              }
431          }
432 @@ -711,10 +711,10 @@ PRBool test_009(void)
433          {
434              if( (char *)0 == rv )
435              {
436 -                printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
437 +                printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
438                         array[i].first ? array[i].first : "(null)",
439                         array[i].second ? array[i].second : "(null)",
440 -                       array[i].length, array[i].result);
441 +                       (unsigned)array[i].length, array[i].result);
442                  return PR_FALSE;
443              }
444              else
445 @@ -726,10 +726,10 @@ PRBool test_009(void)
446                  {
447                      if( *a != *b )
448                      {
449 -                        printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
450 +                        printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
451                                 array[i].first ? array[i].first : "(null)",
452                                 array[i].second ? array[i].second : "(null)",
453 -                               array[i].length, rv, array[i].result);
454 +                               (unsigned)array[i].length, rv, array[i].result);
455                          return PR_FALSE;
456                      }
457  
458 @@ -741,10 +741,10 @@ PRBool test_009(void)
459                  {
460                      if( (char)0 != *b )
461                      {
462 -                        printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
463 +                        printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
464                                 array[i].first ? array[i].first : "(null)",
465                                 array[i].second ? array[i].second : "(null)",
466 -                               array[i].length);
467 +                               (unsigned)array[i].length);
468                          return PR_FALSE;
469                      }
470                  }
471 @@ -752,10 +752,10 @@ PRBool test_009(void)
472                  {
473                      if( (char)0 == *b )
474                      {
475 -                        printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
476 +                        printf("FAIL %d: %s+%s/%u -> overrun\n", i,
477                                 array[i].first ? array[i].first : "(null)",
478                                 array[i].second ? array[i].second : "(null)",
479 -                               array[i].length);
480 +                               (unsigned)array[i].length);
481                          return PR_FALSE;
482                      }
483                  }
484 @@ -832,10 +832,10 @@ PRBool test_010(void)
485          {
486              if( (char *)0 != rv )
487              {
488 -                printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
489 +                printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
490                         array[i].first ? array[i].first : "(null)",
491                         array[i].second ? array[i].second : "(null)",
492 -                       array[i].length, rv);
493 +                       (unsigned)array[i].length, rv);
494                  return PR_FALSE;
495              }
496          }
497 @@ -843,10 +843,10 @@ PRBool test_010(void)
498          {
499              if( (char *)0 == rv )
500              {
501 -                printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
502 +                printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
503                         array[i].first ? array[i].first : "(null)",
504                         array[i].second ? array[i].second : "(null)",
505 -                       array[i].length, array[i].result);
506 +                       (unsigned)array[i].length, array[i].result);
507                  return PR_FALSE;
508              }
509              else
510 @@ -858,10 +858,10 @@ PRBool test_010(void)
511                  {
512                      if( *a != *b )
513                      {
514 -                        printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
515 +                        printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
516                                 array[i].first ? array[i].first : "(null)",
517                                 array[i].second ? array[i].second : "(null)",
518 -                               array[i].length, rv, array[i].result);
519 +                               (unsigned)array[i].length, rv, array[i].result);
520                          return PR_FALSE;
521                      }
522  
523 @@ -1104,10 +1104,10 @@ PRBool test_012(void)
524                  break;
525          }
526  
527 -        printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
528 +        printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
529                 array[i].one ? array[i].one : "(null)",
530                 array[i].two ? array[i].two : "(null)",
531 -               array[i].max, rv, array[i].sign);
532 +               (int)array[i].max, rv, array[i].sign);
533          return PR_FALSE;
534      }
535  
536 @@ -1338,10 +1338,10 @@ PRBool test_014(void)
537                  break;
538          }
539  
540 -        printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
541 +        printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
542                 array[i].one ? array[i].one : "(null)",
543                 array[i].two ? array[i].two : "(null)",
544 -               array[i].max, rv, array[i].sign);
545 +               (int)array[i].max, rv, array[i].sign);
546          return PR_FALSE;
547      }
548  
549 @@ -1411,15 +1411,15 @@ PRBool test_015(void)
550          {
551              if( (char *)0 == rv )
552              {
553 -                printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
554 -                       array[i].chr, array[i].off);
555 +                printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
556 +                       array[i].chr, (unsigned)array[i].off);
557                  return PR_FALSE;
558              }
559  
560              if( &array[i].str[ array[i].off ] != rv )
561              {
562 -                printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
563 -                       array[i].chr, rv, array[i].str, array[i].off);
564 +                printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
565 +                       array[i].chr, rv, array[i].str, (unsigned)array[i].off);
566                  return PR_FALSE;
567              }
568          }
569 @@ -1491,15 +1491,15 @@ PRBool test_016(void)
570          {
571              if( (char *)0 == rv )
572              {
573 -                printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
574 -                       array[i].chr, array[i].off);
575 +                printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
576 +                       array[i].chr, (unsigned)array[i].off);
577                  return PR_FALSE;
578              }
579  
580              if( &array[i].str[ array[i].off ] != rv )
581              {
582 -                printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
583 -                       array[i].chr, rv, array[i].str, array[i].off);
584 +                printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
585 +                       array[i].chr, rv, array[i].str, (unsigned)array[i].off);
586                  return PR_FALSE;
587              }
588          }
589 @@ -1566,8 +1566,8 @@ PRBool test_017(void)
590          {
591              if( (char *)0 != rv )
592              {
593 -                printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
594 -                       array[i].chr, array[i].max, rv);
595 +                printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
596 +                       array[i].chr, (unsigned)array[i].max, rv);
597                  return PR_FALSE;
598              }
599          }
600 @@ -1575,15 +1575,15 @@ PRBool test_017(void)
601          {
602              if( (char *)0 == rv )
603              {
604 -                printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
605 -                       array[i].chr, array[i].max, array[i].off);
606 +                printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
607 +                       array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
608                  return PR_FALSE;
609              }
610  
611              if( &array[i].str[ array[i].off ] != rv )
612              {
613 -                printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
614 -                       array[i].chr, array[i].max, rv, array[i].str, array[i].off);
615 +                printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
616 +                       array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
617                  return PR_FALSE;
618              }
619          }
620 @@ -1650,8 +1650,8 @@ PRBool test_018(void)
621          {
622              if( (char *)0 != rv )
623              {
624 -                printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
625 -                       array[i].chr, array[i].max, rv);
626 +                printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
627 +                       array[i].chr, (unsigned)array[i].max, rv);
628                  return PR_FALSE;
629              }
630          }
631 @@ -1659,15 +1659,15 @@ PRBool test_018(void)
632          {
633              if( (char *)0 == rv )
634              {
635 -                printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
636 -                       array[i].chr, array[i].max, array[i].off);
637 +                printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
638 +                       array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
639                  return PR_FALSE;
640              }
641  
642 -            if( &array[i].str[ array[i].off ] != rv )
643 +            if( &array[i].str[ array[i].off ] != rv)
644              {
645 -                printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
646 -                       array[i].chr, array[i].max, rv, array[i].str, array[i].off);
647 +                printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
648 +                       array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
649                  return PR_FALSE;
650              }
651          }
652 @@ -1746,19 +1746,19 @@ PRBool test_019(void)
653          {
654              if( (char *)0 == rv )
655              {
656 -                printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
657 +                printf("FAIL %d: %s,%s -> null, not +%u\n", i,
658                         array[i].str ? array[i].str : "(null)",
659                         array[i].chrs ? array[i].chrs : "(null)",
660 -                       array[i].off);
661 +                       (unsigned)array[i].off);
662                  return PR_FALSE;
663              }
664  
665              if( &array[i].str[ array[i].off ] != rv )
666              {
667 -                printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
668 +                printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
669                         array[i].str ? array[i].str : "(null)",
670                         array[i].chrs ? array[i].chrs : "(null)",
671 -                       rv, array[i].str, array[i].off);
672 +                       rv, array[i].str, (unsigned)array[i].off);
673                  return PR_FALSE;
674              }
675          }
676 @@ -1837,19 +1837,19 @@ PRBool test_020(void)
677          {
678              if( (char *)0 == rv )
679              {
680 -                printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
681 +                printf("FAIL %d: %s,%s -> null, not +%u\n", i,
682                         array[i].str ? array[i].str : "(null)",
683                         array[i].chrs ? array[i].chrs : "(null)",
684 -                       array[i].off);
685 +                       (unsigned)array[i].off);
686                  return PR_FALSE;
687              }
688  
689              if( &array[i].str[ array[i].off ] != rv )
690              {
691 -                printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
692 +                printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
693                         array[i].str ? array[i].str : "(null)",
694                         array[i].chrs ? array[i].chrs : "(null)",
695 -                       rv, array[i].str, array[i].off);
696 +                       rv, array[i].str, (unsigned)array[i].off);
697                  return PR_FALSE;
698              }
699          }
700 @@ -1923,10 +1923,10 @@ PRBool test_021(void)
701          {
702              if( (char *)0 != rv )
703              {
704 -                printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
705 +                printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
706                         array[i].str ? array[i].str : "(null)",
707                         array[i].chrs ? array[i].chrs : "(null)",
708 -                       array[i].max, rv);
709 +                       (unsigned)array[i].max, rv);
710                  return PR_FALSE;
711              }
712          }
713 @@ -1934,19 +1934,19 @@ PRBool test_021(void)
714          {
715              if( (char *)0 == rv )
716              {
717 -                printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
718 +                printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
719                         array[i].str ? array[i].str : "(null)",
720                         array[i].chrs ? array[i].chrs : "(null)",
721 -                       array[i].max, array[i].off);
722 +                       (unsigned)array[i].max, array[i].off);
723                  return PR_FALSE;
724              }
725  
726              if( &array[i].str[ array[i].off ] != rv )
727              {
728 -                printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
729 +                printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
730                         array[i].str ? array[i].str : "(null)",
731                         array[i].chrs ? array[i].chrs : "(null)",
732 -                       array[i].max, rv, array[i].str, array[i].off);
733 +                       (unsigned)array[i].max, rv, array[i].str, array[i].off);
734                  return PR_FALSE;
735              }
736          }
737 @@ -2029,10 +2029,10 @@ PRBool test_022(void)
738          {
739              if( (char *)0 != rv )
740              {
741 -                printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
742 +                printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
743                         array[i].str ? array[i].str : "(null)",
744                         array[i].chrs ? array[i].chrs : "(null)",
745 -                       array[i].max, rv);
746 +                       (unsigned)array[i].max, rv);
747                  return PR_FALSE;
748              }
749          }
750 @@ -2040,19 +2040,19 @@ PRBool test_022(void)
751          {
752              if( (char *)0 == rv )
753              {
754 -                printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
755 +                printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
756                         array[i].str ? array[i].str : "(null)",
757                         array[i].chrs ? array[i].chrs : "(null)",
758 -                       array[i].max, array[i].off);
759 +                       (unsigned)array[i].max, array[i].off);
760                  return PR_FALSE;
761              }
762  
763              if( &array[i].str[ array[i].off ] != rv )
764              {
765 -                printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
766 +                printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
767                         array[i].str ? array[i].str : "(null)",
768                         array[i].chrs ? array[i].chrs : "(null)",
769 -                       array[i].max, rv, array[i].str, array[i].off);
770 +                       (unsigned)array[i].max, rv, array[i].str, array[i].off);
771                  return PR_FALSE;
772              }
773          }
774 @@ -2148,19 +2148,19 @@ PRBool test_023(void)
775          {
776              if( (char *)0 == rv )
777              {
778 -                printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
779 +                printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
780                         array[i].str ? array[i].str : "(null)",
781                         array[i].sub ? array[i].sub : "(null)",
782 -                       array[i].str, array[i].off);
783 +                       array[i].str, (unsigned)array[i].off);
784                  return PR_FALSE;
785              }
786  
787              if( &array[i].str[ array[i].off ] != rv )
788              {
789 -                printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
790 +                printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
791                         array[i].str ? array[i].str : "(null)",
792                         array[i].sub ? array[i].sub : "(null)",
793 -                       rv, array[i].str, array[i].off);
794 +                       rv, array[i].str, (unsigned)array[i].off);
795                  return PR_FALSE;
796              }
797          }
798 @@ -2256,19 +2256,19 @@ PRBool test_024(void)
799          {
800              if( (char *)0 == rv )
801              {
802 -                printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
803 +                printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
804                         array[i].str ? array[i].str : "(null)",
805                         array[i].sub ? array[i].sub : "(null)",
806 -                       array[i].str, array[i].off);
807 +                       array[i].str, (unsigned)array[i].off);
808                  return PR_FALSE;
809              }
810  
811              if( &array[i].str[ array[i].off ] != rv )
812              {
813 -                printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
814 +                printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
815                         array[i].str ? array[i].str : "(null)",
816                         array[i].sub ? array[i].sub : "(null)",
817 -                       rv, array[i].str, array[i].off);
818 +                       rv, array[i].str, (unsigned)array[i].off);
819                  return PR_FALSE;
820              }
821          }
822 @@ -2375,10 +2375,10 @@ PRBool test_025(void)
823          {
824              if( (char *)0 != rv )
825              {
826 -                printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
827 +                printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
828                         array[i].str ? array[i].str : "(null)",
829                         array[i].sub ? array[i].sub : "(null)",
830 -                       array[i].max, rv);
831 +                       (unsigned)array[i].max, rv);
832                  return PR_FALSE;
833              }
834          }
835 @@ -2386,19 +2386,19 @@ PRBool test_025(void)
836          {
837              if( (char *)0 == rv )
838              {
839 -                printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
840 +                printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
841                         array[i].str ? array[i].str : "(null)",
842                         array[i].sub ? array[i].sub : "(null)",
843 -                       array[i].max, array[i].str, array[i].off);
844 +                       (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
845                  return PR_FALSE;
846              }
847  
848              if( &array[i].str[ array[i].off ] != rv )
849              {
850 -                printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
851 +                printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
852                         array[i].str ? array[i].str : "(null)",
853                         array[i].sub ? array[i].sub : "(null)",
854 -                       array[i].max, rv, array[i].str, array[i].off);
855 +                       (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
856                  return PR_FALSE;
857              }
858          }
859 @@ -2507,10 +2507,10 @@ PRBool test_026(void)
860          {
861              if( (char *)0 != rv )
862              {
863 -                printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
864 +                printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
865                         array[i].str ? array[i].str : "(null)",
866                         array[i].sub ? array[i].sub : "(null)",
867 -                       array[i].max, rv);
868 +                       (unsigned)array[i].max, rv);
869                  return PR_FALSE;
870              }
871          }
872 @@ -2518,19 +2518,19 @@ PRBool test_026(void)
873          {
874              if( (char *)0 == rv )
875              {
876 -                printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
877 +                printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
878                         array[i].str ? array[i].str : "(null)",
879                         array[i].sub ? array[i].sub : "(null)",
880 -                       array[i].max, array[i].str, array[i].off);
881 +                       (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
882                  return PR_FALSE;
883              }
884  
885              if( &array[i].str[ array[i].off ] != rv )
886              {
887 -                printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
888 +                printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
889                         array[i].str ? array[i].str : "(null)",
890                         array[i].sub ? array[i].sub : "(null)",
891 -                       array[i].max, rv, array[i].str, array[i].off);
892 +                       (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
893                  return PR_FALSE;
894              }
895          }
896 @@ -2626,19 +2626,19 @@ PRBool test_027(void)
897          {
898              if( (char *)0 == rv )
899              {
900 -                printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
901 +                printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
902                         array[i].str ? array[i].str : "(null)",
903                         array[i].sub ? array[i].sub : "(null)",
904 -                       array[i].str, array[i].off);
905 +                       array[i].str, (unsigned)array[i].off);
906                  return PR_FALSE;
907              }
908  
909              if( &array[i].str[ array[i].off ] != rv )
910              {
911 -                printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
912 +                printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
913                         array[i].str ? array[i].str : "(null)",
914                         array[i].sub ? array[i].sub : "(null)",
915 -                       rv, array[i].str, array[i].off);
916 +                       rv, array[i].str, (unsigned)array[i].off);
917                  return PR_FALSE;
918              }
919          }
920 @@ -2734,19 +2734,19 @@ PRBool test_028(void)
921          {
922              if( (char *)0 == rv )
923              {
924 -                printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
925 +                printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
926                         array[i].str ? array[i].str : "(null)",
927                         array[i].sub ? array[i].sub : "(null)",
928 -                       array[i].str, array[i].off);
929 +                       array[i].str, (unsigned)array[i].off);
930                  return PR_FALSE;
931              }
932  
933              if( &array[i].str[ array[i].off ] != rv )
934              {
935 -                printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
936 +                printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
937                         array[i].str ? array[i].str : "(null)",
938                         array[i].sub ? array[i].sub : "(null)",
939 -                       rv, array[i].str, array[i].off);
940 +                       rv, array[i].str, (unsigned)array[i].off);
941                  return PR_FALSE;
942              }
943          }
944 @@ -2853,10 +2853,10 @@ PRBool test_029(void)
945          {
946              if( (char *)0 != rv )
947              {
948 -                printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
949 +                printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
950                         array[i].str ? array[i].str : "(null)",
951                         array[i].sub ? array[i].sub : "(null)",
952 -                       array[i].max, rv);
953 +                       (unsigned)array[i].max, rv);
954                  return PR_FALSE;
955              }
956          }
957 @@ -2864,19 +2864,19 @@ PRBool test_029(void)
958          {
959              if( (char *)0 == rv )
960              {
961 -                printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
962 +                printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
963                         array[i].str ? array[i].str : "(null)",
964                         array[i].sub ? array[i].sub : "(null)",
965 -                       array[i].max, array[i].str, array[i].off);
966 +                       (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
967                  return PR_FALSE;
968              }
969  
970              if( &array[i].str[ array[i].off ] != rv )
971              {
972 -                printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
973 +                printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
974                         array[i].str ? array[i].str : "(null)",
975                         array[i].sub ? array[i].sub : "(null)",
976 -                       array[i].max, rv, array[i].str, array[i].off);
977 +                       (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
978                  return PR_FALSE;
979              }
980          }
981 @@ -2985,10 +2985,10 @@ PRBool test_030(void)
982          {
983              if( (char *)0 != rv )
984              {
985 -                printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
986 +                printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
987                         array[i].str ? array[i].str : "(null)",
988                         array[i].sub ? array[i].sub : "(null)",
989 -                       array[i].max, rv);
990 +                       (unsigned)array[i].max, rv);
991                  return PR_FALSE;
992              }
993          }
994 @@ -2996,19 +2996,19 @@ PRBool test_030(void)
995          {
996              if( (char *)0 == rv )
997              {
998 -                printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
999 +                printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
1000                         array[i].str ? array[i].str : "(null)",
1001                         array[i].sub ? array[i].sub : "(null)",
1002 -                       array[i].max, array[i].str, array[i].off);
1003 +                       (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
1004                  return PR_FALSE;
1005              }
1006  
1007              if( &array[i].str[ array[i].off ] != rv )
1008              {
1009 -                printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
1010 +                printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
1011                         array[i].str ? array[i].str : "(null)",
1012                         array[i].sub ? array[i].sub : "(null)",
1013 -                       array[i].max, rv, array[i].str, array[i].off);
1014 +                       (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
1015                  return PR_FALSE;
1016              }
1017          }
1018
1019
1020 [FILE:972:patches/patch-pr_src_pthreads_ptio.c]
1021 --- pr/src/pthreads/ptio.c.orig 2019-03-07 10:04:05 UTC
1022 +++ pr/src/pthreads/ptio.c
1023 @@ -182,6 +182,7 @@ static PRBool _pr_ipv6_v6only_on_by_defa
1024      || defined(HPUX10_30) || defined(HPUX11) \
1025      || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1026      || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1027 +    || defined(__DragonFly__) \
1028      || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1029      || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
1030  #define _PRSelectFdSetArg_t fd_set *
1031 @@ -3355,6 +3356,7 @@ static PRIOMethods _pr_socketpollfd_meth
1032  #if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
1033      || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1034      || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
1035 +    || defined(__DragonFly__) \
1036      || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
1037      || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS) \
1038      || defined(SYMBIAN)
1039
1040
1041 [FILE:85450:patches/patch-tests]
1042 --- lib/tests/Makefile.in.orig  2019-10-15 14:21:38 UTC
1043 +++ lib/tests/Makefile.in
1044 @@ -159,7 +159,7 @@ else
1045  ifeq ($(OS_ARCH),OS2)
1046         $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC)  $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1047  else
1048 -       $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1049 +       $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1050  endif
1051  endif
1052  endif
1053 --- pr/tests/Makefile.in.orig   2019-10-15 14:21:38 UTC
1054 +++ pr/tests/Makefile.in
1055 @@ -442,17 +442,18 @@ endif
1056  ALWAYS:
1057  
1058  runtests:: $(PROGS) ALWAYS
1059 -       @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
1060 -       @$(ECHO) "BEGIN\t\t\t`date`"
1061 -       @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
1062 -       @$(ECHO) "Test\t\t\tResult\n"
1063 +       @$(ECHO) "NSPR Test Results - $(OBJDIR)"
1064 +       @$(ECHO) "BEGIN                 `date`"
1065 +       @$(ECHO) "Test                  Result"
1066         @cd $(OBJDIR); for i in $(PROGRAMS); do                                 \
1067 -       $(ECHO) "$$i\c";                                                                                \
1068 -       ./$$i >> $(LOGFILE) 2>&1 ;                                                              \
1069 +       printf "$$i";                                                                           \
1070 +       ./$$i > $$i.output 2>&1;                                                                \
1071         if  [ 0 = $$? ] ; then                                                                  \
1072 -               $(ECHO) "\t\t\tPassed";                                                         \
1073 -       else                                                                                                    \
1074 -               $(ECHO) "\t\t\tFAILED";                                                         \
1075 -       fi;                                                                                                             \
1076 +               $(ECHO) "                       Passed";                                        \
1077 +               rm $$i.output;                                                                  \
1078 +       else                                                                                    \
1079 +               $(ECHO) "                       FAILED";                                        \
1080 +               cat $$i.output;                                                                 \
1081 +       fi;                                                                                     \
1082         done
1083 -       @$(ECHO) "\nEND\t\t`date`\n"
1084 +       @$(ECHO) "END           `date`"
1085 --- pr/tests/cleanup.c.orig     2019-10-15 14:21:38 UTC
1086 +++ pr/tests/cleanup.c
1087 @@ -15,7 +15,7 @@
1088  
1089  static void PR_CALLBACK Thread(void *sleep)
1090  {
1091 -    PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1092 +    PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1093      printf("Thread exiting\n");
1094  }
1095  
1096 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1097      PRThreadScope type = PR_LOCAL_THREAD;
1098      PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1099      PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1100 -    PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1101 +    PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1102 +    intptr_t child_sleep = 10;
1103  
1104      PR_STDIO_INIT();
1105      while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1106 @@ -82,7 +83,7 @@ int main(int argc, char **argv)
1107                 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1108      PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1109      PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1110 -    PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1111 +    PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1112      PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1113      PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1114  
1115 --- pr/tests/cltsrv.c.orig      2019-10-15 14:21:38 UTC
1116 +++ pr/tests/cltsrv.c
1117 @@ -931,7 +931,7 @@ int main(int argc, char** argv)
1118  {
1119      PRUintn index;
1120      PRBool boolean;
1121 -    CSClient_t *client;
1122 +    CSClient_t *client = NULL;
1123      PRStatus rv, joinStatus;
1124      CSServer_t *server = NULL;
1125  
1126 --- pr/tests/cvar.c.orig        2019-10-15 14:21:38 UTC
1127 +++ pr/tests/cvar.c
1128 @@ -138,15 +138,15 @@ static int alive;
1129  static void PR_CALLBACK CXReader(void *arg)
1130  {
1131      CircBuf *cbp = (CircBuf *)arg;
1132 -    PRInt32 i, n;
1133 +    intptr_t i, n;
1134      void *data;
1135  
1136      n = count / 2;
1137      for (i = 0; i < n; i++) {
1138          data = GetCBData(cbp);
1139 -        if ((int)data != i)
1140 +        if ((intptr_t)data != i)
1141              if (debug_mode) {
1142 -                printf("data mismatch at for i = %d usec\n", i);
1143 +                printf("data mismatch at for i = %ld usec\n", (long)i);
1144              }
1145      }
1146  
1147 @@ -159,7 +159,7 @@ static void PR_CALLBACK CXReader(void *a
1148  static void PR_CALLBACK CXWriter(void *arg)
1149  {
1150      CircBuf *cbp = (CircBuf *)arg;
1151 -    PRInt32 i, n;
1152 +    intptr_t i, n;
1153  
1154      n = count / 2;
1155      for (i = 0; i < n; i++) {
1156 --- pr/tests/cvar2.c.orig       2019-10-15 14:21:38 UTC
1157 +++ pr/tests/cvar2.c
1158 @@ -96,7 +96,7 @@ PrivateCondVarThread(void *_info)
1159      for (index=0; index<info->loops; index++) {
1160          PR_Lock(info->lock);
1161          if (*info->tcount == 0) {
1162 -            DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1163 +            DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1164                       PR_GetCurrentThread(), info->cvar));
1165              PR_WaitCondVar(info->cvar, info->timeout);
1166          }
1167 @@ -109,8 +109,8 @@ PrivateCondVarThread(void *_info)
1168          PR_Lock(info->exitlock);
1169          (*info->exitcount)++;
1170          PR_NotifyCondVar(info->exitcvar);
1171 -        DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1172 -                 PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1173 +        DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1174 +                 PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1175          PR_Unlock(info->exitlock);
1176      }
1177  #if 0
1178 @@ -159,7 +159,7 @@ CreateTestThread(threadinfo *info,
1179  void
1180  CondVarTestSUU(void *_arg)
1181  {
1182 -    PRInt32 arg = (PRInt32)_arg;
1183 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1184      PRInt32 index, loops;
1185      threadinfo *list;
1186      PRLock *sharedlock;
1187 @@ -191,7 +191,7 @@ CondVarTestSUU(void *_arg)
1188                           PR_TRUE,
1189                           PR_LOCAL_THREAD);
1190          index++;
1191 -        DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1192 +        DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1193      }
1194  
1195      for (loops = 0; loops < count; loops++) {
1196 @@ -201,7 +201,7 @@ CondVarTestSUU(void *_arg)
1197              (*list[index].tcount)++;
1198              PR_NotifyCondVar(list[index].cvar);
1199              PR_Unlock(list[index].lock);
1200 -            DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1201 +            DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1202                       PR_GetCurrentThread(), list[index].cvar));
1203          }
1204  
1205 @@ -231,7 +231,7 @@ CondVarTestSUU(void *_arg)
1206  void
1207  CondVarTestSUK(void *_arg)
1208  {
1209 -    PRInt32 arg = (PRInt32)_arg;
1210 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1211      PRInt32 index, loops;
1212      threadinfo *list;
1213      PRLock *sharedlock;
1214 @@ -307,7 +307,7 @@ CondVarTestSUK(void *_arg)
1215  void
1216  CondVarTestPUU(void *_arg)
1217  {
1218 -    PRInt32 arg = (PRInt32)_arg;
1219 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1220      PRInt32 index, loops;
1221      threadinfo *list;
1222      PRLock *sharedlock;
1223 @@ -342,7 +342,7 @@ CondVarTestPUU(void *_arg)
1224                           PR_FALSE,
1225                           PR_LOCAL_THREAD);
1226  
1227 -        DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1228 +        DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1229          index++;
1230          tcount++;
1231      }
1232 @@ -360,8 +360,8 @@ CondVarTestPUU(void *_arg)
1233          PR_Lock(exitlock);
1234          /* Wait for threads to finish */
1235          while(exitcount < arg) {
1236 -            DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1237 -                     PR_GetCurrentThread(), exitcvar, exitcount));
1238 +            DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1239 +                     PR_GetCurrentThread(), exitcvar, (int)exitcount));
1240              PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1241          }
1242          PR_ASSERT(exitcount >= arg);
1243 @@ -371,7 +371,7 @@ CondVarTestPUU(void *_arg)
1244  
1245      /* Join all the threads */
1246      for(index=0; index<(arg); index++)  {
1247 -        DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1248 +        DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1249          PR_JoinThread(list[index].thread);
1250          if (list[index].internal) {
1251              PR_Lock(list[index].lock);
1252 @@ -393,7 +393,7 @@ CondVarTestPUU(void *_arg)
1253  void
1254  CondVarTestPUK(void *_arg)
1255  {
1256 -    PRInt32 arg = (PRInt32)_arg;
1257 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1258      PRInt32 index, loops;
1259      threadinfo *list;
1260      PRLock *sharedlock;
1261 @@ -475,7 +475,7 @@ CondVarTestPUK(void *_arg)
1262  void
1263  CondVarTest(void *_arg)
1264  {
1265 -    PRInt32 arg = (PRInt32)_arg;
1266 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1267      PRInt32 index, loops;
1268      threadinfo *list;
1269      PRLock *sharedlock;
1270 @@ -609,7 +609,7 @@ CondVarTest(void *_arg)
1271  void
1272  CondVarTimeoutTest(void *_arg)
1273  {
1274 -    PRInt32 arg = (PRInt32)_arg;
1275 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1276      PRInt32 index, loops;
1277      threadinfo *list;
1278      PRLock *sharedlock;
1279 @@ -721,7 +721,7 @@ CondVarTimeoutTest(void *_arg)
1280  void
1281  CondVarMixedTest(void *_arg)
1282  {
1283 -    PRInt32 arg = (PRInt32)_arg;
1284 +    PRInt32 arg = (PRInt32)(intptr_t)_arg;
1285      PRInt32 index, loops;
1286      threadinfo *list;
1287      PRLock *sharedlock;
1288 @@ -811,7 +811,7 @@ CondVarMixedTest(void *_arg)
1289          for(index=0; index<(arg*4); index+=3) {
1290  
1291              PR_Lock(list[index].lock);
1292 -            *list[index].tcount++;
1293 +            list[index].tcount++;
1294              PR_NotifyCondVar(list[index].cvar);
1295              PR_Unlock(list[index].lock);
1296  
1297 @@ -883,7 +883,7 @@ static void Measure(void (*func)(void *)
1298      double d;
1299  
1300      start = PR_IntervalNow();
1301 -    (*func)((void *)arg);
1302 +    (*func)((void *)(intptr_t)arg);
1303      stop = PR_IntervalNow();
1304  
1305      d = (double)PR_IntervalToMicroseconds(stop - start);
1306 @@ -948,7 +948,7 @@ This test is run with %d, %d, %d, and %d
1307      PR_SetConcurrency(2);
1308  
1309      for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1310 -        printf("\n%ld Thread tests\n", threads);
1311 +        printf("\n%d Thread tests\n", (int)threads);
1312          Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1313          Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1314          Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1315 --- pr/tests/foreign.c.orig     2019-10-15 14:21:38 UTC
1316 +++ pr/tests/foreign.c
1317 @@ -175,7 +175,7 @@ static void OneShot(void *arg)
1318      PRFileDesc *fd;
1319      PRDir *dir;
1320      PRFileDesc *pair[2];
1321 -    PRIntn test = (PRIntn)arg;
1322 +    intptr_t test = (intptr_t)arg;
1323  
1324      for (test = 0; test < 12; ++test) {
1325  
1326 @@ -271,7 +271,7 @@ static void OneShot(void *arg)
1327  int main(int argc, char **argv)
1328  {
1329      PRStatus rv;
1330 -    PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1331 +    intptr_t    thread_cnt = DEFAULT_THREAD_COUNT;
1332      PLOptStatus os;
1333      PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1334  
1335 --- pr/tests/forktest.c.orig    2019-10-15 14:21:38 UTC
1336 +++ pr/tests/forktest.c
1337 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1338  {
1339      PRNetAddr addr;
1340      PRFileDesc *sock = NULL;
1341 -    PRInt32 tmp = (PRInt32)arg;
1342 +    intptr_t tmp = (intptr_t)arg;
1343  
1344      /*
1345       * Make sure the PR_Accept call will block
1346 @@ -143,7 +143,7 @@ DoIO(void)
1347          goto finish;
1348      }
1349      clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1350 -                                    (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1351 +                                    (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1352                                      PR_JOINABLE_THREAD, 0);
1353      if (clientThread == NULL) {
1354          fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1355 @@ -151,6 +151,9 @@ DoIO(void)
1356          failed_already = 1;
1357          goto finish;
1358      }
1359 +    printf("Wait one second before accept\n");
1360 +    fflush(stdout);
1361 +    PR_Sleep(PR_SecondsToInterval(1));
1362      printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1363      fflush(stdout);
1364      sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1365 --- pr/tests/getai.c.orig       2019-10-15 14:21:38 UTC
1366 +++ pr/tests/getai.c
1367 @@ -13,8 +13,15 @@ int main(int argc, char **argv)
1368      PRAddrInfo *ai;
1369      void *iter;
1370      PRNetAddr addr;
1371 +    const char *host;
1372  
1373 -    ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1374 +    if (argc > 1) {
1375 +        host = argv[1];
1376 +    }
1377 +    else {
1378 +        host = "www.FreeBSD.org";
1379 +    }
1380 +    ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1381      if (ai == NULL) {
1382          fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1383                  PR_GetError(), PR_GetOSError());
1384 --- pr/tests/instrumt.c.orig    2019-10-15 14:21:38 UTC
1385 +++ pr/tests/instrumt.c
1386 @@ -36,6 +36,7 @@
1387  */
1388  
1389  #include <stdio.h>
1390 +#define DEBUG
1391  #include <plstr.h>
1392  #include <prclist.h>
1393  #include <prmem.h>
1394 @@ -50,7 +51,6 @@
1395  #define COUNT_LIMIT  (10 * ( 1024))
1396  
1397  #define SMALL_TRACE_BUFSIZE  ( 60 * 1024 )
1398 -
1399  typedef enum
1400  {
1401      CountLoop = 1,
1402 @@ -78,10 +78,10 @@ static void Help(void)
1403  
1404  static void ListCounters(void)
1405  {
1406 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1407      PR_DEFINE_COUNTER( qh );
1408      PR_DEFINE_COUNTER( rh );
1409      const char *qn, *rn, *dn;
1410 -    const char **qname = &qn, **rname = &rn, **desc = &dn;
1411      PRUint32    tCtr;
1412  
1413      PR_INIT_COUNTER_HANDLE( qh, NULL );
1414 @@ -92,7 +92,7 @@ static void ListCounters(void)
1415          PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1416          while ( rh != NULL )
1417          {
1418 -            PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1419 +            PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1420              PR_GET_COUNTER(tCtr, rh);
1421              PR_LOG( lm, msgLevel,
1422                      ( "QName: %s  RName: %s  Desc: %s  Value: %ld\n",
1423 @@ -101,15 +101,15 @@ static void ListCounters(void)
1424          }
1425          PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1426      }
1427 -    return;
1428 +#endif
1429  } /* end ListCounters() */
1430  
1431  static void ListTraces(void)
1432  {
1433 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1434      PR_DEFINE_TRACE( qh );
1435      PR_DEFINE_TRACE( rh );
1436      const char *qn, *rn, *dn;
1437 -    const char **qname = &qn, **rname = &rn, **desc = &dn;
1438  
1439      PR_INIT_TRACE_HANDLE( qh, NULL );
1440      PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1441 @@ -119,7 +119,7 @@ static void ListTraces(void)
1442          PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1443          while ( rh != NULL )
1444          {
1445 -            PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1446 +            PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1447              PR_LOG( lm, msgLevel,
1448                      ( "QName: %s  RName: %s  Desc: %s",
1449                        qn, rn, dn ));
1450 @@ -127,7 +127,7 @@ static void ListTraces(void)
1451          }
1452          PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1453      }
1454 -    return;
1455 +#endif
1456  } /* end ListCounters() */
1457  
1458  
1459 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1460  */
1461  static void TraceTest( void )
1462  {
1463 -    PRInt32 i;
1464 +    PRIntn i = 0;
1465      PRInt32 size;
1466      PR_DEFINE_TRACE( th );
1467      PRThread *t1, *t2;
1468 --- pr/tests/io_timeout.c.orig  2019-10-15 14:21:38 UTC
1469 +++ pr/tests/io_timeout.c
1470 @@ -22,11 +22,13 @@
1471  /* Used to get the command line option */
1472  #include "plgetopt.h"
1473  
1474 +#include <errno.h>
1475  #include <stdio.h>
1476 +#include <string.h>
1477  #include "nspr.h"
1478  
1479  #define NUM_THREADS 1
1480 -#define BASE_PORT   8000
1481 +#define BASE_PORT   38011
1482  #define DEFAULT_ACCEPT_TIMEOUT 2
1483  
1484  typedef struct threadInfo {
1485 @@ -38,7 +40,7 @@ typedef struct threadInfo {
1486  } threadInfo;
1487  
1488  PRIntn failed_already = 0;
1489 -PRIntn debug_mode = 0;
1490 +PRIntn debug_mode = 1;
1491  
1492  #define LOCAL_SCOPE_STRING          "LOCAL scope"
1493  #define GLOBAL_SCOPE_STRING         "GLOBAL scope"
1494 @@ -54,7 +56,7 @@ thread_main(void *_info)
1495      PRFileDesc *clientSock;
1496      PRStatus rv;
1497      PRThreadScope tscope;
1498 -    char *scope_str;
1499 +    const char *scope_str;
1500  
1501  
1502      if (debug_mode) {
1503 @@ -74,6 +76,7 @@ thread_main(void *_info)
1504              break;
1505          default:
1506              PR_NOT_REACHED("Invalid thread scope");
1507 +            scope_str = NULL;
1508              break;
1509      }
1510      printf("thread id %d, scope %s\n", info->id, scope_str);
1511 @@ -92,8 +95,12 @@ thread_main(void *_info)
1512      listenAddr.inet.ip = PR_htonl(PR_INADDR_ANY);
1513      rv = PR_Bind(listenSock, &listenAddr);
1514      if (rv == PR_FAILURE) {
1515 -        if (debug_mode) {
1516 -            printf("unable to bind\n");
1517 +        if (debug_mode)
1518 +            printf("unable to bind to %d: %s\n",
1519 +                   BASE_PORT + info->id, strerror(PR_GetOSError()));
1520 +        if (PR_GetOSError() == EADDRINUSE) {
1521 +            printf("can not proceed with this test\n");
1522 +            exit(0);
1523          }
1524          failed_already=1;
1525          goto dead;
1526 @@ -117,8 +124,9 @@ thread_main(void *_info)
1527      if (clientSock == NULL) {
1528          if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
1529              if (debug_mode) {
1530 -                printf("PR_Accept() timeout worked!\n");
1531 -                printf("TEST PASSED! PR_Accept() returned error %d\n",
1532 +                printf("PR_Accept() timeout worked!\n"
1533 +                       "TEST PASSED! PR_Accept() returned error "
1534 +                       "PR_IO_TIMEOUT_ERROR (%ld)\n",
1535                         PR_IO_TIMEOUT_ERROR);
1536              }
1537          } else {
1538 --- pr/tests/layer.c.orig       2019-10-15 14:21:38 UTC
1539 +++ pr/tests/layer.c
1540 @@ -45,7 +45,10 @@ static PRUint16 default_port = 12273;
1541  static PRFileDesc *PushLayer(PRFileDesc *stack)
1542  {
1543      PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
1544 -    PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1545 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
1546 +    PRStatus rv = /* we only need rv for PR_ASSERT() */
1547 +#endif
1548 +        PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1549      if (verbosity > quiet) {
1550          PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
1551      }
1552 --- pr/tests/lazyinit.c.orig    2019-10-15 14:21:38 UTC
1553 +++ pr/tests/lazyinit.c
1554 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
1555      char *path = NULL;
1556      PRDir *dir = NULL;
1557      PRLock *ml = NULL;
1558 -    PRCondVar *cv = NULL;
1559      PRThread *thread = NULL;
1560      PRIntervalTime interval = 0;
1561      PRFileDesc *file, *udp, *tcp, *pair[2];
1562 --- pr/tests/lltest.c.orig      2019-10-15 14:21:38 UTC
1563 +++ pr/tests/lltest.c
1564 @@ -651,6 +651,7 @@ TestConversion( void )
1565      return;
1566  }
1567  
1568 +#if 0
1569  static void ShiftCompileOnly()
1570  {
1571      /*
1572 @@ -667,6 +668,7 @@ static void ShiftCompileOnly()
1573      LL_ISHL(ia, 49, 32);
1574  
1575  }  /* ShiftCompileOnly */
1576 +#endif
1577  
1578  
1579  /*
1580 @@ -751,7 +753,6 @@ TestArithmetic( void )
1581      PRInt64 largeValPlusOne   = LL_INIT( 0x00000002, 0x00000000 );
1582      PRInt64 largeValTimesTwo  = LL_INIT( 0x00000003, 0xfffffffe );
1583      PRInt64 largeMultCand     = LL_INIT( 0x00000000, 0x7fffffff );
1584 -    PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
1585      PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
1586      PRInt64 largeNumSHL5      = LL_INIT( 0x0000001f, 0xffffffe0 );
1587      PRInt64 result, result2;
1588 --- pr/tests/mbcs.c.orig        2019-10-15 14:21:38 UTC
1589 +++ pr/tests/mbcs.c
1590 @@ -54,13 +54,12 @@ char *dirName =  NULL;  /* directory nam
1591  /*
1592  ** Traverse directory
1593  */
1594 -static void TraverseDirectory( unsigned char *dir )
1595 +static void TraverseDirectory(const char *dir)
1596  {
1597      PRDir *cwd;
1598      PRDirEntry *dirEntry;
1599      PRFileInfo info;
1600      PRStatus rc;
1601 -    PRInt32 err;
1602      PRFileDesc *fd;
1603      char    nextDir[256];
1604      char    file[256];
1605 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
1606              exit(1);
1607          }
1608          if ( PR_FILE_FILE == info.type )  {
1609 -            printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
1610 +            printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
1611              fd = PR_Open( file, PR_RDONLY, 0 );
1612              if ( NULL == fd )  {
1613                  printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
1614 -                       PR_GetError(), PR_GetOSError());
1615 +                       (long)PR_GetError(), (long)PR_GetOSError());
1616              }
1617              rc = PR_Close( fd );
1618              if ( PR_FAILURE == rc )  {
1619                  printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
1620 -                       PR_GetError(), PR_GetOSError());
1621 +                       (long)PR_GetError(), (long)PR_GetOSError());
1622              }
1623          } else if ( PR_FILE_DIRECTORY == info.type ) {
1624              sprintf( nextDir, "%s/%s", dir, dirEntry->name );
1625 --- pr/tests/nbconn.c.orig      2019-10-15 14:21:38 UTC
1626 +++ pr/tests/nbconn.c
1627 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
1628      PRStatus rv;
1629      PRSocketOptionData optData;
1630      const char *hostname = NULL;
1631 -    PRIntn default_case, n, bytes_read, bytes_sent;
1632 -    PRInt32 failed_already = 0;
1633 +    PRIntn default_case, n;
1634  
1635      /*
1636       * -d           debug mode
1637 @@ -169,7 +168,7 @@ int main(int argc, char **argv)
1638                  exit(1);
1639              }
1640              printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1641 -                    PR_GetError(), PR_GetOSError());
1642 +                    (long)PR_GetError(), (long)PR_GetOSError());
1643          }
1644          PR_Close(sock);
1645          printf( "PASS\n");
1646 @@ -240,7 +239,7 @@ connection_success_test()
1647      PRThread *thr = NULL;
1648      Server_Param sp;
1649      char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
1650 -    PRIntn default_case, n, bytes_read, bytes_sent;
1651 +    PRIntn n, bytes_read, bytes_sent;
1652      PRIntn failed_already = 0;
1653  
1654      /*
1655 @@ -317,7 +316,7 @@ connection_success_test()
1656          failed_already=1;
1657          goto def_exit;
1658      }
1659 -    DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
1660 +    DPRINTF(("Created TCP_Server thread [%p]\n", thr));
1661      pd.fd = conn_fd;
1662      pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
1663      n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
1664 @@ -396,7 +395,7 @@ connection_success_test()
1665          DPRINTF(("Data integrity verified\n"));
1666      } else {
1667          fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1668 -                PR_GetError(), PR_GetOSError());
1669 +                (long)PR_GetError(), (long)PR_GetOSError());
1670          failed_already = 1;
1671          goto def_exit;
1672      }
1673 @@ -505,7 +504,6 @@ connection_failure_test()
1674          goto def_exit;
1675      }
1676      if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
1677 -        PRInt32 rv;
1678          fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
1679          failed_already = 1;
1680          goto def_exit;
1681 --- pr/tests/nblayer.c.orig     2019-10-15 14:21:38 UTC
1682 +++ pr/tests/nblayer.c
1683 @@ -348,7 +348,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
1684  static PRInt16 PR_CALLBACK MyPoll(
1685      PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
1686  {
1687 -    PRInt16 my_flags, new_flags;
1688 +    PRInt16 my_flags = -1, new_flags;
1689      PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
1690      if (0 != (PR_POLL_READ & in_flags))
1691      {
1692 @@ -393,7 +393,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
1693      PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
1694  {
1695      PRStatus rv;
1696 -    PRFileDesc *newfd, *layer = fd;
1697 +    PRFileDesc *newfd;
1698      PRFileDesc *newstack;
1699      PRFilePrivate *newsecret;
1700  
1701 @@ -495,6 +495,8 @@ static PRInt32 PR_CALLBACK MyRecv(
1702                  mine->rcvinprogress = 0;
1703                  return mine->rcvreq;  /* << -- that's it! */
1704              default:
1705 +                PR_ASSERT(!"How did I get this mine->rcvstate?");
1706 +                rv = -1;
1707                  break;
1708          }
1709      } while (-1 != rv);
1710 @@ -563,6 +565,8 @@ static PRInt32 PR_CALLBACK MySend(
1711                  mine->xmtinprogress = 0;
1712                  return mine->xmtreq;  /* <<-- That's the one! */
1713              default:
1714 +                PR_ASSERT(!"How did I get this mine->xmtstate?");
1715 +                rv = -1;
1716                  break;
1717          }
1718      } while (-1 != rv);
1719 --- pr/tests/nonblock.c.orig    2019-10-15 14:21:38 UTC
1720 +++ pr/tests/nonblock.c
1721 @@ -37,7 +37,7 @@
1722  static void PR_CALLBACK
1723  clientThreadFunc(void *arg)
1724  {
1725 -    PRUintn port = (PRUintn)arg;
1726 +    intptr_t port = (intptr_t)arg;
1727      PRFileDesc *sock;
1728      PRNetAddr addr;
1729      char buf[CHUNK_SIZE];
1730 @@ -145,7 +145,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1731      printf("%s", buf);
1732  
1733      clientThread = PR_CreateThread(PR_USER_THREAD,
1734 -                                   clientThreadFunc, (void *) listenPort,
1735 +                                   clientThreadFunc, (void *) (intptr_t)listenPort,
1736                                     PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1737                                     PR_UNJOINABLE_THREAD, 0);
1738      if (clientThread == NULL) {
1739 @@ -189,7 +189,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1740          if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
1741              PL_PrintError("First Receive:\n");
1742              fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
1743 -                    retVal, PR_GetError());
1744 +                    (long)retVal, (long)PR_GetError());
1745              exit(1);
1746          }
1747          printf("read: EWOULDBLOCK, good\n");
1748 @@ -199,7 +199,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1749          if (retVal != CHUNK_SIZE) {
1750              PL_PrintError("Second Receive:\n");
1751              fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
1752 -                    retVal, PR_GetError());
1753 +                    (long)retVal, (long)PR_GetError());
1754              exit(1);
1755          }
1756          printf("read: %d bytes, good\n", retVal);
1757 --- pr/tests/obsints.c.orig     2019-10-15 14:21:38 UTC
1758 +++ pr/tests/obsints.c
1759 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
1760  #else /* NO_NSPR_10_SUPPORT */
1761  
1762  #include "prtypes.h"  /* which includes protypes.h */
1763 +#if !defined(__GNUC__)
1764 +#   define __unused
1765 +#endif
1766  
1767  int main(int argc, char **argv)
1768  {
1769 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
1770       * Compilation fails if any of these integer types are not
1771       * defined by protypes.h.
1772       */
1773 -    intn in;
1774 -    uintn uin;
1775 -    uint ui;
1776 -    int8 i8;
1777 -    uint8 ui8;
1778 -    int16 i16;
1779 -    uint16 ui16;
1780 -    int32 i32;
1781 -    uint32 ui32;
1782 -    int64 i64;
1783 -    uint64 ui64;
1784 +    intn in __unused;
1785 +    uintn uin __unused;
1786 +    uint ui __unused;
1787 +    int8 i8 __unused;
1788 +    uint8 ui8 __unused;
1789 +    int16 i16 __unused;
1790 +    uint16 ui16 __unused;
1791 +    int32 i32 __unused;
1792 +    uint32 ui32 __unused;
1793 +    int64 i64 __unused;
1794 +    uint64 ui64 __unused;
1795  
1796      printf("PASS\n");
1797      return 0;
1798 --- pr/tests/parsetm.c.orig     2019-10-15 14:21:38 UTC
1799 +++ pr/tests/parsetm.c
1800 @@ -32,8 +32,8 @@ static void PrintExplodedTime(const PREx
1801  
1802      /* Print day of the week, month, day, hour, minute, and second */
1803      if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
1804 -                               dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
1805 -                               et->tm_hour, et->tm_min, et->tm_sec);
1806 +                               dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
1807 +                               (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
1808  
1809      /* Print time zone */
1810      totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
1811 @@ -50,7 +50,7 @@ static void PrintExplodedTime(const PREx
1812          hourOffset = totalOffset / 3600;
1813          minOffset = (totalOffset % 3600) / 60;
1814          if (debug_mode) {
1815 -            printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
1816 +            printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
1817          }
1818      }
1819  
1820 --- pr/tests/peek.c.orig        2019-10-15 14:21:38 UTC
1821 +++ pr/tests/peek.c
1822 @@ -137,7 +137,7 @@ static void ClientNB(void *arg)
1823  {
1824      PRFileDesc *sock;
1825      PRSocketOptionData opt;
1826 -    PRUint16 port = (PRUint16) arg;
1827 +    PRUint16 port = (intptr_t) arg;
1828      PRNetAddr addr;
1829      char buf[BUFFER_SIZE];
1830      PRPollDesc pd;
1831 @@ -301,7 +301,7 @@ RunTest(PRThreadScope scope, PRFileDesc
1832          exit(1);
1833      }
1834      client = PR_CreateThread(
1835 -                 PR_USER_THREAD, ClientNB, (void *) port,
1836 +                 PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
1837                   PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
1838      if (NULL == client) {
1839          fprintf(stderr, "PR_CreateThread failed\n");
1840 --- pr/tests/perf.c.orig        2019-10-15 14:21:38 UTC
1841 +++ pr/tests/perf.c
1842 @@ -142,7 +142,7 @@ static void PR_CALLBACK CXReader(void *a
1843      n = count / 2;
1844      for (i = 0; i < n; i++) {
1845          while (cxq == 0) {
1846 -            DPRINTF(("CXReader: thread = 0x%lx waiting\n",
1847 +            DPRINTF(("CXReader: thread = %p waiting\n",
1848                       PR_GetCurrentThread()));
1849              PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1850          }
1851 @@ -155,7 +155,7 @@ static void PR_CALLBACK CXReader(void *a
1852      --alive;
1853      PR_Notify(mon2);
1854      PR_ExitMonitor(mon2);
1855 -    DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1856 +    DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
1857  }
1858  
1859  static void PR_CALLBACK CXWriter(void *arg)
1860 @@ -166,7 +166,7 @@ static void PR_CALLBACK CXWriter(void *a
1861      n = count / 2;
1862      for (i = 0; i < n; i++) {
1863          while (cxq == 1) {
1864 -            DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
1865 +            DPRINTF(("CXWriter: thread = %p waiting\n",
1866                       PR_GetCurrentThread()));
1867              PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1868          }
1869 @@ -179,7 +179,7 @@ static void PR_CALLBACK CXWriter(void *a
1870      --alive;
1871      PR_Notify(mon2);
1872      PR_ExitMonitor(mon2);
1873 -    DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1874 +    DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
1875  }
1876  
1877  static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
1878 @@ -199,7 +199,7 @@ static void ContextSwitch(PRThreadScope
1879      if (NULL == t1) {
1880          fprintf(stderr, "ContextSwitch: cannot create thread\n");
1881      } else {
1882 -        DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1883 +        DPRINTF(("ContextSwitch: created %s thread = %p\n",
1884                   (scope1 == PR_GLOBAL_THREAD ?
1885                    "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1886                   t1));
1887 @@ -213,7 +213,7 @@ static void ContextSwitch(PRThreadScope
1888      if (NULL == t2) {
1889          fprintf(stderr, "ContextSwitch: cannot create thread\n");
1890      } else {
1891 -        DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1892 +        DPRINTF(("ContextSwitch: created %s thread = %p\n",
1893                   (scope2 == PR_GLOBAL_THREAD ?
1894                    "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1895                   t2));
1896 @@ -255,10 +255,10 @@ static void PR_CALLBACK SemaThread(void
1897  
1898      n = count / 2;
1899      for (i = 0; i < n; i++) {
1900 -        DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
1901 +        DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
1902                   PR_GetCurrentThread(), sem[0]));
1903          PR_WaitSem(sem[0]);
1904 -        DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
1905 +        DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
1906                   PR_GetCurrentThread(), sem[1]));
1907          PR_PostSem(sem[1]);
1908      }
1909 @@ -267,7 +267,7 @@ static void PR_CALLBACK SemaThread(void
1910      --alive;
1911      PR_Notify(mon2);
1912      PR_ExitMonitor(mon2);
1913 -    DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1914 +    DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
1915  }
1916  
1917  static  PRSemaphore *sem_set1[2];
1918 @@ -295,7 +295,7 @@ static void SemaContextSwitch(PRThreadSc
1919      if (NULL == t1) {
1920          fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1921      } else {
1922 -        DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1923 +        DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1924                   (scope1 == PR_GLOBAL_THREAD ?
1925                    "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1926                   t1));
1927 @@ -310,7 +310,7 @@ static void SemaContextSwitch(PRThreadSc
1928      if (NULL == t2) {
1929          fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1930      } else {
1931 -        DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1932 +        DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1933                   (scope2 == PR_GLOBAL_THREAD ?
1934                    "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1935                   t2));
1936 --- pr/tests/pipepong.c.orig    2019-10-15 14:21:38 UTC
1937 +++ pr/tests/pipepong.c
1938 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
1939          nBytes = fread(buf, 1, 5, stdin);
1940          fprintf(stderr, "pong process: received \"%s\"\n", buf);
1941          if (nBytes != 5) {
1942 -            fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
1943 +            fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
1944                      nBytes);
1945              exit(1);
1946          }
1947 --- pr/tests/poll_nm.c.orig     2019-10-15 14:21:38 UTC
1948 +++ pr/tests/poll_nm.c
1949 @@ -47,7 +47,7 @@ PRIntn debug_mode;
1950  static void PR_CALLBACK
1951  clientThreadFunc(void *arg)
1952  {
1953 -    PRUintn port = (PRUintn) arg;
1954 +    PRUintn port = (intptr_t) arg;
1955      PRFileDesc *sock;
1956      PRNetAddr addr;
1957      char buf[128];
1958 @@ -200,7 +200,7 @@ int main(int argc, char **argv)
1959      npds = 5;
1960  
1961      clientThread = PR_CreateThread(PR_USER_THREAD,
1962 -                                   clientThreadFunc, (void *) listenPort1,
1963 +                                   clientThreadFunc, (void *)(intptr_t)listenPort1,
1964                                     PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1965                                     PR_UNJOINABLE_THREAD, 0);
1966      if (clientThread == NULL) {
1967 @@ -210,7 +210,7 @@ int main(int argc, char **argv)
1968      }
1969  
1970      clientThread = PR_CreateThread(PR_USER_THREAD,
1971 -                                   clientThreadFunc, (void *) listenPort2,
1972 +                                   clientThreadFunc, (void *)(intptr_t)listenPort2,
1973                                     PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1974                                     PR_UNJOINABLE_THREAD, 0);
1975      if (clientThread == NULL) {
1976 --- pr/tests/prfz.c.orig        2019-10-15 14:21:38 UTC
1977 +++ pr/tests/prfz.c
1978 @@ -7,7 +7,7 @@
1979   */
1980  
1981  #include "prprf.h"
1982 -#include <sys/types.h>
1983 +#include <stdint.h>
1984  #include <limits.h>
1985  #include <string.h>
1986  #include <stdint.h>
1987 --- pr/tests/provider.c.orig    2019-10-15 14:21:38 UTC
1988 +++ pr/tests/provider.c
1989 @@ -1067,7 +1067,7 @@ int main(int argc, char **argv)
1990  {
1991      PRUintn index;
1992      PRBool boolean;
1993 -    CSClient_t *client;
1994 +    CSClient_t *client = NULL;
1995      PRStatus rv, joinStatus;
1996      CSServer_t *server = NULL;
1997      char *thread_type;
1998 --- pr/tests/prpoll.c.orig      2019-10-15 14:21:38 UTC
1999 +++ pr/tests/prpoll.c
2000 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
2001  static void
2002  clientThreadFunc(void *arg)
2003  {
2004 -    PRUint16 port = (PRUint16) arg;
2005 +    PRUint16 port = (PRUint16)(uintptr_t)arg;
2006      PRFileDesc *sock;
2007      PRNetAddr addr;
2008      char buf[BUF_SIZE];
2009 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
2010      PRInt32 rv;
2011      PROsfd sd;
2012      struct sockaddr_in saddr;
2013 -    PRIntn saddr_len;
2014 +    socklen_t saddr_len;
2015      PRUint16 listenPort3;
2016      PRFileDesc *socket_poll_fd;
2017      PRIntn i, j;
2018 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
2019      npds--;
2020  
2021      clientThread = PR_CreateThread(PR_USER_THREAD,
2022 -                                   clientThreadFunc, (void *) listenPort1,
2023 +                                   clientThreadFunc, (void *)(uintptr_t)listenPort1,
2024                                     PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2025                                     PR_UNJOINABLE_THREAD, 0);
2026      if (clientThread == NULL) {
2027 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2028      }
2029  
2030      clientThread = PR_CreateThread(PR_USER_THREAD,
2031 -                                   clientThreadFunc, (void *) listenPort2,
2032 +                                   clientThreadFunc, (void *)(uintptr_t)listenPort2,
2033                                     PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2034                                     PR_UNJOINABLE_THREAD, 0);
2035      if (clientThread == NULL) {
2036 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2037      }
2038  
2039      clientThread = PR_CreateThread(PR_USER_THREAD,
2040 -                                   clientThreadFunc, (void *) listenPort3,
2041 +                                   clientThreadFunc, (void *)(uintptr_t)listenPort3,
2042                                     PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2043                                     PR_UNJOINABLE_THREAD, 0);
2044      if (clientThread == NULL) {
2045 --- pr/tests/randseed.c.orig    2019-10-15 14:21:38 UTC
2046 +++ pr/tests/randseed.c
2047 @@ -48,7 +48,6 @@ static void Help( void )
2048  static void PrintRand( void *buf, PRIntn size )
2049  {
2050      PRUint32 *rp = buf;
2051 -    PRIntn   i;
2052  
2053      printf("%4.4d--\n", size );
2054      while (size > 0 ) {
2055 --- pr/tests/ranfile.c.orig     2019-10-15 14:21:38 UTC
2056 +++ pr/tests/ranfile.c
2057 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2058      PRStatus rv = PR_SUCCESS;
2059      Hammer_t *cd = (Hammer_t*)arg;
2060  
2061 -    (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2062 +    (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2063  
2064      if (debug_mode) {
2065          printf("Starting work on %s\n", filename);
2066 @@ -405,8 +405,8 @@ int main(int argc, char **argv)
2067                      durationTot += duration;
2068                  }
2069                  else if (debug_mode) printf(
2070 -                        "%s: test failed %s after %ld seconds\n",
2071 -                        programName, where[hammer[poll].problem], duration);
2072 +                        "%s: test failed %s after %d seconds\n",
2073 +                        programName, where[hammer[poll].problem], (int)duration);
2074                  else {
2075                      failed_already=1;
2076                  }
2077 @@ -414,7 +414,7 @@ int main(int argc, char **argv)
2078          }
2079      }
2080      if (debug_mode) printf(
2081 -            "%s: [%ld [%ld] %ld] writes/sec average\n",
2082 +            "%s: [%d [%d] %d] writes/sec average\n",
2083              programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2084  
2085      PR_DestroyCondVar(cv);
2086 --- pr/tests/runtests.sh.orig   2019-10-15 14:21:38 UTC
2087 +++ pr/tests/runtests.sh
2088 @@ -56,9 +56,6 @@ fi
2089  # Tests not run (but should)
2090  #
2091  
2092 -#forktest (failed on IRIX)
2093 -#nbconn - fails on some platforms 
2094 -#poll_er - fails on some platforms? limited use?
2095  #prpoll -  the bad-FD test needs to be moved to a different test
2096  #sleep -  specific to OS/2
2097  
2098 @@ -91,6 +88,7 @@ exit
2099  fdcach
2100  fileio
2101  foreign
2102 +forktest
2103  formattm
2104  fsync
2105  gethost
2106 @@ -98,7 +96,6 @@ getproto
2107  i2l
2108  initclk
2109  inrval
2110 -instrumt
2111  intrio
2112  intrupt
2113  io_timeout
2114 @@ -119,6 +116,7 @@ logger
2115  many_cv
2116  multiwait
2117  nameshm1
2118 +nbconn
2119  nblayer
2120  nonblock
2121  ntioto
2122 @@ -135,6 +133,7 @@ perf
2123  pipeping
2124  pipeping2
2125  pipeself
2126 +poll_er
2127  poll_nm
2128  poll_to
2129  pollable
2130 @@ -207,7 +206,7 @@ OBJDIR=`basename $PWD`
2131  printf "\nNSPR Test Results - $OBJDIR\n\n"
2132  printf "BEGIN\t\t\t`date`\n"
2133  printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2134 -printf "Test\t\t\tResult\n\n"
2135 +printf "            Test\t\t\tResult\n\n"
2136  if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2137         for prog in $TESTS
2138         do
2139 @@ -225,10 +224,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2140  else
2141         for prog in $TESTS
2142         do
2143 -               printf "$prog"
2144 -               printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2145 -               export test_rval
2146 -               ./$prog >> ${LOGFILE} 2>&1 &
2147 +               printf %16s $prog
2148 +               ./$prog >> $prog.output 2>&1 &
2149                 test_pid=$!
2150                 sleep_pid=0
2151                 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2152 @@ -243,28 +240,11 @@ else
2153                         printf "\t\t\tPassed\n";
2154                 else
2155                         printf "\t\t\tFAILED\n";
2156 +                       sed "s,^,       $prog:  ," < $prog.output
2157                         rval=1
2158                 fi;
2159 -               printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2160         done
2161  fi;
2162  
2163  printf "END\t\t\t`date`\n"
2164  exit $rval
2165 -
2166 -
2167 -
2168 -
2169 -
2170 -
2171 -
2172 -
2173 -
2174 -
2175 -
2176 -
2177 -
2178 -
2179 -
2180 -
2181 -
2182 --- pr/tests/sel_spd.c.orig     2019-10-15 14:21:38 UTC
2183 +++ pr/tests/sel_spd.c
2184 @@ -15,23 +15,26 @@
2185  #include <stdio.h>
2186  #include <errno.h>
2187  #include <string.h>
2188 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2189 +#   include <unistd.h>  /* getopt(3) */
2190 +#endif
2191  
2192  #define PORT_BASE 19000
2193  
2194  typedef struct timer_slot_t {
2195 -    unsigned long d_connect;
2196 -    unsigned long d_cl_data;
2197 -    unsigned long d_sv_data;
2198 -    unsigned long d_close;
2199 -    unsigned long d_total;
2200 -    unsigned long requests;
2201 +    unsigned int d_connect;
2202 +    unsigned int d_cl_data;
2203 +    unsigned int d_sv_data;
2204 +    unsigned int d_close;
2205 +    unsigned int d_total;
2206 +    unsigned int requests;
2207  } timer_slot_t;
2208  
2209 -static long _iterations = 5;
2210 -static long _client_data = 8192;
2211 +static int _iterations = 5;
2212 +static int _client_data = 8192;
2213  
2214 -static long _server_data = (128*1024);
2215 -static long _threads_max = 10, _threads = 10;
2216 +static int _server_data = (128*1024);
2217 +static int _threads_max = 10, _threads = 10;
2218  
2219  static int verbose=0;
2220  static PRMonitor *exit_cv;
2221 @@ -88,7 +91,7 @@ _server_thread(void *arg_id)
2222      void _client_thread(void *);
2223      PRThread *thread;
2224      int *id =  (int *)arg_id;
2225 -    PRFileDesc *sock;
2226 +    PRFileDesc *sock = NULL;
2227      PRSocketOptionData sockopt;
2228      PRNetAddr sa;
2229      PRFileDesc * newsock;
2230 @@ -467,12 +470,12 @@ void
2231  tally_results(int verbose)
2232  {
2233      int index;
2234 -    unsigned long tot_connect = 0;
2235 -    unsigned long tot_cl_data = 0;
2236 -    unsigned long tot_sv_data = 0;
2237 -    unsigned long tot_close = 0;
2238 -    unsigned long tot_all = 0;
2239 -    unsigned long tot_requests = 0;
2240 +    unsigned int tot_connect = 0;
2241 +    unsigned int tot_cl_data = 0;
2242 +    unsigned int tot_sv_data = 0;
2243 +    unsigned int tot_close = 0;
2244 +    unsigned int tot_all = 0;
2245 +    unsigned int tot_requests = 0;
2246  
2247      fprintf(stdout, "Server results:\n\n");
2248      for (index=0; index<_threads_max*2; index+=2) {
2249 --- pr/tests/selct_nm.c.orig    2019-10-15 14:21:38 UTC
2250 +++ pr/tests/selct_nm.c
2251 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2252  static void
2253  clientThreadFunc(void *arg)
2254  {
2255 -    PRUintn port = (PRUintn) arg;
2256 +    PRUintn port = (PRUintn)(uintptr_t)arg;
2257      PRFileDesc *sock;
2258      PRNetAddr addr;
2259      char buf[128];
2260 @@ -169,7 +169,7 @@ int main(int argc, char **argv)
2261      }
2262  
2263      clientThread = PR_CreateThread(PR_USER_THREAD,
2264 -                                   clientThreadFunc, (void *) listenPort1,
2265 +                                   clientThreadFunc, (void *)(uintptr_t)listenPort1,
2266                                     PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2267                                     PR_UNJOINABLE_THREAD, 0);
2268      if (clientThread == NULL) {
2269 @@ -179,7 +179,7 @@ int main(int argc, char **argv)
2270      }
2271  
2272      clientThread = PR_CreateThread(PR_USER_THREAD,
2273 -                                   clientThreadFunc, (void *) listenPort2,
2274 +                                   clientThreadFunc, (void *)(uintptr_t)listenPort2,
2275                                     PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2276                                     PR_UNJOINABLE_THREAD, 0);
2277      if (clientThread == NULL) {
2278 --- pr/tests/select2.c.orig     2019-10-15 14:21:38 UTC
2279 +++ pr/tests/select2.c
2280 @@ -53,6 +53,7 @@ PRInt32 count;
2281  **
2282  ***********************************************************************/
2283  
2284 +static int exitcode = 2;
2285  
2286  static void Test_Result (int result)
2287  {
2288 @@ -60,9 +61,13 @@ static void Test_Result (int result)
2289      {
2290          case PASS:
2291              printf ("PASS\n");
2292 +            if (exitcode == 2) {
2293 +                exitcode = 0;
2294 +            }
2295              break;
2296          case FAIL:
2297              printf ("FAIL\n");
2298 +            exitcode = 1;
2299              break;
2300          default:
2301              printf ("NOSTATUS\n");
2302 @@ -382,4 +387,5 @@ int main(int argc, char **argv)
2303      PR_Cleanup();
2304  
2305  
2306 +    return exitcode;
2307  }
2308 --- pr/tests/semaerr.c.orig     2019-10-15 14:21:38 UTC
2309 +++ pr/tests/semaerr.c
2310 @@ -61,7 +61,7 @@ int main(int argc, char **argv)
2311          exit(1);
2312      }
2313      if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2314 -        fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2315 +        fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2316                  PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2317          exit(1);
2318      }
2319 --- pr/tests/semaerr1.c.orig    2019-10-15 14:21:38 UTC
2320 +++ pr/tests/semaerr1.c
2321 @@ -72,7 +72,7 @@ int main(int argc, char **argv)
2322          exit(1);
2323      }
2324      if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2325 -        fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2326 +        fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2327                  PR_GetError());
2328          exit(1);
2329      }
2330 --- pr/tests/sendzlf.c.orig     2019-10-15 14:21:38 UTC
2331 +++ pr/tests/sendzlf.c
2332 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2333  {
2334      PRFileDesc *sock;
2335      PRNetAddr addr;
2336 -    PRUint16 port = (PRUint16) arg;
2337 +    PRUint16 port = (PRUint16)(uintptr_t)arg;
2338      char buf[1024];
2339      char *bufPtr;
2340      PRInt32 nbytes;
2341 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2342      }
2343  
2344      clientThread = PR_CreateThread(PR_USER_THREAD,
2345 -                                   ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2346 +                                   ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2347                                     PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2348      if (NULL == clientThread) {
2349          fprintf(stderr, "PR_CreateThread failed\n");
2350 --- pr/tests/server_test.c.orig 2019-10-15 14:21:38 UTC
2351 +++ pr/tests/server_test.c
2352 @@ -61,7 +61,7 @@ PRCondVar *ServerStateCV;
2353  #ifdef DEBUGPRINTS
2354  #define DPRINTF printf
2355  #else
2356 -#define DPRINTF
2357 +#define DPRINTF(...)
2358  #endif
2359  
2360  
2361 @@ -582,6 +582,7 @@ static void do_workUU(void)
2362      do_work();
2363  }
2364  
2365 +#if 0
2366  static void do_workUK(void)
2367  {
2368      ServerScope = PR_LOCAL_THREAD;
2369 @@ -602,6 +603,7 @@ static void do_workKK(void)
2370      ClientScope = PR_GLOBAL_THREAD;
2371      do_work();
2372  }
2373 +#endif
2374  
2375  
2376  static void Measure(void (*func)(void), const char *msg)
2377 --- pr/tests/servr_kk.c.orig    2019-10-15 14:21:38 UTC
2378 +++ pr/tests/servr_kk.c
2379 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2380  #ifdef DEBUGPRINTS
2381  #define DPRINTF printf
2382  #else
2383 -#define DPRINTF
2384 +#define DPRINTF(...)
2385  #endif
2386  
2387  PRIntn failed_already=0;
2388 @@ -539,6 +539,7 @@ void do_work()
2389      PR_JoinThread(ServerThread);
2390  }
2391  
2392 +#if 0
2393  static void do_workUU(void)
2394  {
2395      ServerScope = PR_LOCAL_THREAD;
2396 @@ -559,6 +560,7 @@ static void do_workKU(void)
2397      ClientScope = PR_LOCAL_THREAD;
2398      do_work();
2399  }
2400 +#endif
2401  
2402  static void do_workKK(void)
2403  {
2404 --- pr/tests/servr_ku.c.orig    2019-10-15 14:21:38 UTC
2405 +++ pr/tests/servr_ku.c
2406 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2407  #ifdef DEBUGPRINTS
2408  #define DPRINTF printf
2409  #else
2410 -#define DPRINTF
2411 +#define DPRINTF(...)
2412  #endif
2413  
2414  PRIntn failed_already=0;
2415 --- pr/tests/servr_uk.c.orig    2019-10-15 14:21:38 UTC
2416 +++ pr/tests/servr_uk.c
2417 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2418  #ifdef DEBUGPRINTS
2419  #define DPRINTF printf
2420  #else
2421 -#define DPRINTF
2422 +#define DPRINTF(...)
2423  #endif
2424  
2425  PRIntn failed_already=0;
2426 --- pr/tests/servr_uu.c.orig    2019-10-15 14:21:38 UTC
2427 +++ pr/tests/servr_uu.c
2428 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2429  #ifdef DEBUGPRINTS
2430  #define DPRINTF printf
2431  #else
2432 -#define DPRINTF
2433 +#define DPRINTF(...)
2434  #endif
2435  
2436  PRIntn failed_already=0;
2437 --- pr/tests/short_thread.c.orig        2019-10-15 14:21:38 UTC
2438 +++ pr/tests/short_thread.c
2439 @@ -45,7 +45,7 @@ int main (int argc, char **argv)
2440                                 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2441          == NULL ) {
2442          fprintf(stderr,
2443 -                "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2444 +                "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2445                  PR_GetError(), PR_GetOSError());
2446          exit( 1 );
2447      }
2448 --- pr/tests/socket.c.orig      2019-10-15 14:21:38 UTC
2449 +++ pr/tests/socket.c
2450 @@ -173,7 +173,9 @@ readn(PRFileDesc *sockfd, char *buf, int
2451      int rem;
2452      int bytes;
2453      int offset = 0;
2454 +#ifdef WINNT
2455      int err;
2456 +#endif
2457      PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2458  
2459      if (test_cancelio) {
2460 @@ -181,12 +183,14 @@ readn(PRFileDesc *sockfd, char *buf, int
2461      }
2462  
2463      for (rem=len; rem; offset += bytes, rem -= bytes) {
2464 -        DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2465 +        DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2466                   PR_GetCurrentThread(), rem));
2467 +#ifdef WINNT
2468  retry:
2469 +#endif
2470          bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2471                          timeout);
2472 -        DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2473 +        DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2474                   PR_GetCurrentThread(), bytes));
2475          if (bytes < 0) {
2476  #ifdef WINNT
2477 @@ -218,11 +222,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2478      int offset = 0;
2479  
2480      for (rem=len; rem; offset += bytes, rem -= bytes) {
2481 -        DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2482 +        DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2483                   PR_GetCurrentThread(), rem));
2484          bytes = PR_Send(sockfd, buf + offset, rem, 0,
2485                          PR_INTERVAL_NO_TIMEOUT);
2486 -        DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2487 +        DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2488                   PR_GetCurrentThread(), bytes));
2489          if (bytes <= 0) {
2490              return -1;
2491 @@ -272,7 +276,7 @@ Serve_Client(void *arg)
2492              if (PR_Shutdown(sockfd, PR_SHUTDOWN_RCV) < 0) {
2493                  fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2494              }
2495 -        DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2496 +        DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2497                   (*((int *) in_buf->data))));
2498          if (writen(sockfd, in_buf->data, bytes) < bytes) {
2499              fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2500 @@ -414,7 +418,7 @@ TCP_Server(void *arg)
2501          goto exit;
2502      }
2503  
2504 -    DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2505 +    DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2506               netaddr.inet.ip, netaddr.inet.port));
2507      if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2508                        PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2509 @@ -466,7 +470,7 @@ TCP_Server(void *arg)
2510              failed_already=1;
2511              goto exit;
2512          }
2513 -        DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2514 +        DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2515      }
2516  
2517  exit:
2518 @@ -482,7 +486,7 @@ exit:
2519      --(*sp->exit_counter);
2520      PR_Notify(sp->exit_mon);
2521      PR_ExitMonitor(sp->exit_mon);
2522 -    DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2523 +    DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2524  }
2525  
2526  /*
2527 @@ -541,7 +545,7 @@ UDP_Server(void *arg)
2528          return;
2529      }
2530  
2531 -    DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2532 +    DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2533               netaddr.inet.ip, netaddr.inet.port));
2534      /*
2535       * We can't use the IP address returned by PR_GetSockName in
2536 @@ -579,13 +583,13 @@ UDP_Server(void *arg)
2537       */
2538      memset(&netaddr, 0, sizeof(netaddr));
2539      for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
2540 -        DPRINTF(("UDP_Server: calling PR_RecvFrom client  - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2541 +        DPRINTF(("UDP_Server: calling PR_RecvFrom client  - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2542                   netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
2543                   in_buf->data[0]));
2544  
2545          rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
2546                           PR_INTERVAL_NO_TIMEOUT);
2547 -        DPRINTF(("UDP_Server: PR_RecvFrom client  - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2548 +        DPRINTF(("UDP_Server: PR_RecvFrom client  - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2549                   netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
2550                   in_buf->data[0]));
2551          if (rv != bytes) {
2552 @@ -608,7 +612,7 @@ UDP_Server(void *arg)
2553      --(*sp->exit_counter);
2554      PR_Notify(sp->exit_mon);
2555      PR_ExitMonitor(sp->exit_mon);
2556 -    DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
2557 +    DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
2558  }
2559  
2560  /*
2561 @@ -652,7 +656,7 @@ TCP_Client(void *arg)
2562          }
2563          if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
2564              fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
2565 -                    PR_GetError(), PR_GetOSError());
2566 +                    (long)PR_GetError(), (long)PR_GetOSError());
2567              failed_already=1;
2568              return;
2569          }
2570 @@ -660,7 +664,7 @@ TCP_Client(void *arg)
2571              /*
2572               * fill in random data
2573               */
2574 -            memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
2575 +            memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
2576              /*
2577               * write to server
2578               */
2579 @@ -674,7 +678,7 @@ TCP_Client(void *arg)
2580                  failed_already=1;
2581                  return;
2582              }
2583 -            DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2584 +            DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2585                       PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2586              if (readn(sockfd, in_buf->data, bytes) < bytes) {
2587                  fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
2588 @@ -711,7 +715,7 @@ TCP_Client(void *arg)
2589      --(*cp->exit_counter);
2590      PR_Notify(cp->exit_mon);
2591      PR_ExitMonitor(cp->exit_mon);
2592 -    DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2593 +    DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
2594  }
2595  
2596  /*
2597 @@ -775,7 +779,7 @@ UDP_Client(void *arg)
2598          return;
2599      }
2600  
2601 -    DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2602 +    DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2603               netaddr.inet.ip, netaddr.inet.port));
2604  
2605      netaddr = cp->server_addr;
2606 @@ -792,9 +796,9 @@ UDP_Client(void *arg)
2607          /*
2608           * fill in random data
2609           */
2610 -        DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
2611 +        DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
2612                   PR_GetCurrentThread(), out_buf->data, bytes));
2613 -        memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
2614 +        memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
2615          /*
2616           * write to server
2617           */
2618 @@ -807,7 +811,7 @@ UDP_Client(void *arg)
2619          if (rv != bytes) {
2620              return;
2621          }
2622 -        DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2623 +        DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2624                   PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2625          if (cp->udp_connect)
2626              rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
2627 @@ -818,7 +822,7 @@ UDP_Client(void *arg)
2628          if (rv != bytes) {
2629              return;
2630          }
2631 -        DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
2632 +        DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
2633                   PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
2634          /*
2635           * verify the data read
2636 @@ -843,7 +847,7 @@ UDP_Client(void *arg)
2637      PR_Notify(cp->exit_mon);
2638      PR_ExitMonitor(cp->exit_mon);
2639      PR_DELETE(cp);
2640 -    DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2641 +    DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
2642  }
2643  
2644  /*
2645 @@ -910,7 +914,7 @@ TCP_Socket_Client_Server_Test(void)
2646          failed_already=1;
2647          return -1;
2648      }
2649 -    DPRINTF(("Created TCP server = 0x%lx\n", t));
2650 +    DPRINTF(("Created TCP server = %p\n", t));
2651      thread_count++;
2652  
2653      /*
2654 @@ -944,7 +948,7 @@ TCP_Socket_Client_Server_Test(void)
2655              failed_already=1;
2656              return -1;
2657          }
2658 -        DPRINTF(("Created TCP client = 0x%lx\n", t));
2659 +        DPRINTF(("Created TCP client = %p\n", t));
2660          thread_count++;
2661      }
2662      /* Wait for server and client threads to exit */
2663 @@ -954,9 +958,9 @@ TCP_Socket_Client_Server_Test(void)
2664      }
2665      PR_ExitMonitor(mon2);
2666      printf("%30s","TCP_Socket_Client_Server_Test:");
2667 -    printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
2668 +    printf(" 1 Server %2d Clients %2d connections_per_client\n",
2669             num_tcp_clients, num_tcp_connections_per_client);
2670 -    printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
2671 +    printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
2672             num_tcp_mesgs_per_connection, tcp_mesg_size);
2673  
2674      return 0;
2675 @@ -1081,8 +1085,8 @@ UDP_Socket_Client_Server_Test(void)
2676      }
2677      PR_ExitMonitor(mon2);
2678      printf("%30s","UDP_Socket_Client_Server_Test: ");
2679 -    printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
2680 -    printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
2681 +    printf(" 1 Server %2d Clients\n", num_udp_clients);
2682 +    printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
2683             num_udp_datagrams_per_client, udp_datagram_size);
2684  
2685      return 0;
2686 @@ -1438,7 +1442,7 @@ TransmitFile_Client(void *arg)
2687      --(*cp->exit_counter);
2688      PR_Notify(cp->exit_mon);
2689      PR_ExitMonitor(cp->exit_mon);
2690 -    DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
2691 +    DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
2692  }
2693  
2694  /*
2695 @@ -1481,7 +1485,7 @@ Serve_TransmitFile_Client(void *arg)
2696      if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
2697          fprintf(stderr,
2698                  "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
2699 -                PR_GetError(), PR_GetOSError());
2700 +                (long)PR_GetError(), (long)PR_GetOSError());
2701          failed_already=1;
2702      }
2703      bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
2704 @@ -1489,7 +1493,7 @@ Serve_TransmitFile_Client(void *arg)
2705      if (bytes != LARGE_FILE_SIZE) {
2706          fprintf(stderr,
2707                  "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
2708 -                PR_GetError(), PR_GetOSError());
2709 +                (long)PR_GetError(), (long)PR_GetOSError());
2710          failed_already=1;
2711      }
2712  
2713 @@ -1517,7 +1521,7 @@ Serve_TransmitFile_Client(void *arg)
2714                  slen, bytes);
2715          fprintf(stderr,
2716                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2717 -                PR_GetError(), PR_GetOSError());
2718 +                (long)PR_GetError(), (long)PR_GetOSError());
2719          failed_already=1;
2720      }
2721  
2722 @@ -1541,7 +1545,7 @@ Serve_TransmitFile_Client(void *arg)
2723                  slen, bytes);
2724          fprintf(stderr,
2725                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2726 -                PR_GetError(), PR_GetOSError());
2727 +                (long)PR_GetError(), (long)PR_GetOSError());
2728          failed_already=1;
2729      }
2730      /*
2731 @@ -1563,7 +1567,7 @@ Serve_TransmitFile_Client(void *arg)
2732                  slen, bytes);
2733          fprintf(stderr,
2734                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2735 -                PR_GetError(), PR_GetOSError());
2736 +                (long)PR_GetError(), (long)PR_GetOSError());
2737          failed_already=1;
2738      }
2739      /*
2740 @@ -1585,7 +1589,7 @@ Serve_TransmitFile_Client(void *arg)
2741                  slen, bytes);
2742          fprintf(stderr,
2743                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2744 -                PR_GetError(), PR_GetOSError());
2745 +                (long)PR_GetError(), (long)PR_GetOSError());
2746          failed_already=1;
2747      }
2748      /*
2749 @@ -1607,7 +1611,7 @@ Serve_TransmitFile_Client(void *arg)
2750                  slen, bytes);
2751          fprintf(stderr,
2752                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2753 -                PR_GetError(), PR_GetOSError());
2754 +                (long)PR_GetError(), (long)PR_GetOSError());
2755          failed_already=1;
2756      }
2757      /*
2758 @@ -1629,7 +1633,7 @@ Serve_TransmitFile_Client(void *arg)
2759                  slen, bytes);
2760          fprintf(stderr,
2761                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2762 -                PR_GetError(), PR_GetOSError());
2763 +                (long)PR_GetError(), (long)PR_GetOSError());
2764          failed_already=1;
2765      }
2766      /*
2767 @@ -1651,7 +1655,7 @@ Serve_TransmitFile_Client(void *arg)
2768                  slen, bytes);
2769          fprintf(stderr,
2770                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2771 -                PR_GetError(), PR_GetOSError());
2772 +                (long)PR_GetError(), (long)PR_GetOSError());
2773          failed_already=1;
2774      }
2775      /*
2776 @@ -1675,7 +1679,7 @@ Serve_TransmitFile_Client(void *arg)
2777                  slen, bytes);
2778          fprintf(stderr,
2779                  "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2780 -                PR_GetError(), PR_GetOSError());
2781 +                (long)PR_GetError(), (long)PR_GetOSError());
2782          failed_already=1;
2783      }
2784  done:
2785 @@ -1752,7 +1756,7 @@ TransmitFile_Server(void *arg)
2786          goto exit;
2787      }
2788  
2789 -    DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2790 +    DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2791               netaddr.inet.ip, netaddr.inet.port));
2792      tcp_server_addr.inet.family = netaddr.inet.family;
2793      tcp_server_addr.inet.port = netaddr.inet.port;
2794 @@ -1818,7 +1822,7 @@ TransmitFile_Server(void *arg)
2795              failed_already=1;
2796              goto exit;
2797          }
2798 -        DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
2799 +        DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
2800      }
2801  
2802      /*
2803 @@ -1846,7 +1850,7 @@ exit:
2804      --(*sp->exit_counter);
2805      PR_Notify(sp->exit_mon);
2806      PR_ExitMonitor(sp->exit_mon);
2807 -    DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2808 +    DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
2809  }
2810  
2811  /*
2812 @@ -1986,7 +1990,7 @@ Socket_Misc_Test(void)
2813              fprintf(stderr,
2814                      "prsocket_test failed to write to file %s: (%ld, %ld)\n",
2815                      LARGE_FILE_NAME,
2816 -                    PR_GetError(), PR_GetOSError());
2817 +                    (long)PR_GetError(), (long)PR_GetOSError());
2818              failed_already=1;
2819              rv = -1;
2820              goto done;
2821 @@ -2076,7 +2080,7 @@ Socket_Misc_Test(void)
2822          rv = -1;
2823          goto done;
2824      }
2825 -    DPRINTF(("Created TCP server = 0x%x\n", t));
2826 +    DPRINTF(("Created TCP server = %p\n", t));
2827      thread_count++;
2828  
2829      /*
2830 @@ -2113,7 +2117,7 @@ Socket_Misc_Test(void)
2831              failed_already=1;
2832              goto done;
2833          }
2834 -        DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
2835 +        DPRINTF(("Created TransmitFile client = %p\n", t));
2836          thread_count++;
2837      }
2838      /* Wait for server and client threads to exit */
2839 @@ -2144,7 +2148,7 @@ done:
2840      }
2841      if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
2842          fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
2843 -                TEST_DIR, PR_GetError(), PR_GetOSError());
2844 +                TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
2845          failed_already=1;
2846      }
2847  
2848 --- pr/tests/sprintf.c.orig     2019-10-15 14:21:38 UTC
2849 +++ pr/tests/sprintf.c
2850 @@ -133,7 +133,7 @@ static void test_l(char *pattern, char *
2851          (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
2852          fprintf(stderr,
2853                  "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n    sprintf='%s'\n",
2854 -                pattern, l, s, buf, sbuf);
2855 +                pattern, (long)l, s, buf, sbuf);
2856          PR_smprintf_free(s);
2857          exit(-1);
2858      }
2859 --- pr/tests/stack.c.orig       2019-10-15 14:21:38 UTC
2860 +++ pr/tests/stack.c
2861 @@ -53,7 +53,7 @@ PRFileDesc  *errhandle;
2862  
2863  int main(int argc, char **argv)
2864  {
2865 -    PRInt32 rv, cnt, sum;
2866 +    PRInt32 cnt, sum;
2867      DataRecord  *Item;
2868      PRStack     *list1, *list2;
2869      PRStackElem *node;
2870 @@ -211,7 +211,7 @@ int main(int argc, char **argv)
2871  static void stackop(void *thread_arg)
2872  {
2873      PRInt32 val, cnt, index, loops;
2874 -    DataRecord  *Items, *Item;
2875 +    DataRecord  *Items;
2876      PRStack     *list1, *list2;
2877      PRStackElem *node;
2878      stack_data *arg = (stack_data *) thread_arg;
2879 --- pr/tests/suspend.c.orig     2019-10-15 14:21:38 UTC
2880 +++ pr/tests/suspend.c
2881 @@ -21,14 +21,14 @@ void PR_CALLBACK
2882  Level_2_Thread(void *arg)
2883  {
2884      PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
2885 -    printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2886 +    printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
2887      return;
2888  }
2889  
2890  void PR_CALLBACK
2891  Level_1_Thread(void *arg)
2892  {
2893 -    PRUint32 tmp = (PRUint32)arg;
2894 +    PRUint32 tmp = (PRUint32)(uintptr_t)arg;
2895      PRThreadScope scope = (PRThreadScope) tmp;
2896      PRThread *thr;
2897  
2898 @@ -43,7 +43,7 @@ Level_1_Thread(void *arg)
2899      if (!thr) {
2900          printf("Could not create thread!\n");
2901      } else {
2902 -        printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
2903 +        printf("Level_1_Thread[%p] created %15s thread %p\n",
2904                 PR_GetCurrentThread(),
2905                 (scope == PR_GLOBAL_THREAD) ?
2906                 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2907 @@ -54,7 +54,7 @@ Level_1_Thread(void *arg)
2908      alive--;
2909      PR_Notify(mon);
2910      PR_ExitMonitor(mon);
2911 -    printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2912 +    printf("Thread[%p] exiting\n",PR_GetCurrentThread());
2913  }
2914  
2915  static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
2916 @@ -63,14 +63,15 @@ static PRStatus PR_CALLBACK print_thread
2917      PRWord *registers;
2918  
2919      printf(
2920 -        "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
2921 +        "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
2922          (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
2923          "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
2924      registers = PR_GetGCRegisters(thread, 0, (int *)&words);
2925      if (registers)
2926 -        printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
2927 -               registers[0],registers[1],registers[2],registers[3]);
2928 -    printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
2929 +        printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
2930 +               (unsigned long)registers[0], (unsigned long)registers[1],
2931 +               (unsigned long)registers[2], (unsigned long)registers[3]);
2932 +    printf("Stack Pointer = %p\n", PR_GetSP(thread));
2933      return PR_SUCCESS;
2934  }
2935  
2936 @@ -98,7 +99,7 @@ static void Level_0_Thread(PRThreadScope
2937              printf("Could not create thread!\n");
2938              alive--;
2939          }
2940 -        printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
2941 +        printf("Level_0_Thread[%p] created %15s thread %p\n",
2942                 PR_GetCurrentThread(),
2943                 (scope1 == PR_GLOBAL_THREAD) ?
2944                 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2945 @@ -110,9 +111,10 @@ static void Level_0_Thread(PRThreadScope
2946      PR_EnumerateThreads(print_thread, NULL);
2947      registers = PR_GetGCRegisters(me, 1, (int *)&words);
2948      if (registers)
2949 -        printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
2950 -               registers[0],registers[1],registers[2],registers[3]);
2951 -    printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
2952 +        printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
2953 +               (unsigned long)registers[0], (unsigned long)registers[1],
2954 +               (unsigned long)registers[2], (unsigned long)registers[3]);
2955 +    printf("My Stack Pointer = %p\n", PR_GetSP(me));
2956      PR_ResumeAll();
2957  
2958      /* Wait for all threads to exit */
2959 --- pr/tests/switch.c.orig      2019-10-15 14:21:38 UTC
2960 +++ pr/tests/switch.c
2961 @@ -83,7 +83,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
2962      PRStatus status;
2963      PRBool help = PR_FALSE;
2964      PRUintn concurrency = 1;
2965 -    Shared *shared, *link;
2966 +    Shared *shared = NULL, *link;
2967      PRIntervalTime timein, timeout;
2968      PRThreadScope thread_scope = PR_LOCAL_THREAD;
2969      PRUintn thread_count, inner_count, loop_count, average;
2970 --- pr/tests/testfile.c.orig    2019-10-15 14:21:38 UTC
2971 +++ pr/tests/testfile.c
2972 @@ -33,6 +33,9 @@ static int _debug_on = 0;
2973  #ifdef XP_WIN
2974  #define mode_t int
2975  #endif
2976 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2977 +#   include <unistd.h>  /* getopt(3) */
2978 +#endif
2979  
2980  #define DPRINTF(arg) if (_debug_on) printf arg
2981  
2982 @@ -86,7 +89,7 @@ static PRInt32 PR_CALLBACK DirTest(void
2983  PRInt32 dirtest_failed = 0;
2984  
2985  PRThread* create_new_thread(PRThreadType type,
2986 -                            void (*start)(void *arg),
2987 +                            void *(*start)(void *arg),
2988                              void *arg,
2989                              PRThreadPriority priority,
2990                              PRThreadScope scope,
2991 @@ -151,7 +154,7 @@ PRThread* create_new_thread(PRThreadType
2992          return((PRThread *) thandle);
2993  #endif
2994      } else {
2995 -        return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
2996 +        return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
2997      }
2998  #else
2999      return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3000 @@ -312,8 +315,8 @@ static PRInt32 Misc_File_Tests(char *pat
3001          printf(
3002              "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3003              pathname);
3004 -        printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3005 -               file_info1.creationTime);
3006 +        printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3007 +               (long long)file_info1.creationTime);
3008          rv = -1;
3009          goto cleanup;
3010      }
3011 @@ -338,8 +341,8 @@ static PRInt32 Misc_File_Tests(char *pat
3012          printf(
3013              "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3014              pathname);
3015 -        printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3016 -               file_info1.modifyTime);
3017 +        printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3018 +               (long long)file_info1.modifyTime);
3019          rv = -1;
3020          goto cleanup;
3021      }
3022 @@ -465,7 +468,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3023          memset(fparamp->buf, i, len);
3024  
3025          t = create_new_thread(PR_USER_THREAD,
3026 -                              File_Write, (void *)fparamp,
3027 +                              (void *(*)(void *))File_Write, (void *)fparamp,
3028                                PR_PRIORITY_NORMAL,
3029                                scope,
3030                                PR_UNJOINABLE_THREAD,
3031 @@ -500,7 +503,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3032          fparamp->len = len;
3033  
3034          t = create_new_thread(PR_USER_THREAD,
3035 -                              File_Read, (void *)fparamp,
3036 +                              (void *(*)(void *))File_Read, (void *)fparamp,
3037                                PR_PRIORITY_NORMAL,
3038                                scope,
3039                                PR_UNJOINABLE_THREAD,
3040 @@ -569,7 +572,7 @@ static PRInt32 RunDirTest(void)
3041  
3042          thrarg.done= 0;
3043          t = create_new_thread(PR_USER_THREAD,
3044 -                              DirTest, &thrarg,
3045 +                              (void *(*)(void *))DirTest, &thrarg,
3046                                PR_PRIORITY_NORMAL,
3047                                PR_LOCAL_THREAD,
3048                                PR_UNJOINABLE_THREAD,
3049 @@ -893,8 +896,6 @@ int main(int argc, char **argv)
3050  #endif
3051  #if defined(XP_UNIX) || defined(XP_OS2)
3052      int opt;
3053 -    extern char *optarg;
3054 -    extern int optind;
3055  #endif
3056  #if defined(XP_UNIX) || defined(XP_OS2)
3057      while ((opt = getopt(argc, argv, "d")) != EOF) {
3058 --- pr/tests/threads.c.orig     2019-10-15 14:21:38 UTC
3059 +++ pr/tests/threads.c
3060 @@ -27,7 +27,7 @@ void
3061  PR_CALLBACK
3062  DumbThread(void *arg)
3063  {
3064 -    PRInt32 tmp = (PRInt32)arg;
3065 +    PRInt32 tmp = (PRInt32)(intptr_t)arg;
3066      PRThreadScope scope = (PRThreadScope)tmp;
3067      PRThread *thr;
3068  
3069 @@ -173,10 +173,10 @@ int main(int argc, char **argv)
3070  
3071      if (debug_mode)
3072      {
3073 -        printf("\
3074 -** Tests lots of thread creations.  \n\
3075 -** Create %ld native threads %ld times. \n\
3076 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3077 +        printf("** Tests lots of thread creations.\n"
3078 +               "** Create %d native threads %d times.\n"
3079 +               "** Create %d user threads %d times.\n", iterations, count,
3080 +               iterations, count);
3081      }
3082  
3083      for (index=0; index<iterations; index++) {
3084 --- pr/tests/thrpool_client.c.orig      2019-10-15 14:21:38 UTC
3085 +++ pr/tests/thrpool_client.c
3086 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3087      PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3088  
3089      for (rem=len; rem; offset += bytes, rem -= bytes) {
3090 -        DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3091 +        DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3092                   PR_GetCurrentThread(), rem));
3093          bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3094                          timeout);
3095 -        DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3096 +        DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3097                   PR_GetCurrentThread(), bytes));
3098          if (bytes < 0) {
3099              return -1;
3100 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3101      int offset = 0;
3102  
3103      for (rem=len; rem; offset += bytes, rem -= bytes) {
3104 -        DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3105 +        DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3106                   PR_GetCurrentThread(), rem));
3107          bytes = PR_Send(sockfd, buf + offset, rem, 0,
3108                          PR_INTERVAL_NO_TIMEOUT);
3109 -        DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3110 +        DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3111                   PR_GetCurrentThread(), bytes));
3112          if (bytes <= 0) {
3113              return -1;
3114 @@ -165,7 +165,7 @@ TCP_Client(void *arg)
3115  
3116          DPRINTF(("TCP client connecting to server:%d\n", server_port));
3117          if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3118 -            fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3119 +            fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3120                      PR_GetError(), PR_GetOSError());
3121              failed_already=1;
3122              return;
3123 @@ -174,7 +174,7 @@ TCP_Client(void *arg)
3124              /*
3125               * fill in random data
3126               */
3127 -            memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3128 +            memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3129              /*
3130               * write to server
3131               */
3132 @@ -282,7 +282,7 @@ TCP_Socket_Client_Server_Test(void)
3133          PR_EnterMonitor(mon2);
3134          connections++;
3135          PR_ExitMonitor(mon2);
3136 -        DPRINTF(("Created TCP client = 0x%lx\n", thr));
3137 +        DPRINTF(("Created TCP client = %p\n", thr));
3138      }
3139      /* Wait for client jobs to exit */
3140      PR_EnterMonitor(mon2);
3141 @@ -292,9 +292,9 @@ TCP_Socket_Client_Server_Test(void)
3142      }
3143      PR_ExitMonitor(mon2);
3144      printf("%30s","TCP_Socket_Client_Server_Test:");
3145 -    printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3146 +    printf(" 1 Server %2d Clients %2d connections_per_client\n",
3147             num_tcp_clients, num_tcp_connections_per_client);
3148 -    printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3149 +    printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3150             num_tcp_mesgs_per_connection, tcp_mesg_size);
3151  
3152      PR_DELETE(cparamp);
3153 --- pr/tests/thrpool_server.c.orig      2019-10-15 14:21:38 UTC
3154 +++ pr/tests/thrpool_server.c
3155 @@ -330,7 +330,7 @@ TCP_Server(void *arg)
3156      }
3157  
3158      DPRINTF((
3159 -                "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3160 +                "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3161                  netaddr.inet.ip, netaddr.inet.port));
3162  
3163      sp = PR_NEW(Server_Param);
3164 @@ -342,7 +342,7 @@ TCP_Server(void *arg)
3165      sp->iod.socket = sockfd;
3166      sp->iod.timeout = PR_SecondsToInterval(60);
3167      sp->datalen = tcp_mesg_size;
3168 -    sp->exit_mon = sc_mon;
3169 +    sp->exit_mon = NULL;
3170      sp->job_counterp = &job_counter;
3171      sp->conn_counter = 0;
3172      sp->tp = tp;
3173 @@ -465,7 +465,7 @@ TCP_Server_Accept(void *arg)
3174                         PR_FALSE);
3175  
3176      PR_ASSERT(NULL != jobp);
3177 -    DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3178 +    DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3179  
3180      /*
3181       * single-threaded update; no lock needed
3182 @@ -482,7 +482,7 @@ TCP_Server_Accept(void *arg)
3183                               print_stats, sp, PR_FALSE);
3184  
3185      PR_ASSERT(NULL != jobp);
3186 -    DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3187 +    DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3188  
3189  exit:
3190      PR_EnterMonitor(sp->exit_mon);
3191 @@ -499,9 +499,9 @@ exit:
3192      }
3193      PR_DestroyMonitor(sp->exit_mon);
3194      printf("%30s","TCP_Socket_Client_Server_Test:");
3195 -    printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3196 +    printf(" 1 Server %2d Clients %2d connections_per_client\n",
3197             num_tcp_clients, num_tcp_connections_per_client);
3198 -    printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3199 +    printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3200             num_tcp_mesgs_per_connection, tcp_mesg_size);
3201  
3202      DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3203 --- pr/tests/thruput.c.orig     2019-10-15 14:21:38 UTC
3204 +++ pr/tests/thruput.c
3205 @@ -69,7 +69,7 @@ static void PR_CALLBACK Clientel(void *a
3206  {
3207      PRStatus rv;
3208      PRFileDesc *xport;
3209 -    PRInt32 bytes, sampled;
3210 +    PRInt32 bytes, sampled = -1;
3211      PRIntervalTime now, interval;
3212      PRBool do_display = PR_FALSE;
3213      Shared *shared = (Shared*)arg;
3214 @@ -183,7 +183,7 @@ static void Client(const char *server_na
3215  
3216  static void PR_CALLBACK Servette(void *arg)
3217  {
3218 -    PRInt32 bytes, sampled;
3219 +    PRInt32 bytes, sampled = -1;
3220      PRIntervalTime now, interval;
3221      PRBool do_display = PR_FALSE;
3222      PRFileDesc *client = (PRFileDesc*)arg;
3223 @@ -395,6 +395,7 @@ int main(int argc, char **argv)
3224      }
3225  
3226      return 0;
3227 +    return 0;
3228  }  /* main */
3229  
3230  /* thruput.c */
3231 --- pr/tests/timemac.c.orig     2019-10-15 14:21:38 UTC
3232 +++ pr/tests/timemac.c
3233 @@ -25,7 +25,7 @@ static void printExplodedTime(const PREx
3234      const char *sign;
3235  
3236      /* Print day of the week, month, day, hour, minute, and second */
3237 -    printf( "%s %s %ld %02ld:%02ld:%02ld ",
3238 +    printf( "%s %s %d %02d:%02d:%02d ",
3239              dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3240              et->tm_hour, et->tm_min, et->tm_sec);
3241  
3242 @@ -41,7 +41,7 @@ static void printExplodedTime(const PREx
3243          }
3244          hourOffset = totalOffset / 3600;
3245          minOffset = (totalOffset % 3600) / 60;
3246 -        printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3247 +        printf("%s%02d%02d ", sign, hourOffset, minOffset);
3248      }
3249  
3250      /* Print year */
3251 @@ -98,7 +98,7 @@ int main(int argc, char** argv)
3252          printf("Current local time is ");
3253          printExplodedTime(&et);
3254          printf("\n");
3255 -        printf("GMT offset is %ld, DST offset is %ld\n",
3256 +        printf("GMT offset is %d, DST offset is %d\n",
3257                 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3258          t2 = PR_ImplodeTime(&et);
3259          if (LL_NE(t1, t2)) {
3260 --- pr/tests/timetest.c.orig    2019-10-15 14:21:38 UTC
3261 +++ pr/tests/timetest.c
3262 @@ -37,7 +37,7 @@ static void PrintExplodedTime(const PREx
3263      const char *sign;
3264  
3265      /* Print day of the week, month, day, hour, minute, and second */
3266 -    if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3267 +    if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3268                                 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3269                                 et->tm_hour, et->tm_min, et->tm_sec);
3270  
3271 @@ -56,7 +56,7 @@ static void PrintExplodedTime(const PREx
3272          hourOffset = totalOffset / 3600;
3273          minOffset = (totalOffset % 3600) / 60;
3274          if (debug_mode) {
3275 -            printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3276 +            printf("%s%02d%02d ", sign, hourOffset, minOffset);
3277          }
3278      }
3279  
3280 @@ -262,7 +262,7 @@ int main(int argc, char** argv)
3281          if (debug_mode) {
3282              printf("\n");
3283          }
3284 -        if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3285 +        if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3286                                     et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3287          t2 = PR_ImplodeTime(&et);
3288          if (LL_NE(t1, t2)) {
3289 --- pr/tests/y2k.c.orig 2019-10-15 14:21:38 UTC
3290 +++ pr/tests/y2k.c
3291 @@ -44,7 +44,7 @@ static void PrintExplodedTime(const PREx
3292      const char *sign;
3293  
3294      /* Print day of the week, month, day, hour, minute, and second */
3295 -    printf("%s %s %2ld %02ld:%02ld:%02ld ",
3296 +    printf("%s %s %2d %02d:%02d:%02d ",
3297             dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3298             et->tm_hour, et->tm_min, et->tm_sec);
3299  
3300 @@ -63,7 +63,7 @@ static void PrintExplodedTime(const PREx
3301          }
3302          hourOffset = totalOffset / 3600;
3303          minOffset = (totalOffset % 3600) / 60;
3304 -        printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3305 +        printf("%s%02d%02d ", sign, hourOffset, minOffset);
3306      }
3307  #ifdef PRINT_DETAILS
3308      printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3309 --- pr/tests/y2ktmo.c.orig      2019-10-15 14:21:38 UTC
3310 +++ pr/tests/y2ktmo.c
3311 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3312  
3313  static void SleepThread(void *arg)
3314  {
3315 -    PRIntervalTime timeout = (PRIntervalTime) arg;
3316 +    PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3317      PRIntervalTime elapsed;
3318  #if defined(XP_UNIX) || defined(WIN32)
3319      PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3320 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3321  
3322  static void AcceptThread(void *arg)
3323  {
3324 -    PRIntervalTime timeout = (PRIntervalTime) arg;
3325 +    PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3326      PRIntervalTime elapsed;
3327  #if defined(XP_UNIX) || defined(WIN32)
3328      PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3329 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3330  
3331  static void PollThread(void *arg)
3332  {
3333 -    PRIntervalTime timeout = (PRIntervalTime) arg;
3334 +    PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3335      PRIntervalTime elapsed;
3336  #if defined(XP_UNIX) || defined(WIN32)
3337      PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3338 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3339  
3340  static void WaitCondVarThread(void *arg)
3341  {
3342 -    PRIntervalTime timeout = (PRIntervalTime) arg;
3343 +    PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3344      PRIntervalTime elapsed;
3345  #if defined(XP_UNIX) || defined(WIN32)
3346      PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3347 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3348  
3349  static void WaitMonitorThread(void *arg)
3350  {
3351 -    PRIntervalTime timeout = (PRIntervalTime) arg;
3352 +    PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3353      PRIntervalTime elapsed;
3354  #if defined(XP_UNIX) || defined(WIN32)
3355      PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3356 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3357  
3358  static void WaitCMonitorThread(void *arg)
3359  {
3360 -    PRIntervalTime timeout = (PRIntervalTime) arg;
3361 +    PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3362      PRIntervalTime elapsed;
3363  #if defined(XP_UNIX) || defined(WIN32)
3364      PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3365 @@ -532,7 +532,7 @@ int main(int argc, char **argv)
3366      for (i = 0; i < num_thread_scopes; i++) {
3367          for (j = 0; j < num_thread_funcs; j++) {
3368              threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3369 -                                           (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3370 +                                           (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3371                                             threadScopes[i], PR_JOINABLE_THREAD, 0);
3372              if (threads[idx] == NULL) {
3373                  fprintf(stderr, "PR_CreateThread failed\n");
3374 --- pr/tests/zerolen.c.orig     2019-10-15 14:21:38 UTC
3375 +++ pr/tests/zerolen.c
3376 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3377  {
3378      PRFileDesc *sock;
3379      PRNetAddr addr;
3380 -    PRUint16 port = (PRUint16) arg;
3381 +    PRUint16 port = (PRUint16)(uintptr_t)arg;
3382      char buf[1024];
3383      PRInt32 nbytes;
3384  
3385 @@ -124,7 +124,7 @@ int main()
3386       * First test PR_Writev.
3387       */
3388      clientThread = PR_CreateThread(PR_USER_THREAD,
3389 -                                   ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3390 +                                   ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3391                                     PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3392      if (NULL == clientThread) {
3393          fprintf(stderr, "PR_CreateThread failed\n");
3394 @@ -165,7 +165,7 @@ int main()
3395       * Then test PR_Write.
3396       */
3397      clientThread = PR_CreateThread(PR_USER_THREAD,
3398 -                                   ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3399 +                                   ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3400                                     PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3401      if (NULL == clientThread) {
3402          fprintf(stderr, "PR_CreateThread failed\n");
3403 @@ -204,7 +204,7 @@ int main()
3404       * Finally test PR_Send.
3405       */
3406      clientThread = PR_CreateThread(PR_USER_THREAD,
3407 -                                   ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3408 +                                   ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3409                                     PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3410      if (NULL == clientThread) {
3411          fprintf(stderr, "PR_CreateThread failed\n");
3412
3413
3414 [FILE:2460:patches/patch-warnings]
3415 --- pr/include/prcountr.h.orig  2019-10-15 14:21:38 UTC
3416 +++ pr/include/prcountr.h
3417 @@ -394,7 +394,7 @@ PR_SubtractFromCounter(
3418  #define PR_GET_COUNTER(counter,handle)\
3419      (counter) = PR_GetCounter((handle))
3420  #else
3421 -#define PR_GET_COUNTER(counter,handle) 0
3422 +#define PR_GET_COUNTER(counter,handle)
3423  #endif
3424  
3425  NSPR_API(PRUint32)
3426 @@ -468,7 +468,7 @@ PR_SetCounter(
3427  #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3428      (next) = PR_FindNextCounterQname((handle))
3429  #else
3430 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3431 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3432  #endif
3433  
3434  NSPR_API(PRCounterHandle)
3435 --- pr/src/misc/pralarm.c.orig  2019-10-15 14:21:38 UTC
3436 +++ pr/src/misc/pralarm.c
3437 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier(void *arg)
3438  
3439      while (why != abort)
3440      {
3441 -        PRIntervalTime pause;
3442 +        PRIntervalTime pause = 0;
3443  
3444          PR_Lock(alarm->lock);
3445          while (why == scan)
3446 --- pr/src/misc/prdtoa.c.orig   2019-10-15 14:21:38 UTC
3447 +++ pr/src/misc/prdtoa.c
3448 @@ -2896,9 +2896,9 @@ double dd; int mode, ndigits, *decpt, *sign; char **rv
3449         to hold the suppressed trailing zeros.
3450      */
3451  
3452 -    int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3453 -        j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3454 -        spec_case, try_quick;
3455 +    int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3456 +                                         j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3457 +                                         spec_case, try_quick;
3458      Long L;
3459  #ifndef Sudden_Underflow
3460      int denorm;
3461 --- pr/src/pthreads/ptio.c.orig 2019-10-15 14:21:38 UTC
3462 +++ pr/src/pthreads/ptio.c
3463 @@ -5262,6 +5262,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
3464  
3465      if (timeout == PR_INTERVAL_NO_TIMEOUT) {
3466          tvp = NULL;
3467 +        start = 0; /* Not needed, but shuts down a warning */
3468      } else {
3469          tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
3470          tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
3471 --- pr/src/pthreads/ptsynch.c.orig      2019-10-15 14:21:38 UTC
3472 +++ pr/src/pthreads/ptsynch.c
3473 @@ -25,7 +25,7 @@ static pthread_condattr_t _pt_cvar_attr;
3474  extern PTDebug pt_debug;  /* this is shared between several modules */
3475  #endif  /* defined(DEBUG) */
3476  
3477 -#if defined(FREEBSD)
3478 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
3479  /*
3480   * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
3481   * Newer versions return EBUSY.  We still need to support both.
3482
3483
3484 [FILE:6203:dragonfly/patch-nsprpub_pr_include_md___dragonfly.cfg]
3485 --- /dev/null   2019-10-22 17:25:39 UTC
3486 +++ pr/include/md/_dragonfly.cfg
3487 @@ -0,0 +1,208 @@
3488 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3489 +/* This Source Code Form is subject to the terms of the Mozilla Public
3490 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3491 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3492 +
3493 +#ifndef nspr_cpucfg___
3494 +#define nspr_cpucfg___
3495 +
3496 +#ifndef XP_UNIX
3497 +#define XP_UNIX
3498 +#endif
3499 +
3500 +#define PR_AF_INET6 28  /* same as AF_INET6 */
3501 +
3502 +#ifndef HAVE_LONG_LONG
3503 +#define HAVE_LONG_LONG
3504 +#endif
3505 +
3506 +#if defined(__i386__)
3507 +
3508 +#define IS_LITTLE_ENDIAN 1
3509 +#undef  IS_BIG_ENDIAN
3510 +#undef HAVE_ALIGNED_DOUBLES
3511 +#undef HAVE_ALIGNED_LONGLONGS
3512 +
3513 +#define PR_BYTES_PER_BYTE   1
3514 +#define PR_BYTES_PER_SHORT  2
3515 +#define PR_BYTES_PER_INT    4
3516 +#define PR_BYTES_PER_INT64  8
3517 +#define PR_BYTES_PER_LONG   4
3518 +#define PR_BYTES_PER_FLOAT  4
3519 +#define PR_BYTES_PER_DOUBLE 8
3520 +#define PR_BYTES_PER_WORD   4
3521 +#define PR_BYTES_PER_DWORD  8
3522 +#define PR_BYTES_PER_WORD_LOG2   2
3523 +#define PR_BYTES_PER_DWORD_LOG2  3
3524 +
3525 +#define PR_BITS_PER_BYTE    8
3526 +#define PR_BITS_PER_SHORT   16
3527 +#define PR_BITS_PER_INT     32
3528 +#define PR_BITS_PER_INT64   64
3529 +#define PR_BITS_PER_LONG    32
3530 +#define PR_BITS_PER_FLOAT   32
3531 +#define PR_BITS_PER_DOUBLE  64
3532 +#define PR_BITS_PER_WORD    32
3533 +
3534 +#define PR_BITS_PER_BYTE_LOG2   3
3535 +#define PR_BITS_PER_SHORT_LOG2  4
3536 +#define PR_BITS_PER_INT_LOG2    5
3537 +#define PR_BITS_PER_INT64_LOG2  6
3538 +#define PR_BITS_PER_LONG_LOG2   5
3539 +#define PR_BITS_PER_FLOAT_LOG2  5
3540 +#define PR_BITS_PER_DOUBLE_LOG2 6
3541 +#define PR_BITS_PER_WORD_LOG2   5
3542 +
3543 +#define PR_ALIGN_OF_SHORT   2
3544 +#define PR_ALIGN_OF_INT     4
3545 +#define PR_ALIGN_OF_LONG    4
3546 +#define PR_ALIGN_OF_INT64   4
3547 +#define PR_ALIGN_OF_FLOAT   4
3548 +#define PR_ALIGN_OF_DOUBLE  4
3549 +#define PR_ALIGN_OF_POINTER 4
3550 +
3551 +#elif defined(__alpha__)
3552 +
3553 +#define IS_LITTLE_ENDIAN 1
3554 +#undef  IS_BIG_ENDIAN
3555 +#define        HAVE_ALIGNED_DOUBLES
3556 +#define        HAVE_ALIGNED_LONGLONGS
3557 +#define IS_64
3558 +
3559 +#define PR_BYTES_PER_BYTE   1
3560 +#define PR_BYTES_PER_SHORT  2
3561 +#define PR_BYTES_PER_INT    4
3562 +#define PR_BYTES_PER_INT64  8
3563 +#define PR_BYTES_PER_LONG   8
3564 +#define PR_BYTES_PER_FLOAT  4
3565 +#define PR_BYTES_PER_DOUBLE 8
3566 +#define PR_BYTES_PER_WORD   8
3567 +#define PR_BYTES_PER_DWORD  8
3568 +#define PR_BYTES_PER_WORD_LOG2   3
3569 +#define PR_BYTES_PER_DWORD_LOG2  3
3570 +
3571 +#define PR_BITS_PER_BYTE    8
3572 +#define PR_BITS_PER_SHORT   16
3573 +#define PR_BITS_PER_INT     32
3574 +#define PR_BITS_PER_INT64   64
3575 +#define PR_BITS_PER_LONG    64
3576 +#define PR_BITS_PER_FLOAT   32
3577 +#define PR_BITS_PER_DOUBLE  64
3578 +#define PR_BITS_PER_WORD    64
3579 +
3580 +#define PR_BITS_PER_BYTE_LOG2   3
3581 +#define PR_BITS_PER_SHORT_LOG2  4
3582 +#define PR_BITS_PER_INT_LOG2    5
3583 +#define PR_BITS_PER_INT64_LOG2  6
3584 +#define PR_BITS_PER_LONG_LOG2   6
3585 +#define PR_BITS_PER_FLOAT_LOG2  5
3586 +#define PR_BITS_PER_DOUBLE_LOG2 6
3587 +#define PR_BITS_PER_WORD_LOG2   6
3588 +
3589 +#define PR_ALIGN_OF_SHORT   2
3590 +#define PR_ALIGN_OF_INT     4
3591 +#define PR_ALIGN_OF_LONG    8
3592 +#define PR_ALIGN_OF_INT64   8
3593 +#define PR_ALIGN_OF_FLOAT   4
3594 +#define PR_ALIGN_OF_DOUBLE  8
3595 +#define PR_ALIGN_OF_POINTER 8
3596 +
3597 +#elif defined(__amd64__)
3598 +
3599 +#define IS_LITTLE_ENDIAN 1
3600 +#undef  IS_BIG_ENDIAN
3601 +#define        HAVE_ALIGNED_DOUBLES
3602 +#define        HAVE_ALIGNED_LONGLONGS
3603 +#define IS_64
3604 +
3605 +#define PR_BYTES_PER_BYTE   1
3606 +#define PR_BYTES_PER_SHORT  2
3607 +#define PR_BYTES_PER_INT    4
3608 +#define PR_BYTES_PER_INT64  8
3609 +#define PR_BYTES_PER_LONG   8
3610 +#define PR_BYTES_PER_FLOAT  4
3611 +#define PR_BYTES_PER_DOUBLE 8
3612 +#define PR_BYTES_PER_WORD   8
3613 +#define PR_BYTES_PER_DWORD  8
3614 +#define PR_BYTES_PER_WORD_LOG2   3
3615 +#define PR_BYTES_PER_DWORD_LOG2  3
3616 +
3617 +#define PR_BITS_PER_BYTE    8
3618 +#define PR_BITS_PER_SHORT   16
3619 +#define PR_BITS_PER_INT     32
3620 +#define PR_BITS_PER_INT64   64
3621 +#define PR_BITS_PER_LONG    64
3622 +#define PR_BITS_PER_FLOAT   32
3623 +#define PR_BITS_PER_DOUBLE  64
3624 +#define PR_BITS_PER_WORD    64
3625 +
3626 +#define PR_BITS_PER_BYTE_LOG2   3
3627 +#define PR_BITS_PER_SHORT_LOG2  4
3628 +#define PR_BITS_PER_INT_LOG2    5
3629 +#define PR_BITS_PER_INT64_LOG2  6
3630 +#define PR_BITS_PER_LONG_LOG2   6
3631 +#define PR_BITS_PER_FLOAT_LOG2  5
3632 +#define PR_BITS_PER_DOUBLE_LOG2 6
3633 +#define PR_BITS_PER_WORD_LOG2   6
3634 +
3635 +#define PR_ALIGN_OF_SHORT   2
3636 +#define PR_ALIGN_OF_INT     4
3637 +#define PR_ALIGN_OF_LONG    8
3638 +#define PR_ALIGN_OF_INT64   8
3639 +#define PR_ALIGN_OF_FLOAT   4
3640 +#define PR_ALIGN_OF_DOUBLE  8
3641 +#define PR_ALIGN_OF_POINTER 8
3642 +#define PR_ALIGN_OF_WORD    8
3643 +
3644 +#else
3645 +
3646 +#error "Unknown CPU architecture"
3647 +
3648 +#endif
3649 +
3650 +#ifndef NO_NSPR_10_SUPPORT
3651 +
3652 +#define BYTES_PER_BYTE         PR_BYTES_PER_BYTE
3653 +#define BYTES_PER_SHORT        PR_BYTES_PER_SHORT
3654 +#define BYTES_PER_INT          PR_BYTES_PER_INT
3655 +#define BYTES_PER_INT64                PR_BYTES_PER_INT64
3656 +#define BYTES_PER_LONG         PR_BYTES_PER_LONG
3657 +#define BYTES_PER_FLOAT                PR_BYTES_PER_FLOAT
3658 +#define BYTES_PER_DOUBLE       PR_BYTES_PER_DOUBLE
3659 +#define BYTES_PER_WORD         PR_BYTES_PER_WORD
3660 +#define BYTES_PER_DWORD                PR_BYTES_PER_DWORD
3661 +
3662 +#define BITS_PER_BYTE          PR_BITS_PER_BYTE
3663 +#define BITS_PER_SHORT         PR_BITS_PER_SHORT
3664 +#define BITS_PER_INT           PR_BITS_PER_INT
3665 +#define BITS_PER_INT64         PR_BITS_PER_INT64
3666 +#define BITS_PER_LONG          PR_BITS_PER_LONG
3667 +#define BITS_PER_FLOAT         PR_BITS_PER_FLOAT
3668 +#define BITS_PER_DOUBLE                PR_BITS_PER_DOUBLE
3669 +#define BITS_PER_WORD          PR_BITS_PER_WORD
3670 +
3671 +#define BITS_PER_BYTE_LOG2     PR_BITS_PER_BYTE_LOG2
3672 +#define BITS_PER_SHORT_LOG2    PR_BITS_PER_SHORT_LOG2
3673 +#define BITS_PER_INT_LOG2      PR_BITS_PER_INT_LOG2
3674 +#define BITS_PER_INT64_LOG2    PR_BITS_PER_INT64_LOG2
3675 +#define BITS_PER_LONG_LOG2     PR_BITS_PER_LONG_LOG2
3676 +#define BITS_PER_FLOAT_LOG2    PR_BITS_PER_FLOAT_LOG2
3677 +#define BITS_PER_DOUBLE_LOG2   PR_BITS_PER_DOUBLE_LOG2
3678 +#define BITS_PER_WORD_LOG2     PR_BITS_PER_WORD_LOG2
3679 +
3680 +#define ALIGN_OF_SHORT         PR_ALIGN_OF_SHORT
3681 +#define ALIGN_OF_INT           PR_ALIGN_OF_INT
3682 +#define ALIGN_OF_LONG          PR_ALIGN_OF_LONG
3683 +#define ALIGN_OF_INT64         PR_ALIGN_OF_INT64
3684 +#define ALIGN_OF_FLOAT         PR_ALIGN_OF_FLOAT
3685 +#define ALIGN_OF_DOUBLE                PR_ALIGN_OF_DOUBLE
3686 +#define ALIGN_OF_POINTER       PR_ALIGN_OF_POINTER
3687 +#define ALIGN_OF_WORD          PR_ALIGN_OF_WORD
3688 +
3689 +#define BYTES_PER_WORD_LOG2    PR_BYTES_PER_WORD_LOG2
3690 +#define BYTES_PER_DWORD_LOG2   PR_BYTES_PER_DWORD_LOG2
3691 +#define WORDS_PER_DWORD_LOG2   PR_WORDS_PER_DWORD_LOG2
3692 +
3693 +#endif /* NO_NSPR_10_SUPPORT */
3694 +
3695 +#endif /* nspr_cpucfg___ */
3696
3697
3698 [FILE:6201:dragonfly/patch-nsprpub_pr_include_md___dragonfly.h]
3699 --- /dev/null   2019-10-22 17:25:39 UTC
3700 +++ pr/include/md/_dragonfly.h
3701 @@ -0,0 +1,225 @@
3702 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3703 +/* This Source Code Form is subject to the terms of the Mozilla Public
3704 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3705 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3706 +
3707 +#ifndef nspr_dragonfly_defs_h___
3708 +#define nspr_dragonfly_defs_h___
3709 +
3710 +#include "prthread.h"
3711 +
3712 +#if 0
3713 +#if __FreeBSD__ >= 2
3714 +#include <osreldate.h>  /* for __FreeBSD_version */
3715 +#endif
3716 +#include <sys/syscall.h>
3717 +#endif
3718 +
3719 +#define PR_LINKER_ARCH "dragonfly"
3720 +#define _PR_SI_SYSNAME  "DRAGONFLY"
3721 +#if defined(__i386__)
3722 +#define _PR_SI_ARCHITECTURE "x86"
3723 +#elif defined(__amd64__)
3724 +#define _PR_SI_ARCHITECTURE "amd64"
3725 +#else
3726 +#error "Unknown CPU architecture"
3727 +#endif
3728 +
3729 +#define PR_DLL_SUFFIX          ".so"
3730 +
3731 +#define _PR_VMBASE              0x30000000
3732 +#define _PR_STACK_VMBASE       0x50000000
3733 +#define _MD_DEFAULT_STACK_SIZE 65536L
3734 +#define _MD_MMAP_FLAGS          MAP_PRIVATE
3735 +
3736 +#undef  HAVE_STACK_GROWING_UP
3737 +#define HAVE_DLL
3738 +#define USE_DLFCN
3739 +#define _PR_HAVE_SOCKADDR_LEN
3740 +#define _PR_STAT_HAS_ST_ATIMESPEC
3741 +#define _PR_HAVE_LARGE_OFF_T
3742 +
3743 +#define _PR_HAVE_GETPROTO_R
3744 +#define _PR_HAVE_5_ARG_GETPROTO_R
3745 +#define _PR_HAVE_GETHOST_R
3746 +#define _PR_HAVE_GETHOST_R_INT
3747 +
3748 +#define _PR_POLL_AVAILABLE
3749 +
3750 +#define _PR_HAVE_SYSV_SEMAPHORES
3751 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3752 +
3753 +#define _PR_INET6
3754 +#define _PR_HAVE_INET_NTOP
3755 +#define _PR_HAVE_GETHOSTBYNAME2
3756 +#define _PR_HAVE_GETADDRINFO
3757 +#define _PR_INET6_PROBE
3758 +#define _PR_IPV6_V6ONLY_PROBE
3759 +
3760 +#define USE_SETJMP
3761 +
3762 +#ifndef _PR_PTHREADS
3763 +#include <setjmp.h>
3764 +
3765 +#define PR_CONTEXT_TYPE        sigjmp_buf
3766 +
3767 +#define CONTEXT(_th) ((_th)->md.context)
3768 +
3769 +#define _MD_GET_SP(_th)    (_th)->md.context[0]._sjb[2]
3770 +#define PR_NUM_GCREGS  _JBLEN
3771 +
3772 +/*
3773 +** Initialize a thread context to run "_main()" when started
3774 +*/
3775 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status)  \
3776 +{  \
3777 +    *status = PR_TRUE;  \
3778 +    if (sigsetjmp(CONTEXT(_thread), 1)) {  \
3779 +        _main();  \
3780 +    }  \
3781 +    _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
3782 +}
3783 +
3784 +#define _MD_SWITCH_CONTEXT(_thread)  \
3785 +    if (!sigsetjmp(CONTEXT(_thread), 1)) {  \
3786 +       (_thread)->md.errcode = errno;  \
3787 +       _PR_Schedule();  \
3788 +    }
3789 +
3790 +/*
3791 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
3792 +*/
3793 +#define _MD_RESTORE_CONTEXT(_thread) \
3794 +{   \
3795 +    errno = (_thread)->md.errcode;  \
3796 +    _MD_SET_CURRENT_THREAD(_thread);  \
3797 +    siglongjmp(CONTEXT(_thread), 1);  \
3798 +}
3799 +
3800 +/* Machine-dependent (MD) data structures */
3801 +
3802 +struct _MDThread {
3803 +    PR_CONTEXT_TYPE context;
3804 +    int id;
3805 +    int errcode;
3806 +};
3807 +
3808 +struct _MDThreadStack {
3809 +    PRInt8 notused;
3810 +};
3811 +
3812 +struct _MDLock {
3813 +    PRInt8 notused;
3814 +};
3815 +
3816 +struct _MDSemaphore {
3817 +    PRInt8 notused;
3818 +};
3819 +
3820 +struct _MDCVar {
3821 +    PRInt8 notused;
3822 +};
3823 +
3824 +struct _MDSegment {
3825 +    PRInt8 notused;
3826 +};
3827 +
3828 +/*
3829 + * md-specific cpu structure field
3830 + */
3831 +#define _PR_MD_MAX_OSFD FD_SETSIZE
3832 +
3833 +struct _MDCPU_Unix {
3834 +    PRCList ioQ;
3835 +    PRUint32 ioq_timeout;
3836 +    PRInt32 ioq_max_osfd;
3837 +    PRInt32 ioq_osfd_cnt;
3838 +#ifndef _PR_USE_POLL
3839 +    fd_set fd_read_set, fd_write_set, fd_exception_set;
3840 +    PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
3841 +                               fd_exception_cnt[_PR_MD_MAX_OSFD];
3842 +#else
3843 +       struct pollfd *ioq_pollfds;
3844 +       int ioq_pollfds_size;
3845 +#endif /* _PR_USE_POLL */
3846 +};
3847 +
3848 +#define _PR_IOQ(_cpu)                  ((_cpu)->md.md_unix.ioQ)
3849 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
3850 +#define _PR_FD_READ_SET(_cpu)          ((_cpu)->md.md_unix.fd_read_set)
3851 +#define _PR_FD_READ_CNT(_cpu)          ((_cpu)->md.md_unix.fd_read_cnt)
3852 +#define _PR_FD_WRITE_SET(_cpu)         ((_cpu)->md.md_unix.fd_write_set)
3853 +#define _PR_FD_WRITE_CNT(_cpu)         ((_cpu)->md.md_unix.fd_write_cnt)
3854 +#define _PR_FD_EXCEPTION_SET(_cpu)     ((_cpu)->md.md_unix.fd_exception_set)
3855 +#define _PR_FD_EXCEPTION_CNT(_cpu)     ((_cpu)->md.md_unix.fd_exception_cnt)
3856 +#define _PR_IOQ_TIMEOUT(_cpu)          ((_cpu)->md.md_unix.ioq_timeout)
3857 +#define _PR_IOQ_MAX_OSFD(_cpu)         ((_cpu)->md.md_unix.ioq_max_osfd)
3858 +#define _PR_IOQ_OSFD_CNT(_cpu)         ((_cpu)->md.md_unix.ioq_osfd_cnt)
3859 +#define _PR_IOQ_POLLFDS(_cpu)          ((_cpu)->md.md_unix.ioq_pollfds)
3860 +#define _PR_IOQ_POLLFDS_SIZE(_cpu)     ((_cpu)->md.md_unix.ioq_pollfds_size)
3861 +
3862 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
3863 +
3864 +struct _MDCPU {
3865 +       struct _MDCPU_Unix md_unix;
3866 +};
3867 +
3868 +#define _MD_INIT_LOCKS()
3869 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
3870 +#define _MD_FREE_LOCK(lock)
3871 +#define _MD_LOCK(lock)
3872 +#define _MD_UNLOCK(lock)
3873 +#define _MD_INIT_IO()
3874 +#define _MD_IOQ_LOCK()
3875 +#define _MD_IOQ_UNLOCK()
3876 +
3877 +extern PRStatus _MD_InitializeThread(PRThread *thread);
3878 +
3879 +#define _MD_INIT_RUNNING_CPU(cpu)       _MD_unix_init_running_cpu(cpu)
3880 +#define _MD_INIT_THREAD                 _MD_InitializeThread
3881 +#define _MD_EXIT_THREAD(thread)
3882 +#define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
3883 +#define _MD_RESUME_THREAD(thread)       _MD_resume_thread
3884 +#define _MD_CLEAN_THREAD(_thread)
3885 +
3886 +extern PRStatus _MD_CREATE_THREAD(
3887 +    PRThread *thread,
3888 +    void (*start) (void *),
3889 +    PRThreadPriority priority,
3890 +    PRThreadScope scope,
3891 +    PRThreadState state,
3892 +    PRUint32 stackSize);
3893 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
3894 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
3895 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
3896 +extern void _MD_YIELD(void);
3897 +
3898 +#endif /* ! _PR_PTHREADS */
3899 +
3900 +extern void _MD_EarlyInit(void);
3901 +
3902 +#define _MD_EARLY_INIT                  _MD_EarlyInit
3903 +#define _MD_FINAL_INIT                 _PR_UnixInit
3904 +#define _MD_INTERVAL_USE_GTOD
3905 +
3906 +/*
3907 + * We wrapped the select() call.  _MD_SELECT refers to the built-in,
3908 + * unwrapped version.
3909 + */
3910 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
3911 +
3912 +#if defined(_PR_POLL_AVAILABLE)
3913 +#include <poll.h>
3914 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
3915 +#endif
3916 +
3917 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
3918 +   want to be including that.. */
3919 +#ifndef INADDR_LOOPBACK
3920 +#define INADDR_LOOPBACK         (u_long)0x7F000001
3921 +#endif
3922 +
3923 +/* For writev() */
3924 +#include <sys/uio.h>
3925 +
3926 +#endif /* nspr_freebsd_defs_h___ */
3927
3928
3929 [FILE:875:dragonfly/patch-nsprpub_pr_include_md__freebsd.h]
3930 --- pr/include/md/_freebsd.h.orig       2019-10-22 17:25:38 UTC
3931 +++ pr/include/md/_freebsd.h
3932 @@ -67,7 +67,7 @@
3933  #define _PR_HAVE_GETHOST_R
3934  #define _PR_HAVE_GETHOST_R_INT
3935  #endif
3936 -#if __FreeBSD_version >= 400008
3937 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
3938  /*
3939   * libc_r before this version of FreeBSD doesn't have poll().
3940   * Although libc has poll(), it is not thread-safe so we can't
3941 @@ -76,7 +76,7 @@
3942  #define _PR_POLL_AVAILABLE
3943  #endif
3944  #else
3945 -#if __FreeBSD_version >= 300000
3946 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
3947  #define _PR_POLL_AVAILABLE
3948  #define _PR_USE_POLL
3949  #endif
3950 @@ -85,7 +85,7 @@
3951  #define _PR_HAVE_SYSV_SEMAPHORES
3952  #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3953  
3954 -#if __FreeBSD_version >= 400014
3955 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
3956  #define _PR_INET6
3957  #define _PR_HAVE_INET_NTOP
3958  #define _PR_HAVE_GETHOSTBYNAME2
3959
3960
3961 [FILE:279:dragonfly/patch-nsprpub_pr_include_md_prosdep.h]
3962 --- pr/include/md/prosdep.h.orig        2019-10-15 14:21:38 UTC
3963 +++ pr/include/md/prosdep.h
3964 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
3965  #elif defined(OPENBSD)
3966  #include "md/_openbsd.h"
3967  
3968 +#elif defined(__DragonFly__)
3969 +#include "md/_dragonfly.h"
3970 +
3971  #elif defined(BSDI)
3972  #include "md/_bsdi.h"
3973  
3974
3975
3976 [FILE:403:dragonfly/patch-nsprpub_pr_src_md_unix_uxrng.c]
3977 --- pr/src/md/unix/uxrng.c.orig 2019-10-15 14:21:38 UTC
3978 +++ pr/src/md/unix/uxrng.c
3979 @@ -64,6 +64,7 @@ GetHighResClock(void *buf, size_t maxbyt
3980  \f
3981  #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
3982      || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
3983 +    || defined(__DragonFly__) \
3984      || defined(__GNU__))
3985  #include <sys/types.h>
3986  #include <sys/stat.h>
3987
3988
3989 [FILE:690:dragonfly/patch-nsprpub_pr_src_misc_prnetdb.c]
3990 --- pr/src/misc/prnetdb.c.orig  2019-10-22 17:25:38 UTC
3991 +++ pr/src/misc/prnetdb.c
3992 @@ -73,6 +73,11 @@ PRLock *_pr_dnsLock = NULL;
3993  #define _PR_HAVE_GETPROTO_R_INT
3994  #endif
3995  
3996 +#if defined(DRAGONFLY)
3997 +#define _PR_HAVE_GETPROTO_R
3998 +#define _PR_HAVE_5_ARG_GETPROTO_R
3999 +#endif
4000 +
4001  /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
4002  #if (defined(__GLIBC__) && __GLIBC__ >= 2)
4003  #define _PR_HAVE_GETPROTO_R
4004 @@ -299,7 +304,7 @@ _pr_QueryNetIfs(void)
4005  }
4006  
4007  #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
4008 -    || defined(NETBSD) || defined(OPENBSD)
4009 +    || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
4010  
4011  /*
4012   * Use the BSD getifaddrs function.
4013
4014
4015 [FILE:439:dragonfly/patch-nsprpub_pr_src_pthreads_ptsynch.c]
4016 --- pr/src/pthreads/ptsynch.c.orig      2019-10-22 17:25:38 UTC
4017 +++ pr/src/pthreads/ptsynch.c
4018 @@ -952,6 +952,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
4019   */
4020  #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
4021      || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
4022 +    || defined(__DragonFly__) \
4023      || defined(OPENBSD) || defined(BSDI) \
4024      || defined(DARWIN)
4025  /* union semun is defined by including <sys/sem.h> */
4026
4027
4028 [FILE:1235:dragonfly/patch-pr_include_md___pth.h]
4029 --- pr/include/md/_pth.h.orig   2019-10-15 14:21:38 UTC
4030 +++ pr/include/md/_pth.h
4031 @@ -86,6 +86,7 @@
4032   */
4033  #if defined(AIX) || defined(SOLARIS) \
4034      || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4035 +    || defined(__DragonFly__) \
4036      || defined(HPUX) || defined(FREEBSD) \
4037      || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
4038      || defined(NTO) || defined(DARWIN) \
4039 @@ -133,6 +134,7 @@
4040  #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
4041  #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
4042  #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4043 +    || defined(__DragonFly__) \
4044      || defined(FREEBSD)
4045  #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
4046  #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
4047 @@ -175,6 +177,7 @@ extern int (*_PT_aix_yield_fcn)();
4048  #define _PT_PTHREAD_YIELD()         (*_PT_aix_yield_fcn)()
4049  #elif defined(HPUX) || defined(SOLARIS) \
4050      || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4051 +    || defined(__DragonFly__) \
4052      || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4053      || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4054      || defined(UNIXWARE) || defined(RISCOS)
4055