1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Platform-neutral API for system-like functions
8 HOMEPAGE= http://www.mozilla.org/projects/nspr/index.html
12 SITES[main]= MOZILLA/nspr/releases/v4.23/src
13 DISTFILE[1]= nspr-4.23.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
22 DISTNAME= nspr-4.23/nspr
24 CPE_PRODUCT= netscape_portable_runtime
26 FPC_EQUIVALENT= devel/nspr
29 CONFIGURE_ARGS= --enable-64bit
32 # Do not install tools to build itself
33 ${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
34 ${WRKSRC}/pr/src/misc/Makefile.in
37 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.${LIBEXT}
39 [FILE:207:descriptions/desc.single]
40 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
41 system level and libc like functions. The API is used in the Mozilla
42 client, many of Netscape/AOL/iPlanet's and other software offerings.
46 4b9d821037faf5723da901515ed9cac8b23ef1ea3729022259777393453477a4 1078660 nspr-4.23.tar.gz
49 [FILE:1157:manifests/plist.single]
50 %%ONLY-DRAGONFLY%%include/nspr/md/_dragonfly.cfg
122 include/nspr/obsolete/
127 include/nspr/private/
131 @(,,444) lib/libnspr4.a
132 @(,,444) lib/libnspr4.so
133 @(,,444) lib/libplc4.a
134 @(,,444) lib/libplc4.so
135 @(,,444) lib/libplds4.a
136 @(,,444) lib/libplds4.so
137 lib/pkgconfig/nspr.pc
138 share/aclocal/nspr.m4
141 [FILE:1192:patches/patch-bug301986]
142 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
143 Better to just keep calling it pthread_t isntead of casting to anything.
147 --- pr/include/private/pprthred.h.orig 2019-10-15 14:21:38 UTC
148 +++ pr/include/private/pprthred.h
153 +#include <pthread.h>
157 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
158 ** Get the id of the named thread. Each thread is assigned a unique id
159 ** when it is created or attached.
161 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
162 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
165 ** Set the procedure that is called when a thread is dumped. The procedure
166 --- pr/src/pthreads/ptthread.c.orig 2019-10-15 14:21:38 UTC
167 +++ pr/src/pthreads/ptthread.c
168 @@ -1183,9 +1183,9 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
172 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
173 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
175 - return (PRUint32)thred->id; /* and I don't know what they will do with it */
176 + return thred->id; /* and I don't know what they will do with it */
182 [FILE:916:patches/patch-bug782109]
183 --- pr/include/md/_freebsd.h.orig 2018-08-28 12:42:28 UTC
184 +++ pr/include/md/_freebsd.h
186 #define _PR_HAVE_LARGE_OFF_T
188 #if defined(_PR_PTHREADS)
189 +#if __FreeBSD_version >= 602000
190 +#define _PR_HAVE_GETPROTO_R
191 +#define _PR_HAVE_5_ARG_GETPROTO_R
193 +#if __FreeBSD_version >= 700016
194 +#define _PR_HAVE_GETHOST_R
195 +#define _PR_HAVE_GETHOST_R_INT
197 #if __FreeBSD_version >= 400008
199 * libc_r before this version of FreeBSD doesn't have poll().
200 --- pr/src/misc/prnetdb.c.orig 2018-08-28 12:42:28 UTC
201 +++ pr/src/misc/prnetdb.c
202 @@ -81,11 +81,6 @@ PRLock *_pr_dnsLock = NULL;
203 #define _PR_HAVE_GETPROTO_R_INT
206 -#if __FreeBSD_version >= 602000
207 -#define _PR_HAVE_GETPROTO_R
208 -#define _PR_HAVE_5_ARG_GETPROTO_R
211 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
212 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
213 #define _PR_HAVE_GETPROTO_R
216 [FILE:489:patches/patch-config_nspr.pc.in]
217 --- config/nspr.pc.in.orig 2019-10-15 14:21:38 UTC
218 +++ config/nspr.pc.in
219 @@ -6,5 +6,5 @@ includedir=@includedir@
221 Description: The Netscape Portable Runtime
222 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
223 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
224 -Cflags: -I@includedir@
225 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
226 +Cflags: -I${includedir}
229 [FILE:2589:patches/patch-configure]
230 --- configure.orig 2019-10-15 14:21:38 UTC
232 @@ -6559,6 +6559,21 @@ tools are selected during the Xcode/Deve
237 + if test -z "$USE_NSPR_THREADS"; then
240 + $as_echo "#define XP_UNIX 1" >>confdefs.h
241 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
242 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
243 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
244 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
246 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
247 + MDCPUCFG_H=_dragonfly.cfg
248 + PR_MD_CSRCS=freebsd.c
252 if test -z "$USE_NSPR_THREADS"; then
254 @@ -7228,7 +7243,6 @@ $as_echo "$as_me: WARNING: Unknown versi
256 MDCPUCFG_H=_solaris.cfg
257 PR_MD_CSRCS=solaris.c
259 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
260 RESOLVE_LINK_SYMBOLS=1
261 case "${OS_RELEASE}" in
262 @@ -7236,7 +7250,6 @@ $as_echo "$as_me: WARNING: Unknown versi
265 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
269 if test -n "$GNU_CC"; then
270 @@ -7932,7 +7945,7 @@ $as_echo_n "checking whether ${CC-cc} ac
271 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
272 ac_cv_have_dash_pthread=yes
275 + freebsd*|dragonfly*)
276 # Freebsd doesn't use -pthread for compiles, it uses them for linking
279 @@ -7970,7 +7983,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
284 + *-freebsd*|*-dragonfly*)
285 $as_echo "#define _REENTRANT 1" >>confdefs.h
287 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
288 @@ -8060,7 +8073,7 @@ case "$target" in
293 +*-freebsd*|*-dragonfly*)
294 if test -n "$USE_NSPR_THREADS"; then
295 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
297 @@ -8113,17 +8126,7 @@ _ACEOF
299 $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
301 - if test "$OS_TEST" = "i86pc"; then
302 - if test -n "$USE_64"; then
303 - PR_MD_ASFILES=os_SunOS_x86_64.s
305 - PR_MD_ASFILES=os_SunOS_x86.s
308 - if test -n "$USE_64"; then
309 - PR_MD_ASFILES=os_SunOS_sparcv9.s
312 + PR_MD_ASFILES=os_SunOS_x86_64.s
318 [FILE:29818:patches/patch-libtests]
319 --- lib/tests/arena.c.orig 2019-10-15 14:21:38 UTC
320 +++ lib/tests/arena.c
321 @@ -36,6 +36,7 @@ void DumpAll( void )
327 ** Test Arena allocation.
329 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
332 } /* end ArenaGrow() */
337 --- lib/tests/base64t.c.orig 2019-10-15 14:21:38 UTC
338 +++ lib/tests/base64t.c
339 @@ -2362,7 +2362,6 @@ PRBool test_008(void)
340 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
342 PRUint32 plen = PL_strlen(array[i].plaintext);
343 - PRUint32 clen = ((plen + 2)/3)*4;
345 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
347 @@ -3122,9 +3121,6 @@ PRBool test_024(void)
349 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
351 - PRUint32 plen = PL_strlen(array[i].plaintext);
352 - PRUint32 clen = ((plen + 2)/3)*4;
354 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
356 if( (char *)0 == rv )
357 @@ -3258,8 +3254,6 @@ PRBool test_027(void)
359 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
361 - PRUint32 clen = PL_strlen(array[i].cyphertext);
363 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
365 if( (char *)0 == rv )
366 --- lib/tests/string.c.orig 2019-10-15 14:21:38 UTC
367 +++ lib/tests/string.c
368 @@ -127,7 +127,7 @@ PRBool test_003(void)
369 rv = PL_strcpy(array[i].dest, array[i].str);
370 if( array[i].rv != rv )
372 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
373 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
374 array[i].str ? array[i].str : "(null)", rv);
377 @@ -240,8 +240,8 @@ PRBool test_004(void)
378 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
379 if( array[i].rv != rv )
381 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
382 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
383 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
384 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
388 @@ -367,8 +367,8 @@ PRBool test_005(void)
389 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
390 if( array[i].rv != rv )
392 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
393 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
394 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
395 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
399 @@ -421,7 +421,7 @@ PRBool test_006(void)
401 if( (char *)0 == rv )
403 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
404 + printf("FAIL %d: %p -> 0\n", i, array[i]);
408 @@ -507,8 +507,8 @@ PRBool test_007(void)
410 if( (char *)0 == rv )
412 - printf("FAIL %d: %s,%lu -> 0\n", i,
413 - array[i].str ? array[i].str : "(null)", array[i].len);
414 + printf("FAIL %d: %s,%u -> 0\n", i,
415 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
419 @@ -700,10 +700,10 @@ PRBool test_009(void)
421 if( (char *)0 != rv )
423 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
424 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
425 array[i].first ? array[i].first : "(null)",
426 array[i].second ? array[i].second : "(null)",
427 - array[i].length, rv);
428 + (unsigned)array[i].length, rv);
432 @@ -711,10 +711,10 @@ PRBool test_009(void)
434 if( (char *)0 == rv )
436 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
437 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
438 array[i].first ? array[i].first : "(null)",
439 array[i].second ? array[i].second : "(null)",
440 - array[i].length, array[i].result);
441 + (unsigned)array[i].length, array[i].result);
445 @@ -726,10 +726,10 @@ PRBool test_009(void)
449 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
450 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
451 array[i].first ? array[i].first : "(null)",
452 array[i].second ? array[i].second : "(null)",
453 - array[i].length, rv, array[i].result);
454 + (unsigned)array[i].length, rv, array[i].result);
458 @@ -741,10 +741,10 @@ PRBool test_009(void)
462 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
463 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
464 array[i].first ? array[i].first : "(null)",
465 array[i].second ? array[i].second : "(null)",
467 + (unsigned)array[i].length);
471 @@ -752,10 +752,10 @@ PRBool test_009(void)
475 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
476 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
477 array[i].first ? array[i].first : "(null)",
478 array[i].second ? array[i].second : "(null)",
480 + (unsigned)array[i].length);
484 @@ -832,10 +832,10 @@ PRBool test_010(void)
486 if( (char *)0 != rv )
488 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
489 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
490 array[i].first ? array[i].first : "(null)",
491 array[i].second ? array[i].second : "(null)",
492 - array[i].length, rv);
493 + (unsigned)array[i].length, rv);
497 @@ -843,10 +843,10 @@ PRBool test_010(void)
499 if( (char *)0 == rv )
501 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
502 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
503 array[i].first ? array[i].first : "(null)",
504 array[i].second ? array[i].second : "(null)",
505 - array[i].length, array[i].result);
506 + (unsigned)array[i].length, array[i].result);
510 @@ -858,10 +858,10 @@ PRBool test_010(void)
514 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
515 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
516 array[i].first ? array[i].first : "(null)",
517 array[i].second ? array[i].second : "(null)",
518 - array[i].length, rv, array[i].result);
519 + (unsigned)array[i].length, rv, array[i].result);
523 @@ -1104,10 +1104,10 @@ PRBool test_012(void)
527 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
528 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
529 array[i].one ? array[i].one : "(null)",
530 array[i].two ? array[i].two : "(null)",
531 - array[i].max, rv, array[i].sign);
532 + (int)array[i].max, rv, array[i].sign);
536 @@ -1338,10 +1338,10 @@ PRBool test_014(void)
540 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
541 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
542 array[i].one ? array[i].one : "(null)",
543 array[i].two ? array[i].two : "(null)",
544 - array[i].max, rv, array[i].sign);
545 + (int)array[i].max, rv, array[i].sign);
549 @@ -1411,15 +1411,15 @@ PRBool test_015(void)
551 if( (char *)0 == rv )
553 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
554 - array[i].chr, array[i].off);
555 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
556 + array[i].chr, (unsigned)array[i].off);
560 if( &array[i].str[ array[i].off ] != rv )
562 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
563 - array[i].chr, rv, array[i].str, array[i].off);
564 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
565 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
569 @@ -1491,15 +1491,15 @@ PRBool test_016(void)
571 if( (char *)0 == rv )
573 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
574 - array[i].chr, array[i].off);
575 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
576 + array[i].chr, (unsigned)array[i].off);
580 if( &array[i].str[ array[i].off ] != rv )
582 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
583 - array[i].chr, rv, array[i].str, array[i].off);
584 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
585 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
589 @@ -1566,8 +1566,8 @@ PRBool test_017(void)
591 if( (char *)0 != rv )
593 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
594 - array[i].chr, array[i].max, rv);
595 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
596 + array[i].chr, (unsigned)array[i].max, rv);
600 @@ -1575,15 +1575,15 @@ PRBool test_017(void)
602 if( (char *)0 == rv )
604 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
605 - array[i].chr, array[i].max, array[i].off);
606 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
607 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
611 if( &array[i].str[ array[i].off ] != rv )
613 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
614 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
615 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
616 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
620 @@ -1650,8 +1650,8 @@ PRBool test_018(void)
622 if( (char *)0 != rv )
624 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
625 - array[i].chr, array[i].max, rv);
626 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
627 + array[i].chr, (unsigned)array[i].max, rv);
631 @@ -1659,15 +1659,15 @@ PRBool test_018(void)
633 if( (char *)0 == rv )
635 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
636 - array[i].chr, array[i].max, array[i].off);
637 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
638 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
642 - if( &array[i].str[ array[i].off ] != rv )
643 + if( &array[i].str[ array[i].off ] != rv)
645 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
646 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
647 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
648 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
652 @@ -1746,19 +1746,19 @@ PRBool test_019(void)
654 if( (char *)0 == rv )
656 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
657 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
658 array[i].str ? array[i].str : "(null)",
659 array[i].chrs ? array[i].chrs : "(null)",
661 + (unsigned)array[i].off);
665 if( &array[i].str[ array[i].off ] != rv )
667 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
668 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
669 array[i].str ? array[i].str : "(null)",
670 array[i].chrs ? array[i].chrs : "(null)",
671 - rv, array[i].str, array[i].off);
672 + rv, array[i].str, (unsigned)array[i].off);
676 @@ -1837,19 +1837,19 @@ PRBool test_020(void)
678 if( (char *)0 == rv )
680 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
681 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
682 array[i].str ? array[i].str : "(null)",
683 array[i].chrs ? array[i].chrs : "(null)",
685 + (unsigned)array[i].off);
689 if( &array[i].str[ array[i].off ] != rv )
691 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
692 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
693 array[i].str ? array[i].str : "(null)",
694 array[i].chrs ? array[i].chrs : "(null)",
695 - rv, array[i].str, array[i].off);
696 + rv, array[i].str, (unsigned)array[i].off);
700 @@ -1923,10 +1923,10 @@ PRBool test_021(void)
702 if( (char *)0 != rv )
704 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
705 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
706 array[i].str ? array[i].str : "(null)",
707 array[i].chrs ? array[i].chrs : "(null)",
709 + (unsigned)array[i].max, rv);
713 @@ -1934,19 +1934,19 @@ PRBool test_021(void)
715 if( (char *)0 == rv )
717 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
718 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
719 array[i].str ? array[i].str : "(null)",
720 array[i].chrs ? array[i].chrs : "(null)",
721 - array[i].max, array[i].off);
722 + (unsigned)array[i].max, array[i].off);
726 if( &array[i].str[ array[i].off ] != rv )
728 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
729 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
730 array[i].str ? array[i].str : "(null)",
731 array[i].chrs ? array[i].chrs : "(null)",
732 - array[i].max, rv, array[i].str, array[i].off);
733 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
737 @@ -2029,10 +2029,10 @@ PRBool test_022(void)
739 if( (char *)0 != rv )
741 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
742 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
743 array[i].str ? array[i].str : "(null)",
744 array[i].chrs ? array[i].chrs : "(null)",
746 + (unsigned)array[i].max, rv);
750 @@ -2040,19 +2040,19 @@ PRBool test_022(void)
752 if( (char *)0 == rv )
754 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
755 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
756 array[i].str ? array[i].str : "(null)",
757 array[i].chrs ? array[i].chrs : "(null)",
758 - array[i].max, array[i].off);
759 + (unsigned)array[i].max, array[i].off);
763 if( &array[i].str[ array[i].off ] != rv )
765 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
766 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
767 array[i].str ? array[i].str : "(null)",
768 array[i].chrs ? array[i].chrs : "(null)",
769 - array[i].max, rv, array[i].str, array[i].off);
770 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
774 @@ -2148,19 +2148,19 @@ PRBool test_023(void)
776 if( (char *)0 == rv )
778 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
779 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
780 array[i].str ? array[i].str : "(null)",
781 array[i].sub ? array[i].sub : "(null)",
782 - array[i].str, array[i].off);
783 + array[i].str, (unsigned)array[i].off);
787 if( &array[i].str[ array[i].off ] != rv )
789 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
790 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
791 array[i].str ? array[i].str : "(null)",
792 array[i].sub ? array[i].sub : "(null)",
793 - rv, array[i].str, array[i].off);
794 + rv, array[i].str, (unsigned)array[i].off);
798 @@ -2256,19 +2256,19 @@ PRBool test_024(void)
800 if( (char *)0 == rv )
802 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
803 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
804 array[i].str ? array[i].str : "(null)",
805 array[i].sub ? array[i].sub : "(null)",
806 - array[i].str, array[i].off);
807 + array[i].str, (unsigned)array[i].off);
811 if( &array[i].str[ array[i].off ] != rv )
813 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
814 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
815 array[i].str ? array[i].str : "(null)",
816 array[i].sub ? array[i].sub : "(null)",
817 - rv, array[i].str, array[i].off);
818 + rv, array[i].str, (unsigned)array[i].off);
822 @@ -2375,10 +2375,10 @@ PRBool test_025(void)
824 if( (char *)0 != rv )
826 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
827 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
828 array[i].str ? array[i].str : "(null)",
829 array[i].sub ? array[i].sub : "(null)",
831 + (unsigned)array[i].max, rv);
835 @@ -2386,19 +2386,19 @@ PRBool test_025(void)
837 if( (char *)0 == rv )
839 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
840 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
841 array[i].str ? array[i].str : "(null)",
842 array[i].sub ? array[i].sub : "(null)",
843 - array[i].max, array[i].str, array[i].off);
844 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
848 if( &array[i].str[ array[i].off ] != rv )
850 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
851 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
852 array[i].str ? array[i].str : "(null)",
853 array[i].sub ? array[i].sub : "(null)",
854 - array[i].max, rv, array[i].str, array[i].off);
855 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
859 @@ -2507,10 +2507,10 @@ PRBool test_026(void)
861 if( (char *)0 != rv )
863 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
864 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
865 array[i].str ? array[i].str : "(null)",
866 array[i].sub ? array[i].sub : "(null)",
868 + (unsigned)array[i].max, rv);
872 @@ -2518,19 +2518,19 @@ PRBool test_026(void)
874 if( (char *)0 == rv )
876 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
877 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
878 array[i].str ? array[i].str : "(null)",
879 array[i].sub ? array[i].sub : "(null)",
880 - array[i].max, array[i].str, array[i].off);
881 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
885 if( &array[i].str[ array[i].off ] != rv )
887 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
888 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
889 array[i].str ? array[i].str : "(null)",
890 array[i].sub ? array[i].sub : "(null)",
891 - array[i].max, rv, array[i].str, array[i].off);
892 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
896 @@ -2626,19 +2626,19 @@ PRBool test_027(void)
898 if( (char *)0 == rv )
900 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
901 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
902 array[i].str ? array[i].str : "(null)",
903 array[i].sub ? array[i].sub : "(null)",
904 - array[i].str, array[i].off);
905 + array[i].str, (unsigned)array[i].off);
909 if( &array[i].str[ array[i].off ] != rv )
911 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
912 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
913 array[i].str ? array[i].str : "(null)",
914 array[i].sub ? array[i].sub : "(null)",
915 - rv, array[i].str, array[i].off);
916 + rv, array[i].str, (unsigned)array[i].off);
920 @@ -2734,19 +2734,19 @@ PRBool test_028(void)
922 if( (char *)0 == rv )
924 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
925 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
926 array[i].str ? array[i].str : "(null)",
927 array[i].sub ? array[i].sub : "(null)",
928 - array[i].str, array[i].off);
929 + array[i].str, (unsigned)array[i].off);
933 if( &array[i].str[ array[i].off ] != rv )
935 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
936 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
937 array[i].str ? array[i].str : "(null)",
938 array[i].sub ? array[i].sub : "(null)",
939 - rv, array[i].str, array[i].off);
940 + rv, array[i].str, (unsigned)array[i].off);
944 @@ -2853,10 +2853,10 @@ PRBool test_029(void)
946 if( (char *)0 != rv )
948 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
949 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
950 array[i].str ? array[i].str : "(null)",
951 array[i].sub ? array[i].sub : "(null)",
953 + (unsigned)array[i].max, rv);
957 @@ -2864,19 +2864,19 @@ PRBool test_029(void)
959 if( (char *)0 == rv )
961 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
962 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
963 array[i].str ? array[i].str : "(null)",
964 array[i].sub ? array[i].sub : "(null)",
965 - array[i].max, array[i].str, array[i].off);
966 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
970 if( &array[i].str[ array[i].off ] != rv )
972 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
973 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
974 array[i].str ? array[i].str : "(null)",
975 array[i].sub ? array[i].sub : "(null)",
976 - array[i].max, rv, array[i].str, array[i].off);
977 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
981 @@ -2985,10 +2985,10 @@ PRBool test_030(void)
983 if( (char *)0 != rv )
985 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
986 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
987 array[i].str ? array[i].str : "(null)",
988 array[i].sub ? array[i].sub : "(null)",
990 + (unsigned)array[i].max, rv);
994 @@ -2996,19 +2996,19 @@ PRBool test_030(void)
996 if( (char *)0 == rv )
998 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
999 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
1000 array[i].str ? array[i].str : "(null)",
1001 array[i].sub ? array[i].sub : "(null)",
1002 - array[i].max, array[i].str, array[i].off);
1003 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
1007 if( &array[i].str[ array[i].off ] != rv )
1009 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
1010 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
1011 array[i].str ? array[i].str : "(null)",
1012 array[i].sub ? array[i].sub : "(null)",
1013 - array[i].max, rv, array[i].str, array[i].off);
1014 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
1020 [FILE:972:patches/patch-pr_src_pthreads_ptio.c]
1021 --- pr/src/pthreads/ptio.c.orig 2019-03-07 10:04:05 UTC
1022 +++ pr/src/pthreads/ptio.c
1023 @@ -182,6 +182,7 @@ static PRBool _pr_ipv6_v6only_on_by_defa
1024 || defined(HPUX10_30) || defined(HPUX11) \
1025 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1026 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1027 + || defined(__DragonFly__) \
1028 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1029 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
1030 #define _PRSelectFdSetArg_t fd_set *
1031 @@ -3355,6 +3356,7 @@ static PRIOMethods _pr_socketpollfd_meth
1032 #if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
1033 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1034 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
1035 + || defined(__DragonFly__) \
1036 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
1037 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS) \
1041 [FILE:85450:patches/patch-tests]
1042 --- lib/tests/Makefile.in.orig 2019-10-15 14:21:38 UTC
1043 +++ lib/tests/Makefile.in
1044 @@ -159,7 +159,7 @@ else
1045 ifeq ($(OS_ARCH),OS2)
1046 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1048 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1049 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1053 --- pr/tests/Makefile.in.orig 2019-10-15 14:21:38 UTC
1054 +++ pr/tests/Makefile.in
1055 @@ -442,17 +442,18 @@ endif
1058 runtests:: $(PROGS) ALWAYS
1059 - @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
1060 - @$(ECHO) "BEGIN\t\t\t`date`"
1061 - @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
1062 - @$(ECHO) "Test\t\t\tResult\n"
1063 + @$(ECHO) "NSPR Test Results - $(OBJDIR)"
1064 + @$(ECHO) "BEGIN `date`"
1065 + @$(ECHO) "Test Result"
1066 @cd $(OBJDIR); for i in $(PROGRAMS); do \
1067 - $(ECHO) "$$i\c"; \
1068 - ./$$i >> $(LOGFILE) 2>&1 ; \
1070 + ./$$i > $$i.output 2>&1; \
1071 if [ 0 = $$? ] ; then \
1072 - $(ECHO) "\t\t\tPassed"; \
1074 - $(ECHO) "\t\t\tFAILED"; \
1076 + $(ECHO) " Passed"; \
1079 + $(ECHO) " FAILED"; \
1083 - @$(ECHO) "\nEND\t\t`date`\n"
1084 + @$(ECHO) "END `date`"
1085 --- pr/tests/cleanup.c.orig 2019-10-15 14:21:38 UTC
1086 +++ pr/tests/cleanup.c
1089 static void PR_CALLBACK Thread(void *sleep)
1091 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1092 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1093 printf("Thread exiting\n");
1096 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1097 PRThreadScope type = PR_LOCAL_THREAD;
1098 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1099 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1100 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1101 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1102 + intptr_t child_sleep = 10;
1105 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1106 @@ -82,7 +83,7 @@ int main(int argc, char **argv)
1107 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1108 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1109 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1110 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1111 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1112 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1113 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1115 --- pr/tests/cltsrv.c.orig 2019-10-15 14:21:38 UTC
1116 +++ pr/tests/cltsrv.c
1117 @@ -931,7 +931,7 @@ int main(int argc, char** argv)
1121 - CSClient_t *client;
1122 + CSClient_t *client = NULL;
1123 PRStatus rv, joinStatus;
1124 CSServer_t *server = NULL;
1126 --- pr/tests/cvar.c.orig 2019-10-15 14:21:38 UTC
1128 @@ -138,15 +138,15 @@ static int alive;
1129 static void PR_CALLBACK CXReader(void *arg)
1131 CircBuf *cbp = (CircBuf *)arg;
1137 for (i = 0; i < n; i++) {
1138 data = GetCBData(cbp);
1139 - if ((int)data != i)
1140 + if ((intptr_t)data != i)
1142 - printf("data mismatch at for i = %d usec\n", i);
1143 + printf("data mismatch at for i = %ld usec\n", (long)i);
1147 @@ -159,7 +159,7 @@ static void PR_CALLBACK CXReader(void *a
1148 static void PR_CALLBACK CXWriter(void *arg)
1150 CircBuf *cbp = (CircBuf *)arg;
1155 for (i = 0; i < n; i++) {
1156 --- pr/tests/cvar2.c.orig 2019-10-15 14:21:38 UTC
1157 +++ pr/tests/cvar2.c
1158 @@ -96,7 +96,7 @@ PrivateCondVarThread(void *_info)
1159 for (index=0; index<info->loops; index++) {
1160 PR_Lock(info->lock);
1161 if (*info->tcount == 0) {
1162 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1163 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1164 PR_GetCurrentThread(), info->cvar));
1165 PR_WaitCondVar(info->cvar, info->timeout);
1167 @@ -109,8 +109,8 @@ PrivateCondVarThread(void *_info)
1168 PR_Lock(info->exitlock);
1169 (*info->exitcount)++;
1170 PR_NotifyCondVar(info->exitcvar);
1171 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1172 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1173 + DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1174 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1175 PR_Unlock(info->exitlock);
1178 @@ -159,7 +159,7 @@ CreateTestThread(threadinfo *info,
1180 CondVarTestSUU(void *_arg)
1182 - PRInt32 arg = (PRInt32)_arg;
1183 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1184 PRInt32 index, loops;
1187 @@ -191,7 +191,7 @@ CondVarTestSUU(void *_arg)
1191 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1192 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1195 for (loops = 0; loops < count; loops++) {
1196 @@ -201,7 +201,7 @@ CondVarTestSUU(void *_arg)
1197 (*list[index].tcount)++;
1198 PR_NotifyCondVar(list[index].cvar);
1199 PR_Unlock(list[index].lock);
1200 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1201 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1202 PR_GetCurrentThread(), list[index].cvar));
1205 @@ -231,7 +231,7 @@ CondVarTestSUU(void *_arg)
1207 CondVarTestSUK(void *_arg)
1209 - PRInt32 arg = (PRInt32)_arg;
1210 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1211 PRInt32 index, loops;
1214 @@ -307,7 +307,7 @@ CondVarTestSUK(void *_arg)
1216 CondVarTestPUU(void *_arg)
1218 - PRInt32 arg = (PRInt32)_arg;
1219 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1220 PRInt32 index, loops;
1223 @@ -342,7 +342,7 @@ CondVarTestPUU(void *_arg)
1227 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1228 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1232 @@ -360,8 +360,8 @@ CondVarTestPUU(void *_arg)
1234 /* Wait for threads to finish */
1235 while(exitcount < arg) {
1236 - DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1237 - PR_GetCurrentThread(), exitcvar, exitcount));
1238 + DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1239 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1240 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1242 PR_ASSERT(exitcount >= arg);
1243 @@ -371,7 +371,7 @@ CondVarTestPUU(void *_arg)
1245 /* Join all the threads */
1246 for(index=0; index<(arg); index++) {
1247 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1248 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1249 PR_JoinThread(list[index].thread);
1250 if (list[index].internal) {
1251 PR_Lock(list[index].lock);
1252 @@ -393,7 +393,7 @@ CondVarTestPUU(void *_arg)
1254 CondVarTestPUK(void *_arg)
1256 - PRInt32 arg = (PRInt32)_arg;
1257 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1258 PRInt32 index, loops;
1261 @@ -475,7 +475,7 @@ CondVarTestPUK(void *_arg)
1263 CondVarTest(void *_arg)
1265 - PRInt32 arg = (PRInt32)_arg;
1266 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1267 PRInt32 index, loops;
1270 @@ -609,7 +609,7 @@ CondVarTest(void *_arg)
1272 CondVarTimeoutTest(void *_arg)
1274 - PRInt32 arg = (PRInt32)_arg;
1275 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1276 PRInt32 index, loops;
1279 @@ -721,7 +721,7 @@ CondVarTimeoutTest(void *_arg)
1281 CondVarMixedTest(void *_arg)
1283 - PRInt32 arg = (PRInt32)_arg;
1284 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1285 PRInt32 index, loops;
1288 @@ -811,7 +811,7 @@ CondVarMixedTest(void *_arg)
1289 for(index=0; index<(arg*4); index+=3) {
1291 PR_Lock(list[index].lock);
1292 - *list[index].tcount++;
1293 + list[index].tcount++;
1294 PR_NotifyCondVar(list[index].cvar);
1295 PR_Unlock(list[index].lock);
1297 @@ -883,7 +883,7 @@ static void Measure(void (*func)(void *)
1300 start = PR_IntervalNow();
1301 - (*func)((void *)arg);
1302 + (*func)((void *)(intptr_t)arg);
1303 stop = PR_IntervalNow();
1305 d = (double)PR_IntervalToMicroseconds(stop - start);
1306 @@ -948,7 +948,7 @@ This test is run with %d, %d, %d, and %d
1307 PR_SetConcurrency(2);
1309 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1310 - printf("\n%ld Thread tests\n", threads);
1311 + printf("\n%d Thread tests\n", (int)threads);
1312 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1313 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1314 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1315 --- pr/tests/foreign.c.orig 2019-10-15 14:21:38 UTC
1316 +++ pr/tests/foreign.c
1317 @@ -175,7 +175,7 @@ static void OneShot(void *arg)
1320 PRFileDesc *pair[2];
1321 - PRIntn test = (PRIntn)arg;
1322 + intptr_t test = (intptr_t)arg;
1324 for (test = 0; test < 12; ++test) {
1326 @@ -271,7 +271,7 @@ static void OneShot(void *arg)
1327 int main(int argc, char **argv)
1330 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1331 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1333 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1335 --- pr/tests/forktest.c.orig 2019-10-15 14:21:38 UTC
1336 +++ pr/tests/forktest.c
1337 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1340 PRFileDesc *sock = NULL;
1341 - PRInt32 tmp = (PRInt32)arg;
1342 + intptr_t tmp = (intptr_t)arg;
1345 * Make sure the PR_Accept call will block
1346 @@ -143,7 +143,7 @@ DoIO(void)
1349 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1350 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1351 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1352 PR_JOINABLE_THREAD, 0);
1353 if (clientThread == NULL) {
1354 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1355 @@ -151,6 +151,9 @@ DoIO(void)
1359 + printf("Wait one second before accept\n");
1361 + PR_Sleep(PR_SecondsToInterval(1));
1362 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1364 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1365 --- pr/tests/getai.c.orig 2019-10-15 14:21:38 UTC
1366 +++ pr/tests/getai.c
1367 @@ -13,8 +13,15 @@ int main(int argc, char **argv)
1373 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1378 + host = "www.FreeBSD.org";
1380 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1382 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1383 PR_GetError(), PR_GetOSError());
1384 --- pr/tests/instrumt.c.orig 2019-10-15 14:21:38 UTC
1385 +++ pr/tests/instrumt.c
1392 #include <prclist.h>
1395 #define COUNT_LIMIT (10 * ( 1024))
1397 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1402 @@ -78,10 +78,10 @@ static void Help(void)
1404 static void ListCounters(void)
1406 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1407 PR_DEFINE_COUNTER( qh );
1408 PR_DEFINE_COUNTER( rh );
1409 const char *qn, *rn, *dn;
1410 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1413 PR_INIT_COUNTER_HANDLE( qh, NULL );
1414 @@ -92,7 +92,7 @@ static void ListCounters(void)
1415 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1416 while ( rh != NULL )
1418 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1419 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1420 PR_GET_COUNTER(tCtr, rh);
1421 PR_LOG( lm, msgLevel,
1422 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1423 @@ -101,15 +101,15 @@ static void ListCounters(void)
1425 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1429 } /* end ListCounters() */
1431 static void ListTraces(void)
1433 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1434 PR_DEFINE_TRACE( qh );
1435 PR_DEFINE_TRACE( rh );
1436 const char *qn, *rn, *dn;
1437 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1439 PR_INIT_TRACE_HANDLE( qh, NULL );
1440 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1441 @@ -119,7 +119,7 @@ static void ListTraces(void)
1442 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1443 while ( rh != NULL )
1445 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1446 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1447 PR_LOG( lm, msgLevel,
1448 ( "QName: %s RName: %s Desc: %s",
1450 @@ -127,7 +127,7 @@ static void ListTraces(void)
1452 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1456 } /* end ListCounters() */
1459 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1461 static void TraceTest( void )
1466 PR_DEFINE_TRACE( th );
1468 --- pr/tests/io_timeout.c.orig 2019-10-15 14:21:38 UTC
1469 +++ pr/tests/io_timeout.c
1471 /* Used to get the command line option */
1472 #include "plgetopt.h"
1476 +#include <string.h>
1479 #define NUM_THREADS 1
1480 -#define BASE_PORT 8000
1481 +#define BASE_PORT 38011
1482 #define DEFAULT_ACCEPT_TIMEOUT 2
1484 typedef struct threadInfo {
1485 @@ -38,7 +40,7 @@ typedef struct threadInfo {
1488 PRIntn failed_already = 0;
1489 -PRIntn debug_mode = 0;
1490 +PRIntn debug_mode = 1;
1492 #define LOCAL_SCOPE_STRING "LOCAL scope"
1493 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
1494 @@ -54,7 +56,7 @@ thread_main(void *_info)
1495 PRFileDesc *clientSock;
1497 PRThreadScope tscope;
1499 + const char *scope_str;
1503 @@ -74,6 +76,7 @@ thread_main(void *_info)
1506 PR_NOT_REACHED("Invalid thread scope");
1510 printf("thread id %d, scope %s\n", info->id, scope_str);
1511 @@ -92,8 +95,12 @@ thread_main(void *_info)
1512 listenAddr.inet.ip = PR_htonl(PR_INADDR_ANY);
1513 rv = PR_Bind(listenSock, &listenAddr);
1514 if (rv == PR_FAILURE) {
1516 - printf("unable to bind\n");
1518 + printf("unable to bind to %d: %s\n",
1519 + BASE_PORT + info->id, strerror(PR_GetOSError()));
1520 + if (PR_GetOSError() == EADDRINUSE) {
1521 + printf("can not proceed with this test\n");
1526 @@ -117,8 +124,9 @@ thread_main(void *_info)
1527 if (clientSock == NULL) {
1528 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
1530 - printf("PR_Accept() timeout worked!\n");
1531 - printf("TEST PASSED! PR_Accept() returned error %d\n",
1532 + printf("PR_Accept() timeout worked!\n"
1533 + "TEST PASSED! PR_Accept() returned error "
1534 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
1535 PR_IO_TIMEOUT_ERROR);
1538 --- pr/tests/layer.c.orig 2019-10-15 14:21:38 UTC
1539 +++ pr/tests/layer.c
1540 @@ -45,7 +45,10 @@ static PRUint16 default_port = 12273;
1541 static PRFileDesc *PushLayer(PRFileDesc *stack)
1543 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
1544 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1545 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
1546 + PRStatus rv = /* we only need rv for PR_ASSERT() */
1548 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1549 if (verbosity > quiet) {
1550 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
1552 --- pr/tests/lazyinit.c.orig 2019-10-15 14:21:38 UTC
1553 +++ pr/tests/lazyinit.c
1554 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
1558 - PRCondVar *cv = NULL;
1559 PRThread *thread = NULL;
1560 PRIntervalTime interval = 0;
1561 PRFileDesc *file, *udp, *tcp, *pair[2];
1562 --- pr/tests/lltest.c.orig 2019-10-15 14:21:38 UTC
1563 +++ pr/tests/lltest.c
1564 @@ -651,6 +651,7 @@ TestConversion( void )
1569 static void ShiftCompileOnly()
1572 @@ -667,6 +668,7 @@ static void ShiftCompileOnly()
1573 LL_ISHL(ia, 49, 32);
1575 } /* ShiftCompileOnly */
1580 @@ -751,7 +753,6 @@ TestArithmetic( void )
1581 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
1582 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
1583 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
1584 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
1585 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
1586 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
1587 PRInt64 result, result2;
1588 --- pr/tests/mbcs.c.orig 2019-10-15 14:21:38 UTC
1590 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
1592 ** Traverse directory
1594 -static void TraverseDirectory( unsigned char *dir )
1595 +static void TraverseDirectory(const char *dir)
1598 PRDirEntry *dirEntry;
1605 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
1608 if ( PR_FILE_FILE == info.type ) {
1609 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
1610 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
1611 fd = PR_Open( file, PR_RDONLY, 0 );
1613 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
1614 - PR_GetError(), PR_GetOSError());
1615 + (long)PR_GetError(), (long)PR_GetOSError());
1617 rc = PR_Close( fd );
1618 if ( PR_FAILURE == rc ) {
1619 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
1620 - PR_GetError(), PR_GetOSError());
1621 + (long)PR_GetError(), (long)PR_GetOSError());
1623 } else if ( PR_FILE_DIRECTORY == info.type ) {
1624 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
1625 --- pr/tests/nbconn.c.orig 2019-10-15 14:21:38 UTC
1626 +++ pr/tests/nbconn.c
1627 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
1629 PRSocketOptionData optData;
1630 const char *hostname = NULL;
1631 - PRIntn default_case, n, bytes_read, bytes_sent;
1632 - PRInt32 failed_already = 0;
1633 + PRIntn default_case, n;
1637 @@ -169,7 +168,7 @@ int main(int argc, char **argv)
1640 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1641 - PR_GetError(), PR_GetOSError());
1642 + (long)PR_GetError(), (long)PR_GetOSError());
1646 @@ -240,7 +239,7 @@ connection_success_test()
1647 PRThread *thr = NULL;
1649 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
1650 - PRIntn default_case, n, bytes_read, bytes_sent;
1651 + PRIntn n, bytes_read, bytes_sent;
1652 PRIntn failed_already = 0;
1655 @@ -317,7 +316,7 @@ connection_success_test()
1659 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
1660 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
1662 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
1663 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
1664 @@ -396,7 +395,7 @@ connection_success_test()
1665 DPRINTF(("Data integrity verified\n"));
1667 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1668 - PR_GetError(), PR_GetOSError());
1669 + (long)PR_GetError(), (long)PR_GetOSError());
1673 @@ -505,7 +504,6 @@ connection_failure_test()
1676 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
1678 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
1681 --- pr/tests/nblayer.c.orig 2019-10-15 14:21:38 UTC
1682 +++ pr/tests/nblayer.c
1683 @@ -348,7 +348,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
1684 static PRInt16 PR_CALLBACK MyPoll(
1685 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
1687 - PRInt16 my_flags, new_flags;
1688 + PRInt16 my_flags = -1, new_flags;
1689 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
1690 if (0 != (PR_POLL_READ & in_flags))
1692 @@ -393,7 +393,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
1693 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
1696 - PRFileDesc *newfd, *layer = fd;
1697 + PRFileDesc *newfd;
1698 PRFileDesc *newstack;
1699 PRFilePrivate *newsecret;
1701 @@ -495,6 +495,8 @@ static PRInt32 PR_CALLBACK MyRecv(
1702 mine->rcvinprogress = 0;
1703 return mine->rcvreq; /* << -- that's it! */
1705 + PR_ASSERT(!"How did I get this mine->rcvstate?");
1710 @@ -563,6 +565,8 @@ static PRInt32 PR_CALLBACK MySend(
1711 mine->xmtinprogress = 0;
1712 return mine->xmtreq; /* <<-- That's the one! */
1714 + PR_ASSERT(!"How did I get this mine->xmtstate?");
1719 --- pr/tests/nonblock.c.orig 2019-10-15 14:21:38 UTC
1720 +++ pr/tests/nonblock.c
1722 static void PR_CALLBACK
1723 clientThreadFunc(void *arg)
1725 - PRUintn port = (PRUintn)arg;
1726 + intptr_t port = (intptr_t)arg;
1729 char buf[CHUNK_SIZE];
1730 @@ -145,7 +145,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1733 clientThread = PR_CreateThread(PR_USER_THREAD,
1734 - clientThreadFunc, (void *) listenPort,
1735 + clientThreadFunc, (void *) (intptr_t)listenPort,
1736 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1737 PR_UNJOINABLE_THREAD, 0);
1738 if (clientThread == NULL) {
1739 @@ -189,7 +189,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1740 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
1741 PL_PrintError("First Receive:\n");
1742 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
1743 - retVal, PR_GetError());
1744 + (long)retVal, (long)PR_GetError());
1747 printf("read: EWOULDBLOCK, good\n");
1748 @@ -199,7 +199,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1749 if (retVal != CHUNK_SIZE) {
1750 PL_PrintError("Second Receive:\n");
1751 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
1752 - retVal, PR_GetError());
1753 + (long)retVal, (long)PR_GetError());
1756 printf("read: %d bytes, good\n", retVal);
1757 --- pr/tests/obsints.c.orig 2019-10-15 14:21:38 UTC
1758 +++ pr/tests/obsints.c
1759 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
1760 #else /* NO_NSPR_10_SUPPORT */
1762 #include "prtypes.h" /* which includes protypes.h */
1763 +#if !defined(__GNUC__)
1767 int main(int argc, char **argv)
1769 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
1770 * Compilation fails if any of these integer types are not
1771 * defined by protypes.h.
1785 + uintn uin __unused;
1788 + uint8 ui8 __unused;
1789 + int16 i16 __unused;
1790 + uint16 ui16 __unused;
1791 + int32 i32 __unused;
1792 + uint32 ui32 __unused;
1793 + int64 i64 __unused;
1794 + uint64 ui64 __unused;
1798 --- pr/tests/parsetm.c.orig 2019-10-15 14:21:38 UTC
1799 +++ pr/tests/parsetm.c
1800 @@ -32,8 +32,8 @@ static void PrintExplodedTime(const PREx
1802 /* Print day of the week, month, day, hour, minute, and second */
1803 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
1804 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
1805 - et->tm_hour, et->tm_min, et->tm_sec);
1806 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
1807 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
1809 /* Print time zone */
1810 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
1811 @@ -50,7 +50,7 @@ static void PrintExplodedTime(const PREx
1812 hourOffset = totalOffset / 3600;
1813 minOffset = (totalOffset % 3600) / 60;
1815 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
1816 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
1820 --- pr/tests/peek.c.orig 2019-10-15 14:21:38 UTC
1822 @@ -137,7 +137,7 @@ static void ClientNB(void *arg)
1825 PRSocketOptionData opt;
1826 - PRUint16 port = (PRUint16) arg;
1827 + PRUint16 port = (intptr_t) arg;
1829 char buf[BUFFER_SIZE];
1831 @@ -301,7 +301,7 @@ RunTest(PRThreadScope scope, PRFileDesc
1834 client = PR_CreateThread(
1835 - PR_USER_THREAD, ClientNB, (void *) port,
1836 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
1837 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
1838 if (NULL == client) {
1839 fprintf(stderr, "PR_CreateThread failed\n");
1840 --- pr/tests/perf.c.orig 2019-10-15 14:21:38 UTC
1842 @@ -142,7 +142,7 @@ static void PR_CALLBACK CXReader(void *a
1844 for (i = 0; i < n; i++) {
1846 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
1847 + DPRINTF(("CXReader: thread = %p waiting\n",
1848 PR_GetCurrentThread()));
1849 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1851 @@ -155,7 +155,7 @@ static void PR_CALLBACK CXReader(void *a
1854 PR_ExitMonitor(mon2);
1855 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1856 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
1859 static void PR_CALLBACK CXWriter(void *arg)
1860 @@ -166,7 +166,7 @@ static void PR_CALLBACK CXWriter(void *a
1862 for (i = 0; i < n; i++) {
1864 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
1865 + DPRINTF(("CXWriter: thread = %p waiting\n",
1866 PR_GetCurrentThread()));
1867 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1869 @@ -179,7 +179,7 @@ static void PR_CALLBACK CXWriter(void *a
1872 PR_ExitMonitor(mon2);
1873 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1874 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
1877 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
1878 @@ -199,7 +199,7 @@ static void ContextSwitch(PRThreadScope
1880 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1882 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1883 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1884 (scope1 == PR_GLOBAL_THREAD ?
1885 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1887 @@ -213,7 +213,7 @@ static void ContextSwitch(PRThreadScope
1889 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1891 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1892 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1893 (scope2 == PR_GLOBAL_THREAD ?
1894 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1896 @@ -255,10 +255,10 @@ static void PR_CALLBACK SemaThread(void
1899 for (i = 0; i < n; i++) {
1900 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
1901 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
1902 PR_GetCurrentThread(), sem[0]));
1904 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
1905 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
1906 PR_GetCurrentThread(), sem[1]));
1909 @@ -267,7 +267,7 @@ static void PR_CALLBACK SemaThread(void
1912 PR_ExitMonitor(mon2);
1913 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1914 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
1917 static PRSemaphore *sem_set1[2];
1918 @@ -295,7 +295,7 @@ static void SemaContextSwitch(PRThreadSc
1920 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1922 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1923 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1924 (scope1 == PR_GLOBAL_THREAD ?
1925 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1927 @@ -310,7 +310,7 @@ static void SemaContextSwitch(PRThreadSc
1929 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1931 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1932 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1933 (scope2 == PR_GLOBAL_THREAD ?
1934 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1936 --- pr/tests/pipepong.c.orig 2019-10-15 14:21:38 UTC
1937 +++ pr/tests/pipepong.c
1938 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
1939 nBytes = fread(buf, 1, 5, stdin);
1940 fprintf(stderr, "pong process: received \"%s\"\n", buf);
1942 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
1943 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
1947 --- pr/tests/poll_nm.c.orig 2019-10-15 14:21:38 UTC
1948 +++ pr/tests/poll_nm.c
1949 @@ -47,7 +47,7 @@ PRIntn debug_mode;
1950 static void PR_CALLBACK
1951 clientThreadFunc(void *arg)
1953 - PRUintn port = (PRUintn) arg;
1954 + PRUintn port = (intptr_t) arg;
1958 @@ -200,7 +200,7 @@ int main(int argc, char **argv)
1961 clientThread = PR_CreateThread(PR_USER_THREAD,
1962 - clientThreadFunc, (void *) listenPort1,
1963 + clientThreadFunc, (void *)(intptr_t)listenPort1,
1964 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1965 PR_UNJOINABLE_THREAD, 0);
1966 if (clientThread == NULL) {
1967 @@ -210,7 +210,7 @@ int main(int argc, char **argv)
1970 clientThread = PR_CreateThread(PR_USER_THREAD,
1971 - clientThreadFunc, (void *) listenPort2,
1972 + clientThreadFunc, (void *)(intptr_t)listenPort2,
1973 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1974 PR_UNJOINABLE_THREAD, 0);
1975 if (clientThread == NULL) {
1976 --- pr/tests/prfz.c.orig 2019-10-15 14:21:38 UTC
1982 -#include <sys/types.h>
1983 +#include <stdint.h>
1987 --- pr/tests/provider.c.orig 2019-10-15 14:21:38 UTC
1988 +++ pr/tests/provider.c
1989 @@ -1067,7 +1067,7 @@ int main(int argc, char **argv)
1993 - CSClient_t *client;
1994 + CSClient_t *client = NULL;
1995 PRStatus rv, joinStatus;
1996 CSServer_t *server = NULL;
1998 --- pr/tests/prpoll.c.orig 2019-10-15 14:21:38 UTC
1999 +++ pr/tests/prpoll.c
2000 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
2002 clientThreadFunc(void *arg)
2004 - PRUint16 port = (PRUint16) arg;
2005 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2009 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
2012 struct sockaddr_in saddr;
2014 + socklen_t saddr_len;
2015 PRUint16 listenPort3;
2016 PRFileDesc *socket_poll_fd;
2018 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
2021 clientThread = PR_CreateThread(PR_USER_THREAD,
2022 - clientThreadFunc, (void *) listenPort1,
2023 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2024 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2025 PR_UNJOINABLE_THREAD, 0);
2026 if (clientThread == NULL) {
2027 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2030 clientThread = PR_CreateThread(PR_USER_THREAD,
2031 - clientThreadFunc, (void *) listenPort2,
2032 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2033 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2034 PR_UNJOINABLE_THREAD, 0);
2035 if (clientThread == NULL) {
2036 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2039 clientThread = PR_CreateThread(PR_USER_THREAD,
2040 - clientThreadFunc, (void *) listenPort3,
2041 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
2042 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2043 PR_UNJOINABLE_THREAD, 0);
2044 if (clientThread == NULL) {
2045 --- pr/tests/randseed.c.orig 2019-10-15 14:21:38 UTC
2046 +++ pr/tests/randseed.c
2047 @@ -48,7 +48,6 @@ static void Help( void )
2048 static void PrintRand( void *buf, PRIntn size )
2053 printf("%4.4d--\n", size );
2055 --- pr/tests/ranfile.c.orig 2019-10-15 14:21:38 UTC
2056 +++ pr/tests/ranfile.c
2057 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2058 PRStatus rv = PR_SUCCESS;
2059 Hammer_t *cd = (Hammer_t*)arg;
2061 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2062 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2065 printf("Starting work on %s\n", filename);
2066 @@ -405,8 +405,8 @@ int main(int argc, char **argv)
2067 durationTot += duration;
2069 else if (debug_mode) printf(
2070 - "%s: test failed %s after %ld seconds\n",
2071 - programName, where[hammer[poll].problem], duration);
2072 + "%s: test failed %s after %d seconds\n",
2073 + programName, where[hammer[poll].problem], (int)duration);
2077 @@ -414,7 +414,7 @@ int main(int argc, char **argv)
2080 if (debug_mode) printf(
2081 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2082 + "%s: [%d [%d] %d] writes/sec average\n",
2083 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2085 PR_DestroyCondVar(cv);
2086 --- pr/tests/runtests.sh.orig 2019-10-15 14:21:38 UTC
2087 +++ pr/tests/runtests.sh
2088 @@ -56,9 +56,6 @@ fi
2089 # Tests not run (but should)
2092 -#forktest (failed on IRIX)
2093 -#nbconn - fails on some platforms
2094 -#poll_er - fails on some platforms? limited use?
2095 #prpoll - the bad-FD test needs to be moved to a different test
2096 #sleep - specific to OS/2
2098 @@ -91,6 +88,7 @@ exit
2106 @@ -98,7 +96,6 @@ getproto
2114 @@ -119,6 +116,7 @@ logger
2122 @@ -135,6 +133,7 @@ perf
2130 @@ -207,7 +206,7 @@ OBJDIR=`basename $PWD`
2131 printf "\nNSPR Test Results - $OBJDIR\n\n"
2132 printf "BEGIN\t\t\t`date`\n"
2133 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2134 -printf "Test\t\t\tResult\n\n"
2135 +printf " Test\t\t\tResult\n\n"
2136 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2139 @@ -225,10 +224,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2144 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2146 - ./$prog >> ${LOGFILE} 2>&1 &
2148 + ./$prog >> $prog.output 2>&1 &
2151 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2152 @@ -243,28 +240,11 @@ else
2153 printf "\t\t\tPassed\n";
2155 printf "\t\t\tFAILED\n";
2156 + sed "s,^, $prog: ," < $prog.output
2159 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2163 printf "END\t\t\t`date`\n"
2182 --- pr/tests/sel_spd.c.orig 2019-10-15 14:21:38 UTC
2183 +++ pr/tests/sel_spd.c
2188 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2189 +# include <unistd.h> /* getopt(3) */
2192 #define PORT_BASE 19000
2194 typedef struct timer_slot_t {
2195 - unsigned long d_connect;
2196 - unsigned long d_cl_data;
2197 - unsigned long d_sv_data;
2198 - unsigned long d_close;
2199 - unsigned long d_total;
2200 - unsigned long requests;
2201 + unsigned int d_connect;
2202 + unsigned int d_cl_data;
2203 + unsigned int d_sv_data;
2204 + unsigned int d_close;
2205 + unsigned int d_total;
2206 + unsigned int requests;
2209 -static long _iterations = 5;
2210 -static long _client_data = 8192;
2211 +static int _iterations = 5;
2212 +static int _client_data = 8192;
2214 -static long _server_data = (128*1024);
2215 -static long _threads_max = 10, _threads = 10;
2216 +static int _server_data = (128*1024);
2217 +static int _threads_max = 10, _threads = 10;
2219 static int verbose=0;
2220 static PRMonitor *exit_cv;
2221 @@ -88,7 +91,7 @@ _server_thread(void *arg_id)
2222 void _client_thread(void *);
2224 int *id = (int *)arg_id;
2226 + PRFileDesc *sock = NULL;
2227 PRSocketOptionData sockopt;
2229 PRFileDesc * newsock;
2230 @@ -467,12 +470,12 @@ void
2231 tally_results(int verbose)
2234 - unsigned long tot_connect = 0;
2235 - unsigned long tot_cl_data = 0;
2236 - unsigned long tot_sv_data = 0;
2237 - unsigned long tot_close = 0;
2238 - unsigned long tot_all = 0;
2239 - unsigned long tot_requests = 0;
2240 + unsigned int tot_connect = 0;
2241 + unsigned int tot_cl_data = 0;
2242 + unsigned int tot_sv_data = 0;
2243 + unsigned int tot_close = 0;
2244 + unsigned int tot_all = 0;
2245 + unsigned int tot_requests = 0;
2247 fprintf(stdout, "Server results:\n\n");
2248 for (index=0; index<_threads_max*2; index+=2) {
2249 --- pr/tests/selct_nm.c.orig 2019-10-15 14:21:38 UTC
2250 +++ pr/tests/selct_nm.c
2251 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2253 clientThreadFunc(void *arg)
2255 - PRUintn port = (PRUintn) arg;
2256 + PRUintn port = (PRUintn)(uintptr_t)arg;
2260 @@ -169,7 +169,7 @@ int main(int argc, char **argv)
2263 clientThread = PR_CreateThread(PR_USER_THREAD,
2264 - clientThreadFunc, (void *) listenPort1,
2265 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2266 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2267 PR_UNJOINABLE_THREAD, 0);
2268 if (clientThread == NULL) {
2269 @@ -179,7 +179,7 @@ int main(int argc, char **argv)
2272 clientThread = PR_CreateThread(PR_USER_THREAD,
2273 - clientThreadFunc, (void *) listenPort2,
2274 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2275 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2276 PR_UNJOINABLE_THREAD, 0);
2277 if (clientThread == NULL) {
2278 --- pr/tests/select2.c.orig 2019-10-15 14:21:38 UTC
2279 +++ pr/tests/select2.c
2280 @@ -53,6 +53,7 @@ PRInt32 count;
2282 ***********************************************************************/
2284 +static int exitcode = 2;
2286 static void Test_Result (int result)
2288 @@ -60,9 +61,13 @@ static void Test_Result (int result)
2292 + if (exitcode == 2) {
2301 printf ("NOSTATUS\n");
2302 @@ -382,4 +387,5 @@ int main(int argc, char **argv)
2308 --- pr/tests/semaerr.c.orig 2019-10-15 14:21:38 UTC
2309 +++ pr/tests/semaerr.c
2310 @@ -61,7 +61,7 @@ int main(int argc, char **argv)
2313 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2314 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2315 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2316 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2319 --- pr/tests/semaerr1.c.orig 2019-10-15 14:21:38 UTC
2320 +++ pr/tests/semaerr1.c
2321 @@ -72,7 +72,7 @@ int main(int argc, char **argv)
2324 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2325 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2326 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2330 --- pr/tests/sendzlf.c.orig 2019-10-15 14:21:38 UTC
2331 +++ pr/tests/sendzlf.c
2332 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2336 - PRUint16 port = (PRUint16) arg;
2337 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2341 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2344 clientThread = PR_CreateThread(PR_USER_THREAD,
2345 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2346 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2347 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2348 if (NULL == clientThread) {
2349 fprintf(stderr, "PR_CreateThread failed\n");
2350 --- pr/tests/server_test.c.orig 2019-10-15 14:21:38 UTC
2351 +++ pr/tests/server_test.c
2352 @@ -61,7 +61,7 @@ PRCondVar *ServerStateCV;
2354 #define DPRINTF printf
2357 +#define DPRINTF(...)
2361 @@ -582,6 +582,7 @@ static void do_workUU(void)
2366 static void do_workUK(void)
2368 ServerScope = PR_LOCAL_THREAD;
2369 @@ -602,6 +603,7 @@ static void do_workKK(void)
2370 ClientScope = PR_GLOBAL_THREAD;
2376 static void Measure(void (*func)(void), const char *msg)
2377 --- pr/tests/servr_kk.c.orig 2019-10-15 14:21:38 UTC
2378 +++ pr/tests/servr_kk.c
2379 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2381 #define DPRINTF printf
2384 +#define DPRINTF(...)
2387 PRIntn failed_already=0;
2388 @@ -539,6 +539,7 @@ void do_work()
2389 PR_JoinThread(ServerThread);
2393 static void do_workUU(void)
2395 ServerScope = PR_LOCAL_THREAD;
2396 @@ -559,6 +560,7 @@ static void do_workKU(void)
2397 ClientScope = PR_LOCAL_THREAD;
2402 static void do_workKK(void)
2404 --- pr/tests/servr_ku.c.orig 2019-10-15 14:21:38 UTC
2405 +++ pr/tests/servr_ku.c
2406 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2408 #define DPRINTF printf
2411 +#define DPRINTF(...)
2414 PRIntn failed_already=0;
2415 --- pr/tests/servr_uk.c.orig 2019-10-15 14:21:38 UTC
2416 +++ pr/tests/servr_uk.c
2417 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2419 #define DPRINTF printf
2422 +#define DPRINTF(...)
2425 PRIntn failed_already=0;
2426 --- pr/tests/servr_uu.c.orig 2019-10-15 14:21:38 UTC
2427 +++ pr/tests/servr_uu.c
2428 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2430 #define DPRINTF printf
2433 +#define DPRINTF(...)
2436 PRIntn failed_already=0;
2437 --- pr/tests/short_thread.c.orig 2019-10-15 14:21:38 UTC
2438 +++ pr/tests/short_thread.c
2439 @@ -45,7 +45,7 @@ int main (int argc, char **argv)
2440 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2443 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2444 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2445 PR_GetError(), PR_GetOSError());
2448 --- pr/tests/socket.c.orig 2019-10-15 14:21:38 UTC
2449 +++ pr/tests/socket.c
2450 @@ -173,7 +173,9 @@ readn(PRFileDesc *sockfd, char *buf, int
2457 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2459 if (test_cancelio) {
2460 @@ -181,12 +183,14 @@ readn(PRFileDesc *sockfd, char *buf, int
2463 for (rem=len; rem; offset += bytes, rem -= bytes) {
2464 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2465 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2466 PR_GetCurrentThread(), rem));
2470 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2472 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2473 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2474 PR_GetCurrentThread(), bytes));
2477 @@ -218,11 +222,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2480 for (rem=len; rem; offset += bytes, rem -= bytes) {
2481 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2482 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2483 PR_GetCurrentThread(), rem));
2484 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2485 PR_INTERVAL_NO_TIMEOUT);
2486 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2487 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2488 PR_GetCurrentThread(), bytes));
2491 @@ -272,7 +276,7 @@ Serve_Client(void *arg)
2492 if (PR_Shutdown(sockfd, PR_SHUTDOWN_RCV) < 0) {
2493 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2495 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2496 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2497 (*((int *) in_buf->data))));
2498 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2499 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2500 @@ -414,7 +418,7 @@ TCP_Server(void *arg)
2504 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2505 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2506 netaddr.inet.ip, netaddr.inet.port));
2507 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2508 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2509 @@ -466,7 +470,7 @@ TCP_Server(void *arg)
2513 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2514 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2518 @@ -482,7 +486,7 @@ exit:
2519 --(*sp->exit_counter);
2520 PR_Notify(sp->exit_mon);
2521 PR_ExitMonitor(sp->exit_mon);
2522 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2523 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2527 @@ -541,7 +545,7 @@ UDP_Server(void *arg)
2531 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2532 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2533 netaddr.inet.ip, netaddr.inet.port));
2535 * We can't use the IP address returned by PR_GetSockName in
2536 @@ -579,13 +583,13 @@ UDP_Server(void *arg)
2538 memset(&netaddr, 0, sizeof(netaddr));
2539 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
2540 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2541 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2542 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
2545 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
2546 PR_INTERVAL_NO_TIMEOUT);
2547 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2548 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2549 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
2552 @@ -608,7 +612,7 @@ UDP_Server(void *arg)
2553 --(*sp->exit_counter);
2554 PR_Notify(sp->exit_mon);
2555 PR_ExitMonitor(sp->exit_mon);
2556 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
2557 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
2561 @@ -652,7 +656,7 @@ TCP_Client(void *arg)
2563 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
2564 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
2565 - PR_GetError(), PR_GetOSError());
2566 + (long)PR_GetError(), (long)PR_GetOSError());
2570 @@ -660,7 +664,7 @@ TCP_Client(void *arg)
2572 * fill in random data
2574 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
2575 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
2579 @@ -674,7 +678,7 @@ TCP_Client(void *arg)
2583 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2584 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2585 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2586 if (readn(sockfd, in_buf->data, bytes) < bytes) {
2587 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
2588 @@ -711,7 +715,7 @@ TCP_Client(void *arg)
2589 --(*cp->exit_counter);
2590 PR_Notify(cp->exit_mon);
2591 PR_ExitMonitor(cp->exit_mon);
2592 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2593 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
2597 @@ -775,7 +779,7 @@ UDP_Client(void *arg)
2601 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2602 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2603 netaddr.inet.ip, netaddr.inet.port));
2605 netaddr = cp->server_addr;
2606 @@ -792,9 +796,9 @@ UDP_Client(void *arg)
2608 * fill in random data
2610 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
2611 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
2612 PR_GetCurrentThread(), out_buf->data, bytes));
2613 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
2614 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
2618 @@ -807,7 +811,7 @@ UDP_Client(void *arg)
2622 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2623 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2624 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2625 if (cp->udp_connect)
2626 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
2627 @@ -818,7 +822,7 @@ UDP_Client(void *arg)
2631 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
2632 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
2633 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
2635 * verify the data read
2636 @@ -843,7 +847,7 @@ UDP_Client(void *arg)
2637 PR_Notify(cp->exit_mon);
2638 PR_ExitMonitor(cp->exit_mon);
2640 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2641 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
2645 @@ -910,7 +914,7 @@ TCP_Socket_Client_Server_Test(void)
2649 - DPRINTF(("Created TCP server = 0x%lx\n", t));
2650 + DPRINTF(("Created TCP server = %p\n", t));
2654 @@ -944,7 +948,7 @@ TCP_Socket_Client_Server_Test(void)
2658 - DPRINTF(("Created TCP client = 0x%lx\n", t));
2659 + DPRINTF(("Created TCP client = %p\n", t));
2662 /* Wait for server and client threads to exit */
2663 @@ -954,9 +958,9 @@ TCP_Socket_Client_Server_Test(void)
2665 PR_ExitMonitor(mon2);
2666 printf("%30s","TCP_Socket_Client_Server_Test:");
2667 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
2668 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
2669 num_tcp_clients, num_tcp_connections_per_client);
2670 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
2671 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
2672 num_tcp_mesgs_per_connection, tcp_mesg_size);
2675 @@ -1081,8 +1085,8 @@ UDP_Socket_Client_Server_Test(void)
2677 PR_ExitMonitor(mon2);
2678 printf("%30s","UDP_Socket_Client_Server_Test: ");
2679 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
2680 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
2681 + printf(" 1 Server %2d Clients\n", num_udp_clients);
2682 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
2683 num_udp_datagrams_per_client, udp_datagram_size);
2686 @@ -1438,7 +1442,7 @@ TransmitFile_Client(void *arg)
2687 --(*cp->exit_counter);
2688 PR_Notify(cp->exit_mon);
2689 PR_ExitMonitor(cp->exit_mon);
2690 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
2691 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
2695 @@ -1481,7 +1485,7 @@ Serve_TransmitFile_Client(void *arg)
2696 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
2698 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
2699 - PR_GetError(), PR_GetOSError());
2700 + (long)PR_GetError(), (long)PR_GetOSError());
2703 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
2704 @@ -1489,7 +1493,7 @@ Serve_TransmitFile_Client(void *arg)
2705 if (bytes != LARGE_FILE_SIZE) {
2707 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
2708 - PR_GetError(), PR_GetOSError());
2709 + (long)PR_GetError(), (long)PR_GetOSError());
2713 @@ -1517,7 +1521,7 @@ Serve_TransmitFile_Client(void *arg)
2716 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2717 - PR_GetError(), PR_GetOSError());
2718 + (long)PR_GetError(), (long)PR_GetOSError());
2722 @@ -1541,7 +1545,7 @@ Serve_TransmitFile_Client(void *arg)
2725 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2726 - PR_GetError(), PR_GetOSError());
2727 + (long)PR_GetError(), (long)PR_GetOSError());
2731 @@ -1563,7 +1567,7 @@ Serve_TransmitFile_Client(void *arg)
2734 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2735 - PR_GetError(), PR_GetOSError());
2736 + (long)PR_GetError(), (long)PR_GetOSError());
2740 @@ -1585,7 +1589,7 @@ Serve_TransmitFile_Client(void *arg)
2743 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2744 - PR_GetError(), PR_GetOSError());
2745 + (long)PR_GetError(), (long)PR_GetOSError());
2749 @@ -1607,7 +1611,7 @@ Serve_TransmitFile_Client(void *arg)
2752 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2753 - PR_GetError(), PR_GetOSError());
2754 + (long)PR_GetError(), (long)PR_GetOSError());
2758 @@ -1629,7 +1633,7 @@ Serve_TransmitFile_Client(void *arg)
2761 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2762 - PR_GetError(), PR_GetOSError());
2763 + (long)PR_GetError(), (long)PR_GetOSError());
2767 @@ -1651,7 +1655,7 @@ Serve_TransmitFile_Client(void *arg)
2770 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2771 - PR_GetError(), PR_GetOSError());
2772 + (long)PR_GetError(), (long)PR_GetOSError());
2776 @@ -1675,7 +1679,7 @@ Serve_TransmitFile_Client(void *arg)
2779 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2780 - PR_GetError(), PR_GetOSError());
2781 + (long)PR_GetError(), (long)PR_GetOSError());
2785 @@ -1752,7 +1756,7 @@ TransmitFile_Server(void *arg)
2789 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2790 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2791 netaddr.inet.ip, netaddr.inet.port));
2792 tcp_server_addr.inet.family = netaddr.inet.family;
2793 tcp_server_addr.inet.port = netaddr.inet.port;
2794 @@ -1818,7 +1822,7 @@ TransmitFile_Server(void *arg)
2798 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
2799 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
2803 @@ -1846,7 +1850,7 @@ exit:
2804 --(*sp->exit_counter);
2805 PR_Notify(sp->exit_mon);
2806 PR_ExitMonitor(sp->exit_mon);
2807 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2808 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
2812 @@ -1986,7 +1990,7 @@ Socket_Misc_Test(void)
2814 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
2816 - PR_GetError(), PR_GetOSError());
2817 + (long)PR_GetError(), (long)PR_GetOSError());
2821 @@ -2076,7 +2080,7 @@ Socket_Misc_Test(void)
2825 - DPRINTF(("Created TCP server = 0x%x\n", t));
2826 + DPRINTF(("Created TCP server = %p\n", t));
2830 @@ -2113,7 +2117,7 @@ Socket_Misc_Test(void)
2834 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
2835 + DPRINTF(("Created TransmitFile client = %p\n", t));
2838 /* Wait for server and client threads to exit */
2839 @@ -2144,7 +2148,7 @@ done:
2841 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
2842 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
2843 - TEST_DIR, PR_GetError(), PR_GetOSError());
2844 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
2848 --- pr/tests/sprintf.c.orig 2019-10-15 14:21:38 UTC
2849 +++ pr/tests/sprintf.c
2850 @@ -133,7 +133,7 @@ static void test_l(char *pattern, char *
2851 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
2853 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
2854 - pattern, l, s, buf, sbuf);
2855 + pattern, (long)l, s, buf, sbuf);
2856 PR_smprintf_free(s);
2859 --- pr/tests/stack.c.orig 2019-10-15 14:21:38 UTC
2860 +++ pr/tests/stack.c
2861 @@ -53,7 +53,7 @@ PRFileDesc *errhandle;
2863 int main(int argc, char **argv)
2865 - PRInt32 rv, cnt, sum;
2868 PRStack *list1, *list2;
2870 @@ -211,7 +211,7 @@ int main(int argc, char **argv)
2871 static void stackop(void *thread_arg)
2873 PRInt32 val, cnt, index, loops;
2874 - DataRecord *Items, *Item;
2875 + DataRecord *Items;
2876 PRStack *list1, *list2;
2878 stack_data *arg = (stack_data *) thread_arg;
2879 --- pr/tests/suspend.c.orig 2019-10-15 14:21:38 UTC
2880 +++ pr/tests/suspend.c
2881 @@ -21,14 +21,14 @@ void PR_CALLBACK
2882 Level_2_Thread(void *arg)
2884 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
2885 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2886 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
2891 Level_1_Thread(void *arg)
2893 - PRUint32 tmp = (PRUint32)arg;
2894 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
2895 PRThreadScope scope = (PRThreadScope) tmp;
2898 @@ -43,7 +43,7 @@ Level_1_Thread(void *arg)
2900 printf("Could not create thread!\n");
2902 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
2903 + printf("Level_1_Thread[%p] created %15s thread %p\n",
2904 PR_GetCurrentThread(),
2905 (scope == PR_GLOBAL_THREAD) ?
2906 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2907 @@ -54,7 +54,7 @@ Level_1_Thread(void *arg)
2910 PR_ExitMonitor(mon);
2911 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2912 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
2915 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
2916 @@ -63,14 +63,15 @@ static PRStatus PR_CALLBACK print_thread
2920 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
2921 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
2922 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
2923 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
2924 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
2926 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
2927 - registers[0],registers[1],registers[2],registers[3]);
2928 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
2929 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
2930 + (unsigned long)registers[0], (unsigned long)registers[1],
2931 + (unsigned long)registers[2], (unsigned long)registers[3]);
2932 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
2936 @@ -98,7 +99,7 @@ static void Level_0_Thread(PRThreadScope
2937 printf("Could not create thread!\n");
2940 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
2941 + printf("Level_0_Thread[%p] created %15s thread %p\n",
2942 PR_GetCurrentThread(),
2943 (scope1 == PR_GLOBAL_THREAD) ?
2944 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2945 @@ -110,9 +111,10 @@ static void Level_0_Thread(PRThreadScope
2946 PR_EnumerateThreads(print_thread, NULL);
2947 registers = PR_GetGCRegisters(me, 1, (int *)&words);
2949 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
2950 - registers[0],registers[1],registers[2],registers[3]);
2951 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
2952 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
2953 + (unsigned long)registers[0], (unsigned long)registers[1],
2954 + (unsigned long)registers[2], (unsigned long)registers[3]);
2955 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
2958 /* Wait for all threads to exit */
2959 --- pr/tests/switch.c.orig 2019-10-15 14:21:38 UTC
2960 +++ pr/tests/switch.c
2961 @@ -83,7 +83,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
2963 PRBool help = PR_FALSE;
2964 PRUintn concurrency = 1;
2965 - Shared *shared, *link;
2966 + Shared *shared = NULL, *link;
2967 PRIntervalTime timein, timeout;
2968 PRThreadScope thread_scope = PR_LOCAL_THREAD;
2969 PRUintn thread_count, inner_count, loop_count, average;
2970 --- pr/tests/testfile.c.orig 2019-10-15 14:21:38 UTC
2971 +++ pr/tests/testfile.c
2972 @@ -33,6 +33,9 @@ static int _debug_on = 0;
2976 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2977 +# include <unistd.h> /* getopt(3) */
2980 #define DPRINTF(arg) if (_debug_on) printf arg
2982 @@ -86,7 +89,7 @@ static PRInt32 PR_CALLBACK DirTest(void
2983 PRInt32 dirtest_failed = 0;
2985 PRThread* create_new_thread(PRThreadType type,
2986 - void (*start)(void *arg),
2987 + void *(*start)(void *arg),
2989 PRThreadPriority priority,
2990 PRThreadScope scope,
2991 @@ -151,7 +154,7 @@ PRThread* create_new_thread(PRThreadType
2992 return((PRThread *) thandle);
2995 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
2996 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
2999 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3000 @@ -312,8 +315,8 @@ static PRInt32 Misc_File_Tests(char *pat
3002 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3004 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3005 - file_info1.creationTime);
3006 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3007 + (long long)file_info1.creationTime);
3011 @@ -338,8 +341,8 @@ static PRInt32 Misc_File_Tests(char *pat
3013 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3015 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3016 - file_info1.modifyTime);
3017 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3018 + (long long)file_info1.modifyTime);
3022 @@ -465,7 +468,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3023 memset(fparamp->buf, i, len);
3025 t = create_new_thread(PR_USER_THREAD,
3026 - File_Write, (void *)fparamp,
3027 + (void *(*)(void *))File_Write, (void *)fparamp,
3030 PR_UNJOINABLE_THREAD,
3031 @@ -500,7 +503,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3034 t = create_new_thread(PR_USER_THREAD,
3035 - File_Read, (void *)fparamp,
3036 + (void *(*)(void *))File_Read, (void *)fparamp,
3039 PR_UNJOINABLE_THREAD,
3040 @@ -569,7 +572,7 @@ static PRInt32 RunDirTest(void)
3043 t = create_new_thread(PR_USER_THREAD,
3045 + (void *(*)(void *))DirTest, &thrarg,
3048 PR_UNJOINABLE_THREAD,
3049 @@ -893,8 +896,6 @@ int main(int argc, char **argv)
3051 #if defined(XP_UNIX) || defined(XP_OS2)
3053 - extern char *optarg;
3054 - extern int optind;
3056 #if defined(XP_UNIX) || defined(XP_OS2)
3057 while ((opt = getopt(argc, argv, "d")) != EOF) {
3058 --- pr/tests/threads.c.orig 2019-10-15 14:21:38 UTC
3059 +++ pr/tests/threads.c
3060 @@ -27,7 +27,7 @@ void
3062 DumbThread(void *arg)
3064 - PRInt32 tmp = (PRInt32)arg;
3065 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3066 PRThreadScope scope = (PRThreadScope)tmp;
3069 @@ -173,10 +173,10 @@ int main(int argc, char **argv)
3074 -** Tests lots of thread creations. \n\
3075 -** Create %ld native threads %ld times. \n\
3076 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3077 + printf("** Tests lots of thread creations.\n"
3078 + "** Create %d native threads %d times.\n"
3079 + "** Create %d user threads %d times.\n", iterations, count,
3080 + iterations, count);
3083 for (index=0; index<iterations; index++) {
3084 --- pr/tests/thrpool_client.c.orig 2019-10-15 14:21:38 UTC
3085 +++ pr/tests/thrpool_client.c
3086 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3087 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3089 for (rem=len; rem; offset += bytes, rem -= bytes) {
3090 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3091 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3092 PR_GetCurrentThread(), rem));
3093 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3095 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3096 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3097 PR_GetCurrentThread(), bytes));
3100 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3103 for (rem=len; rem; offset += bytes, rem -= bytes) {
3104 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3105 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3106 PR_GetCurrentThread(), rem));
3107 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3108 PR_INTERVAL_NO_TIMEOUT);
3109 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3110 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3111 PR_GetCurrentThread(), bytes));
3114 @@ -165,7 +165,7 @@ TCP_Client(void *arg)
3116 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3117 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3118 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3119 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3120 PR_GetError(), PR_GetOSError());
3123 @@ -174,7 +174,7 @@ TCP_Client(void *arg)
3125 * fill in random data
3127 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3128 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3132 @@ -282,7 +282,7 @@ TCP_Socket_Client_Server_Test(void)
3133 PR_EnterMonitor(mon2);
3135 PR_ExitMonitor(mon2);
3136 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3137 + DPRINTF(("Created TCP client = %p\n", thr));
3139 /* Wait for client jobs to exit */
3140 PR_EnterMonitor(mon2);
3141 @@ -292,9 +292,9 @@ TCP_Socket_Client_Server_Test(void)
3143 PR_ExitMonitor(mon2);
3144 printf("%30s","TCP_Socket_Client_Server_Test:");
3145 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3146 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3147 num_tcp_clients, num_tcp_connections_per_client);
3148 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3149 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3150 num_tcp_mesgs_per_connection, tcp_mesg_size);
3153 --- pr/tests/thrpool_server.c.orig 2019-10-15 14:21:38 UTC
3154 +++ pr/tests/thrpool_server.c
3155 @@ -330,7 +330,7 @@ TCP_Server(void *arg)
3159 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3160 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3161 netaddr.inet.ip, netaddr.inet.port));
3163 sp = PR_NEW(Server_Param);
3164 @@ -342,7 +342,7 @@ TCP_Server(void *arg)
3165 sp->iod.socket = sockfd;
3166 sp->iod.timeout = PR_SecondsToInterval(60);
3167 sp->datalen = tcp_mesg_size;
3168 - sp->exit_mon = sc_mon;
3169 + sp->exit_mon = NULL;
3170 sp->job_counterp = &job_counter;
3171 sp->conn_counter = 0;
3173 @@ -465,7 +465,7 @@ TCP_Server_Accept(void *arg)
3176 PR_ASSERT(NULL != jobp);
3177 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3178 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3181 * single-threaded update; no lock needed
3182 @@ -482,7 +482,7 @@ TCP_Server_Accept(void *arg)
3183 print_stats, sp, PR_FALSE);
3185 PR_ASSERT(NULL != jobp);
3186 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3187 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3190 PR_EnterMonitor(sp->exit_mon);
3191 @@ -499,9 +499,9 @@ exit:
3193 PR_DestroyMonitor(sp->exit_mon);
3194 printf("%30s","TCP_Socket_Client_Server_Test:");
3195 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3196 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3197 num_tcp_clients, num_tcp_connections_per_client);
3198 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3199 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3200 num_tcp_mesgs_per_connection, tcp_mesg_size);
3202 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3203 --- pr/tests/thruput.c.orig 2019-10-15 14:21:38 UTC
3204 +++ pr/tests/thruput.c
3205 @@ -69,7 +69,7 @@ static void PR_CALLBACK Clientel(void *a
3209 - PRInt32 bytes, sampled;
3210 + PRInt32 bytes, sampled = -1;
3211 PRIntervalTime now, interval;
3212 PRBool do_display = PR_FALSE;
3213 Shared *shared = (Shared*)arg;
3214 @@ -183,7 +183,7 @@ static void Client(const char *server_na
3216 static void PR_CALLBACK Servette(void *arg)
3218 - PRInt32 bytes, sampled;
3219 + PRInt32 bytes, sampled = -1;
3220 PRIntervalTime now, interval;
3221 PRBool do_display = PR_FALSE;
3222 PRFileDesc *client = (PRFileDesc*)arg;
3223 @@ -395,6 +395,7 @@ int main(int argc, char **argv)
3231 --- pr/tests/timemac.c.orig 2019-10-15 14:21:38 UTC
3232 +++ pr/tests/timemac.c
3233 @@ -25,7 +25,7 @@ static void printExplodedTime(const PREx
3236 /* Print day of the week, month, day, hour, minute, and second */
3237 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3238 + printf( "%s %s %d %02d:%02d:%02d ",
3239 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3240 et->tm_hour, et->tm_min, et->tm_sec);
3242 @@ -41,7 +41,7 @@ static void printExplodedTime(const PREx
3244 hourOffset = totalOffset / 3600;
3245 minOffset = (totalOffset % 3600) / 60;
3246 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3247 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3251 @@ -98,7 +98,7 @@ int main(int argc, char** argv)
3252 printf("Current local time is ");
3253 printExplodedTime(&et);
3255 - printf("GMT offset is %ld, DST offset is %ld\n",
3256 + printf("GMT offset is %d, DST offset is %d\n",
3257 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3258 t2 = PR_ImplodeTime(&et);
3259 if (LL_NE(t1, t2)) {
3260 --- pr/tests/timetest.c.orig 2019-10-15 14:21:38 UTC
3261 +++ pr/tests/timetest.c
3262 @@ -37,7 +37,7 @@ static void PrintExplodedTime(const PREx
3265 /* Print day of the week, month, day, hour, minute, and second */
3266 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3267 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3268 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3269 et->tm_hour, et->tm_min, et->tm_sec);
3271 @@ -56,7 +56,7 @@ static void PrintExplodedTime(const PREx
3272 hourOffset = totalOffset / 3600;
3273 minOffset = (totalOffset % 3600) / 60;
3275 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3276 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3280 @@ -262,7 +262,7 @@ int main(int argc, char** argv)
3284 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3285 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3286 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3287 t2 = PR_ImplodeTime(&et);
3288 if (LL_NE(t1, t2)) {
3289 --- pr/tests/y2k.c.orig 2019-10-15 14:21:38 UTC
3291 @@ -44,7 +44,7 @@ static void PrintExplodedTime(const PREx
3294 /* Print day of the week, month, day, hour, minute, and second */
3295 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3296 + printf("%s %s %2d %02d:%02d:%02d ",
3297 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3298 et->tm_hour, et->tm_min, et->tm_sec);
3300 @@ -63,7 +63,7 @@ static void PrintExplodedTime(const PREx
3302 hourOffset = totalOffset / 3600;
3303 minOffset = (totalOffset % 3600) / 60;
3304 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3305 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3307 #ifdef PRINT_DETAILS
3308 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3309 --- pr/tests/y2ktmo.c.orig 2019-10-15 14:21:38 UTC
3310 +++ pr/tests/y2ktmo.c
3311 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3313 static void SleepThread(void *arg)
3315 - PRIntervalTime timeout = (PRIntervalTime) arg;
3316 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3317 PRIntervalTime elapsed;
3318 #if defined(XP_UNIX) || defined(WIN32)
3319 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3320 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3322 static void AcceptThread(void *arg)
3324 - PRIntervalTime timeout = (PRIntervalTime) arg;
3325 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3326 PRIntervalTime elapsed;
3327 #if defined(XP_UNIX) || defined(WIN32)
3328 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3329 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3331 static void PollThread(void *arg)
3333 - PRIntervalTime timeout = (PRIntervalTime) arg;
3334 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3335 PRIntervalTime elapsed;
3336 #if defined(XP_UNIX) || defined(WIN32)
3337 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3338 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3340 static void WaitCondVarThread(void *arg)
3342 - PRIntervalTime timeout = (PRIntervalTime) arg;
3343 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3344 PRIntervalTime elapsed;
3345 #if defined(XP_UNIX) || defined(WIN32)
3346 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3347 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3349 static void WaitMonitorThread(void *arg)
3351 - PRIntervalTime timeout = (PRIntervalTime) arg;
3352 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3353 PRIntervalTime elapsed;
3354 #if defined(XP_UNIX) || defined(WIN32)
3355 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3356 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3358 static void WaitCMonitorThread(void *arg)
3360 - PRIntervalTime timeout = (PRIntervalTime) arg;
3361 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3362 PRIntervalTime elapsed;
3363 #if defined(XP_UNIX) || defined(WIN32)
3364 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3365 @@ -532,7 +532,7 @@ int main(int argc, char **argv)
3366 for (i = 0; i < num_thread_scopes; i++) {
3367 for (j = 0; j < num_thread_funcs; j++) {
3368 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3369 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3370 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3371 threadScopes[i], PR_JOINABLE_THREAD, 0);
3372 if (threads[idx] == NULL) {
3373 fprintf(stderr, "PR_CreateThread failed\n");
3374 --- pr/tests/zerolen.c.orig 2019-10-15 14:21:38 UTC
3375 +++ pr/tests/zerolen.c
3376 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3380 - PRUint16 port = (PRUint16) arg;
3381 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3385 @@ -124,7 +124,7 @@ int main()
3386 * First test PR_Writev.
3388 clientThread = PR_CreateThread(PR_USER_THREAD,
3389 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3390 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3391 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3392 if (NULL == clientThread) {
3393 fprintf(stderr, "PR_CreateThread failed\n");
3394 @@ -165,7 +165,7 @@ int main()
3395 * Then test PR_Write.
3397 clientThread = PR_CreateThread(PR_USER_THREAD,
3398 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3399 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3400 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3401 if (NULL == clientThread) {
3402 fprintf(stderr, "PR_CreateThread failed\n");
3403 @@ -204,7 +204,7 @@ int main()
3404 * Finally test PR_Send.
3406 clientThread = PR_CreateThread(PR_USER_THREAD,
3407 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3408 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3409 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3410 if (NULL == clientThread) {
3411 fprintf(stderr, "PR_CreateThread failed\n");
3414 [FILE:2460:patches/patch-warnings]
3415 --- pr/include/prcountr.h.orig 2019-10-15 14:21:38 UTC
3416 +++ pr/include/prcountr.h
3417 @@ -394,7 +394,7 @@ PR_SubtractFromCounter(
3418 #define PR_GET_COUNTER(counter,handle)\
3419 (counter) = PR_GetCounter((handle))
3421 -#define PR_GET_COUNTER(counter,handle) 0
3422 +#define PR_GET_COUNTER(counter,handle)
3426 @@ -468,7 +468,7 @@ PR_SetCounter(
3427 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3428 (next) = PR_FindNextCounterQname((handle))
3430 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3431 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3434 NSPR_API(PRCounterHandle)
3435 --- pr/src/misc/pralarm.c.orig 2019-10-15 14:21:38 UTC
3436 +++ pr/src/misc/pralarm.c
3437 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier(void *arg)
3439 while (why != abort)
3441 - PRIntervalTime pause;
3442 + PRIntervalTime pause = 0;
3444 PR_Lock(alarm->lock);
3446 --- pr/src/misc/prdtoa.c.orig 2019-10-15 14:21:38 UTC
3447 +++ pr/src/misc/prdtoa.c
3448 @@ -2896,9 +2896,9 @@ double dd; int mode, ndigits, *decpt, *sign; char **rv
3449 to hold the suppressed trailing zeros.
3452 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3453 - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3454 - spec_case, try_quick;
3455 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3456 + j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3457 + spec_case, try_quick;
3459 #ifndef Sudden_Underflow
3461 --- pr/src/pthreads/ptio.c.orig 2019-10-15 14:21:38 UTC
3462 +++ pr/src/pthreads/ptio.c
3463 @@ -5262,6 +5262,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
3465 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
3467 + start = 0; /* Not needed, but shuts down a warning */
3469 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
3470 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
3471 --- pr/src/pthreads/ptsynch.c.orig 2019-10-15 14:21:38 UTC
3472 +++ pr/src/pthreads/ptsynch.c
3473 @@ -25,7 +25,7 @@ static pthread_condattr_t _pt_cvar_attr;
3474 extern PTDebug pt_debug; /* this is shared between several modules */
3475 #endif /* defined(DEBUG) */
3477 -#if defined(FREEBSD)
3478 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
3480 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
3481 * Newer versions return EBUSY. We still need to support both.
3484 [FILE:6203:dragonfly/patch-nsprpub_pr_include_md___dragonfly.cfg]
3485 --- /dev/null 2019-10-22 17:25:39 UTC
3486 +++ pr/include/md/_dragonfly.cfg
3488 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3489 +/* This Source Code Form is subject to the terms of the Mozilla Public
3490 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3491 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3493 +#ifndef nspr_cpucfg___
3494 +#define nspr_cpucfg___
3500 +#define PR_AF_INET6 28 /* same as AF_INET6 */
3502 +#ifndef HAVE_LONG_LONG
3503 +#define HAVE_LONG_LONG
3506 +#if defined(__i386__)
3508 +#define IS_LITTLE_ENDIAN 1
3509 +#undef IS_BIG_ENDIAN
3510 +#undef HAVE_ALIGNED_DOUBLES
3511 +#undef HAVE_ALIGNED_LONGLONGS
3513 +#define PR_BYTES_PER_BYTE 1
3514 +#define PR_BYTES_PER_SHORT 2
3515 +#define PR_BYTES_PER_INT 4
3516 +#define PR_BYTES_PER_INT64 8
3517 +#define PR_BYTES_PER_LONG 4
3518 +#define PR_BYTES_PER_FLOAT 4
3519 +#define PR_BYTES_PER_DOUBLE 8
3520 +#define PR_BYTES_PER_WORD 4
3521 +#define PR_BYTES_PER_DWORD 8
3522 +#define PR_BYTES_PER_WORD_LOG2 2
3523 +#define PR_BYTES_PER_DWORD_LOG2 3
3525 +#define PR_BITS_PER_BYTE 8
3526 +#define PR_BITS_PER_SHORT 16
3527 +#define PR_BITS_PER_INT 32
3528 +#define PR_BITS_PER_INT64 64
3529 +#define PR_BITS_PER_LONG 32
3530 +#define PR_BITS_PER_FLOAT 32
3531 +#define PR_BITS_PER_DOUBLE 64
3532 +#define PR_BITS_PER_WORD 32
3534 +#define PR_BITS_PER_BYTE_LOG2 3
3535 +#define PR_BITS_PER_SHORT_LOG2 4
3536 +#define PR_BITS_PER_INT_LOG2 5
3537 +#define PR_BITS_PER_INT64_LOG2 6
3538 +#define PR_BITS_PER_LONG_LOG2 5
3539 +#define PR_BITS_PER_FLOAT_LOG2 5
3540 +#define PR_BITS_PER_DOUBLE_LOG2 6
3541 +#define PR_BITS_PER_WORD_LOG2 5
3543 +#define PR_ALIGN_OF_SHORT 2
3544 +#define PR_ALIGN_OF_INT 4
3545 +#define PR_ALIGN_OF_LONG 4
3546 +#define PR_ALIGN_OF_INT64 4
3547 +#define PR_ALIGN_OF_FLOAT 4
3548 +#define PR_ALIGN_OF_DOUBLE 4
3549 +#define PR_ALIGN_OF_POINTER 4
3551 +#elif defined(__alpha__)
3553 +#define IS_LITTLE_ENDIAN 1
3554 +#undef IS_BIG_ENDIAN
3555 +#define HAVE_ALIGNED_DOUBLES
3556 +#define HAVE_ALIGNED_LONGLONGS
3559 +#define PR_BYTES_PER_BYTE 1
3560 +#define PR_BYTES_PER_SHORT 2
3561 +#define PR_BYTES_PER_INT 4
3562 +#define PR_BYTES_PER_INT64 8
3563 +#define PR_BYTES_PER_LONG 8
3564 +#define PR_BYTES_PER_FLOAT 4
3565 +#define PR_BYTES_PER_DOUBLE 8
3566 +#define PR_BYTES_PER_WORD 8
3567 +#define PR_BYTES_PER_DWORD 8
3568 +#define PR_BYTES_PER_WORD_LOG2 3
3569 +#define PR_BYTES_PER_DWORD_LOG2 3
3571 +#define PR_BITS_PER_BYTE 8
3572 +#define PR_BITS_PER_SHORT 16
3573 +#define PR_BITS_PER_INT 32
3574 +#define PR_BITS_PER_INT64 64
3575 +#define PR_BITS_PER_LONG 64
3576 +#define PR_BITS_PER_FLOAT 32
3577 +#define PR_BITS_PER_DOUBLE 64
3578 +#define PR_BITS_PER_WORD 64
3580 +#define PR_BITS_PER_BYTE_LOG2 3
3581 +#define PR_BITS_PER_SHORT_LOG2 4
3582 +#define PR_BITS_PER_INT_LOG2 5
3583 +#define PR_BITS_PER_INT64_LOG2 6
3584 +#define PR_BITS_PER_LONG_LOG2 6
3585 +#define PR_BITS_PER_FLOAT_LOG2 5
3586 +#define PR_BITS_PER_DOUBLE_LOG2 6
3587 +#define PR_BITS_PER_WORD_LOG2 6
3589 +#define PR_ALIGN_OF_SHORT 2
3590 +#define PR_ALIGN_OF_INT 4
3591 +#define PR_ALIGN_OF_LONG 8
3592 +#define PR_ALIGN_OF_INT64 8
3593 +#define PR_ALIGN_OF_FLOAT 4
3594 +#define PR_ALIGN_OF_DOUBLE 8
3595 +#define PR_ALIGN_OF_POINTER 8
3597 +#elif defined(__amd64__)
3599 +#define IS_LITTLE_ENDIAN 1
3600 +#undef IS_BIG_ENDIAN
3601 +#define HAVE_ALIGNED_DOUBLES
3602 +#define HAVE_ALIGNED_LONGLONGS
3605 +#define PR_BYTES_PER_BYTE 1
3606 +#define PR_BYTES_PER_SHORT 2
3607 +#define PR_BYTES_PER_INT 4
3608 +#define PR_BYTES_PER_INT64 8
3609 +#define PR_BYTES_PER_LONG 8
3610 +#define PR_BYTES_PER_FLOAT 4
3611 +#define PR_BYTES_PER_DOUBLE 8
3612 +#define PR_BYTES_PER_WORD 8
3613 +#define PR_BYTES_PER_DWORD 8
3614 +#define PR_BYTES_PER_WORD_LOG2 3
3615 +#define PR_BYTES_PER_DWORD_LOG2 3
3617 +#define PR_BITS_PER_BYTE 8
3618 +#define PR_BITS_PER_SHORT 16
3619 +#define PR_BITS_PER_INT 32
3620 +#define PR_BITS_PER_INT64 64
3621 +#define PR_BITS_PER_LONG 64
3622 +#define PR_BITS_PER_FLOAT 32
3623 +#define PR_BITS_PER_DOUBLE 64
3624 +#define PR_BITS_PER_WORD 64
3626 +#define PR_BITS_PER_BYTE_LOG2 3
3627 +#define PR_BITS_PER_SHORT_LOG2 4
3628 +#define PR_BITS_PER_INT_LOG2 5
3629 +#define PR_BITS_PER_INT64_LOG2 6
3630 +#define PR_BITS_PER_LONG_LOG2 6
3631 +#define PR_BITS_PER_FLOAT_LOG2 5
3632 +#define PR_BITS_PER_DOUBLE_LOG2 6
3633 +#define PR_BITS_PER_WORD_LOG2 6
3635 +#define PR_ALIGN_OF_SHORT 2
3636 +#define PR_ALIGN_OF_INT 4
3637 +#define PR_ALIGN_OF_LONG 8
3638 +#define PR_ALIGN_OF_INT64 8
3639 +#define PR_ALIGN_OF_FLOAT 4
3640 +#define PR_ALIGN_OF_DOUBLE 8
3641 +#define PR_ALIGN_OF_POINTER 8
3642 +#define PR_ALIGN_OF_WORD 8
3646 +#error "Unknown CPU architecture"
3650 +#ifndef NO_NSPR_10_SUPPORT
3652 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
3653 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
3654 +#define BYTES_PER_INT PR_BYTES_PER_INT
3655 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
3656 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
3657 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
3658 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
3659 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
3660 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
3662 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
3663 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
3664 +#define BITS_PER_INT PR_BITS_PER_INT
3665 +#define BITS_PER_INT64 PR_BITS_PER_INT64
3666 +#define BITS_PER_LONG PR_BITS_PER_LONG
3667 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
3668 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
3669 +#define BITS_PER_WORD PR_BITS_PER_WORD
3671 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
3672 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
3673 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
3674 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
3675 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
3676 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
3677 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
3678 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
3680 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
3681 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
3682 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
3683 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
3684 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
3685 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
3686 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
3687 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
3689 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
3690 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
3691 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
3693 +#endif /* NO_NSPR_10_SUPPORT */
3695 +#endif /* nspr_cpucfg___ */
3698 [FILE:6201:dragonfly/patch-nsprpub_pr_include_md___dragonfly.h]
3699 --- /dev/null 2019-10-22 17:25:39 UTC
3700 +++ pr/include/md/_dragonfly.h
3702 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3703 +/* This Source Code Form is subject to the terms of the Mozilla Public
3704 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3705 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3707 +#ifndef nspr_dragonfly_defs_h___
3708 +#define nspr_dragonfly_defs_h___
3710 +#include "prthread.h"
3713 +#if __FreeBSD__ >= 2
3714 +#include <osreldate.h> /* for __FreeBSD_version */
3716 +#include <sys/syscall.h>
3719 +#define PR_LINKER_ARCH "dragonfly"
3720 +#define _PR_SI_SYSNAME "DRAGONFLY"
3721 +#if defined(__i386__)
3722 +#define _PR_SI_ARCHITECTURE "x86"
3723 +#elif defined(__amd64__)
3724 +#define _PR_SI_ARCHITECTURE "amd64"
3726 +#error "Unknown CPU architecture"
3729 +#define PR_DLL_SUFFIX ".so"
3731 +#define _PR_VMBASE 0x30000000
3732 +#define _PR_STACK_VMBASE 0x50000000
3733 +#define _MD_DEFAULT_STACK_SIZE 65536L
3734 +#define _MD_MMAP_FLAGS MAP_PRIVATE
3736 +#undef HAVE_STACK_GROWING_UP
3739 +#define _PR_HAVE_SOCKADDR_LEN
3740 +#define _PR_STAT_HAS_ST_ATIMESPEC
3741 +#define _PR_HAVE_LARGE_OFF_T
3743 +#define _PR_HAVE_GETPROTO_R
3744 +#define _PR_HAVE_5_ARG_GETPROTO_R
3745 +#define _PR_HAVE_GETHOST_R
3746 +#define _PR_HAVE_GETHOST_R_INT
3748 +#define _PR_POLL_AVAILABLE
3750 +#define _PR_HAVE_SYSV_SEMAPHORES
3751 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3754 +#define _PR_HAVE_INET_NTOP
3755 +#define _PR_HAVE_GETHOSTBYNAME2
3756 +#define _PR_HAVE_GETADDRINFO
3757 +#define _PR_INET6_PROBE
3758 +#define _PR_IPV6_V6ONLY_PROBE
3762 +#ifndef _PR_PTHREADS
3763 +#include <setjmp.h>
3765 +#define PR_CONTEXT_TYPE sigjmp_buf
3767 +#define CONTEXT(_th) ((_th)->md.context)
3769 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
3770 +#define PR_NUM_GCREGS _JBLEN
3773 +** Initialize a thread context to run "_main()" when started
3775 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
3777 + *status = PR_TRUE; \
3778 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
3781 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
3784 +#define _MD_SWITCH_CONTEXT(_thread) \
3785 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
3786 + (_thread)->md.errcode = errno; \
3791 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
3793 +#define _MD_RESTORE_CONTEXT(_thread) \
3795 + errno = (_thread)->md.errcode; \
3796 + _MD_SET_CURRENT_THREAD(_thread); \
3797 + siglongjmp(CONTEXT(_thread), 1); \
3800 +/* Machine-dependent (MD) data structures */
3803 + PR_CONTEXT_TYPE context;
3808 +struct _MDThreadStack {
3816 +struct _MDSemaphore {
3824 +struct _MDSegment {
3829 + * md-specific cpu structure field
3831 +#define _PR_MD_MAX_OSFD FD_SETSIZE
3833 +struct _MDCPU_Unix {
3835 + PRUint32 ioq_timeout;
3836 + PRInt32 ioq_max_osfd;
3837 + PRInt32 ioq_osfd_cnt;
3838 +#ifndef _PR_USE_POLL
3839 + fd_set fd_read_set, fd_write_set, fd_exception_set;
3840 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
3841 + fd_exception_cnt[_PR_MD_MAX_OSFD];
3843 + struct pollfd *ioq_pollfds;
3844 + int ioq_pollfds_size;
3845 +#endif /* _PR_USE_POLL */
3848 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
3849 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
3850 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
3851 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
3852 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
3853 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
3854 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
3855 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
3856 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
3857 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
3858 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
3859 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
3860 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
3862 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
3865 + struct _MDCPU_Unix md_unix;
3868 +#define _MD_INIT_LOCKS()
3869 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
3870 +#define _MD_FREE_LOCK(lock)
3871 +#define _MD_LOCK(lock)
3872 +#define _MD_UNLOCK(lock)
3873 +#define _MD_INIT_IO()
3874 +#define _MD_IOQ_LOCK()
3875 +#define _MD_IOQ_UNLOCK()
3877 +extern PRStatus _MD_InitializeThread(PRThread *thread);
3879 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
3880 +#define _MD_INIT_THREAD _MD_InitializeThread
3881 +#define _MD_EXIT_THREAD(thread)
3882 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
3883 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
3884 +#define _MD_CLEAN_THREAD(_thread)
3886 +extern PRStatus _MD_CREATE_THREAD(
3888 + void (*start) (void *),
3889 + PRThreadPriority priority,
3890 + PRThreadScope scope,
3891 + PRThreadState state,
3892 + PRUint32 stackSize);
3893 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
3894 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
3895 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
3896 +extern void _MD_YIELD(void);
3898 +#endif /* ! _PR_PTHREADS */
3900 +extern void _MD_EarlyInit(void);
3902 +#define _MD_EARLY_INIT _MD_EarlyInit
3903 +#define _MD_FINAL_INIT _PR_UnixInit
3904 +#define _MD_INTERVAL_USE_GTOD
3907 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
3908 + * unwrapped version.
3910 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
3912 +#if defined(_PR_POLL_AVAILABLE)
3914 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
3917 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
3918 + want to be including that.. */
3919 +#ifndef INADDR_LOOPBACK
3920 +#define INADDR_LOOPBACK (u_long)0x7F000001
3924 +#include <sys/uio.h>
3926 +#endif /* nspr_freebsd_defs_h___ */
3929 [FILE:875:dragonfly/patch-nsprpub_pr_include_md__freebsd.h]
3930 --- pr/include/md/_freebsd.h.orig 2019-10-22 17:25:38 UTC
3931 +++ pr/include/md/_freebsd.h
3933 #define _PR_HAVE_GETHOST_R
3934 #define _PR_HAVE_GETHOST_R_INT
3936 -#if __FreeBSD_version >= 400008
3937 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
3939 * libc_r before this version of FreeBSD doesn't have poll().
3940 * Although libc has poll(), it is not thread-safe so we can't
3942 #define _PR_POLL_AVAILABLE
3945 -#if __FreeBSD_version >= 300000
3946 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
3947 #define _PR_POLL_AVAILABLE
3948 #define _PR_USE_POLL
3951 #define _PR_HAVE_SYSV_SEMAPHORES
3952 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3954 -#if __FreeBSD_version >= 400014
3955 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
3957 #define _PR_HAVE_INET_NTOP
3958 #define _PR_HAVE_GETHOSTBYNAME2
3961 [FILE:279:dragonfly/patch-nsprpub_pr_include_md_prosdep.h]
3962 --- pr/include/md/prosdep.h.orig 2019-10-15 14:21:38 UTC
3963 +++ pr/include/md/prosdep.h
3964 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
3965 #elif defined(OPENBSD)
3966 #include "md/_openbsd.h"
3968 +#elif defined(__DragonFly__)
3969 +#include "md/_dragonfly.h"
3972 #include "md/_bsdi.h"
3976 [FILE:403:dragonfly/patch-nsprpub_pr_src_md_unix_uxrng.c]
3977 --- pr/src/md/unix/uxrng.c.orig 2019-10-15 14:21:38 UTC
3978 +++ pr/src/md/unix/uxrng.c
3979 @@ -64,6 +64,7 @@ GetHighResClock(void *buf, size_t maxbyt
3981 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
3982 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
3983 + || defined(__DragonFly__) \
3984 || defined(__GNU__))
3985 #include <sys/types.h>
3986 #include <sys/stat.h>
3989 [FILE:690:dragonfly/patch-nsprpub_pr_src_misc_prnetdb.c]
3990 --- pr/src/misc/prnetdb.c.orig 2019-10-22 17:25:38 UTC
3991 +++ pr/src/misc/prnetdb.c
3992 @@ -73,6 +73,11 @@ PRLock *_pr_dnsLock = NULL;
3993 #define _PR_HAVE_GETPROTO_R_INT
3996 +#if defined(DRAGONFLY)
3997 +#define _PR_HAVE_GETPROTO_R
3998 +#define _PR_HAVE_5_ARG_GETPROTO_R
4001 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
4002 #if (defined(__GLIBC__) && __GLIBC__ >= 2)
4003 #define _PR_HAVE_GETPROTO_R
4004 @@ -299,7 +304,7 @@ _pr_QueryNetIfs(void)
4007 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
4008 - || defined(NETBSD) || defined(OPENBSD)
4009 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
4012 * Use the BSD getifaddrs function.
4015 [FILE:439:dragonfly/patch-nsprpub_pr_src_pthreads_ptsynch.c]
4016 --- pr/src/pthreads/ptsynch.c.orig 2019-10-22 17:25:38 UTC
4017 +++ pr/src/pthreads/ptsynch.c
4018 @@ -952,6 +952,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
4020 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
4021 || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
4022 + || defined(__DragonFly__) \
4023 || defined(OPENBSD) || defined(BSDI) \
4025 /* union semun is defined by including <sys/sem.h> */
4028 [FILE:1235:dragonfly/patch-pr_include_md___pth.h]
4029 --- pr/include/md/_pth.h.orig 2019-10-15 14:21:38 UTC
4030 +++ pr/include/md/_pth.h
4033 #if defined(AIX) || defined(SOLARIS) \
4034 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4035 + || defined(__DragonFly__) \
4036 || defined(HPUX) || defined(FREEBSD) \
4037 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
4038 || defined(NTO) || defined(DARWIN) \
4040 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
4041 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
4042 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4043 + || defined(__DragonFly__) \
4045 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
4046 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
4047 @@ -175,6 +177,7 @@ extern int (*_PT_aix_yield_fcn)();
4048 #define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)()
4049 #elif defined(HPUX) || defined(SOLARIS) \
4050 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4051 + || defined(__DragonFly__) \
4052 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4053 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4054 || defined(UNIXWARE) || defined(RISCOS)