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