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.29/src
13 DISTFILE[1]= nspr-4.29.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
22 DISTNAME= nspr-4.29/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 22286bdb8059d74632cc7c2865c139e63953ecfb33bf4362ab58827e86e92582 1078192 nspr-4.29.tar.gz
49 [FILE:1124:manifests/plist.single]
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 2020-08-20 23:04:43 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 2020-08-20 23:04:43 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:489:patches/patch-config_nspr.pc.in]
183 --- config/nspr.pc.in.orig 2020-08-20 23:04:43 UTC
184 +++ config/nspr.pc.in
185 @@ -6,5 +6,5 @@ includedir=@includedir@
187 Description: The Netscape Portable Runtime
188 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
189 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
190 -Cflags: -I@includedir@
191 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
192 +Cflags: -I${includedir}
195 [FILE:2589:patches/patch-configure]
196 --- configure.orig 2020-08-20 23:04:43 UTC
198 @@ -6560,6 +6560,21 @@ tools are selected during the Xcode/Deve
203 + if test -z "$USE_NSPR_THREADS"; then
206 + $as_echo "#define XP_UNIX 1" >>confdefs.h
207 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
208 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
209 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
210 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
212 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
213 + MDCPUCFG_H=_dragonfly.cfg
214 + PR_MD_CSRCS=freebsd.c
218 if test -z "$USE_NSPR_THREADS"; then
220 @@ -7229,7 +7244,6 @@ $as_echo "$as_me: WARNING: Unknown versi
222 MDCPUCFG_H=_solaris.cfg
223 PR_MD_CSRCS=solaris.c
225 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
226 RESOLVE_LINK_SYMBOLS=1
227 case "${OS_RELEASE}" in
228 @@ -7237,7 +7251,6 @@ $as_echo "$as_me: WARNING: Unknown versi
231 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
235 if test -n "$GNU_CC"; then
236 @@ -7933,7 +7946,7 @@ $as_echo_n "checking whether ${CC-cc} ac
237 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
238 ac_cv_have_dash_pthread=yes
241 + freebsd*|dragonfly*)
242 # Freebsd doesn't use -pthread for compiles, it uses them for linking
245 @@ -7971,7 +7984,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
250 + *-freebsd*|*-dragonfly*)
251 $as_echo "#define _REENTRANT 1" >>confdefs.h
253 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
254 @@ -8061,7 +8074,7 @@ case "$target" in
259 +*-freebsd*|*-dragonfly*)
260 if test -n "$USE_NSPR_THREADS"; then
261 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
263 @@ -8114,17 +8127,7 @@ _ACEOF
265 $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
267 - if test "$OS_TEST" = "i86pc"; then
268 - if test -n "$USE_64"; then
269 - PR_MD_ASFILES=os_SunOS_x86_64.s
271 - PR_MD_ASFILES=os_SunOS_x86.s
274 - if test -n "$USE_64"; then
275 - PR_MD_ASFILES=os_SunOS_sparcv9.s
278 + PR_MD_ASFILES=os_SunOS_x86_64.s
284 [FILE:29818:patches/patch-libtests]
285 --- lib/tests/arena.c.orig 2020-08-20 23:04:43 UTC
286 +++ lib/tests/arena.c
287 @@ -36,6 +36,7 @@ void DumpAll( void )
293 ** Test Arena allocation.
295 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
298 } /* end ArenaGrow() */
303 --- lib/tests/base64t.c.orig 2020-08-20 23:04:43 UTC
304 +++ lib/tests/base64t.c
305 @@ -2362,7 +2362,6 @@ PRBool test_008(void)
306 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
308 PRUint32 plen = PL_strlen(array[i].plaintext);
309 - PRUint32 clen = ((plen + 2)/3)*4;
311 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
313 @@ -3122,9 +3121,6 @@ PRBool test_024(void)
315 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
317 - PRUint32 plen = PL_strlen(array[i].plaintext);
318 - PRUint32 clen = ((plen + 2)/3)*4;
320 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
322 if( (char *)0 == rv )
323 @@ -3258,8 +3254,6 @@ PRBool test_027(void)
325 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
327 - PRUint32 clen = PL_strlen(array[i].cyphertext);
329 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
331 if( (char *)0 == rv )
332 --- lib/tests/string.c.orig 2020-08-20 23:04:43 UTC
333 +++ lib/tests/string.c
334 @@ -127,7 +127,7 @@ PRBool test_003(void)
335 rv = PL_strcpy(array[i].dest, array[i].str);
336 if( array[i].rv != rv )
338 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
339 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
340 array[i].str ? array[i].str : "(null)", rv);
343 @@ -240,8 +240,8 @@ PRBool test_004(void)
344 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
345 if( array[i].rv != rv )
347 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
348 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
349 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
350 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
354 @@ -367,8 +367,8 @@ PRBool test_005(void)
355 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
356 if( array[i].rv != rv )
358 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
359 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
360 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
361 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
365 @@ -421,7 +421,7 @@ PRBool test_006(void)
367 if( (char *)0 == rv )
369 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
370 + printf("FAIL %d: %p -> 0\n", i, array[i]);
374 @@ -507,8 +507,8 @@ PRBool test_007(void)
376 if( (char *)0 == rv )
378 - printf("FAIL %d: %s,%lu -> 0\n", i,
379 - array[i].str ? array[i].str : "(null)", array[i].len);
380 + printf("FAIL %d: %s,%u -> 0\n", i,
381 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
385 @@ -700,10 +700,10 @@ PRBool test_009(void)
387 if( (char *)0 != rv )
389 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
390 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
391 array[i].first ? array[i].first : "(null)",
392 array[i].second ? array[i].second : "(null)",
393 - array[i].length, rv);
394 + (unsigned)array[i].length, rv);
398 @@ -711,10 +711,10 @@ PRBool test_009(void)
400 if( (char *)0 == rv )
402 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
403 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
404 array[i].first ? array[i].first : "(null)",
405 array[i].second ? array[i].second : "(null)",
406 - array[i].length, array[i].result);
407 + (unsigned)array[i].length, array[i].result);
411 @@ -726,10 +726,10 @@ PRBool test_009(void)
415 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
416 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
417 array[i].first ? array[i].first : "(null)",
418 array[i].second ? array[i].second : "(null)",
419 - array[i].length, rv, array[i].result);
420 + (unsigned)array[i].length, rv, array[i].result);
424 @@ -741,10 +741,10 @@ PRBool test_009(void)
428 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
429 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
430 array[i].first ? array[i].first : "(null)",
431 array[i].second ? array[i].second : "(null)",
433 + (unsigned)array[i].length);
437 @@ -752,10 +752,10 @@ PRBool test_009(void)
441 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
442 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
443 array[i].first ? array[i].first : "(null)",
444 array[i].second ? array[i].second : "(null)",
446 + (unsigned)array[i].length);
450 @@ -832,10 +832,10 @@ PRBool test_010(void)
452 if( (char *)0 != rv )
454 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
455 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
456 array[i].first ? array[i].first : "(null)",
457 array[i].second ? array[i].second : "(null)",
458 - array[i].length, rv);
459 + (unsigned)array[i].length, rv);
463 @@ -843,10 +843,10 @@ PRBool test_010(void)
465 if( (char *)0 == rv )
467 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
468 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
469 array[i].first ? array[i].first : "(null)",
470 array[i].second ? array[i].second : "(null)",
471 - array[i].length, array[i].result);
472 + (unsigned)array[i].length, array[i].result);
476 @@ -858,10 +858,10 @@ PRBool test_010(void)
480 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
481 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
482 array[i].first ? array[i].first : "(null)",
483 array[i].second ? array[i].second : "(null)",
484 - array[i].length, rv, array[i].result);
485 + (unsigned)array[i].length, rv, array[i].result);
489 @@ -1104,10 +1104,10 @@ PRBool test_012(void)
493 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
494 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
495 array[i].one ? array[i].one : "(null)",
496 array[i].two ? array[i].two : "(null)",
497 - array[i].max, rv, array[i].sign);
498 + (int)array[i].max, rv, array[i].sign);
502 @@ -1338,10 +1338,10 @@ PRBool test_014(void)
506 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
507 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
508 array[i].one ? array[i].one : "(null)",
509 array[i].two ? array[i].two : "(null)",
510 - array[i].max, rv, array[i].sign);
511 + (int)array[i].max, rv, array[i].sign);
515 @@ -1411,15 +1411,15 @@ PRBool test_015(void)
517 if( (char *)0 == rv )
519 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
520 - array[i].chr, array[i].off);
521 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
522 + array[i].chr, (unsigned)array[i].off);
526 if( &array[i].str[ array[i].off ] != rv )
528 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
529 - array[i].chr, rv, array[i].str, array[i].off);
530 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
531 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
535 @@ -1491,15 +1491,15 @@ PRBool test_016(void)
537 if( (char *)0 == rv )
539 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
540 - array[i].chr, array[i].off);
541 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
542 + array[i].chr, (unsigned)array[i].off);
546 if( &array[i].str[ array[i].off ] != rv )
548 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
549 - array[i].chr, rv, array[i].str, array[i].off);
550 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
551 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
555 @@ -1566,8 +1566,8 @@ PRBool test_017(void)
557 if( (char *)0 != rv )
559 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
560 - array[i].chr, array[i].max, rv);
561 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
562 + array[i].chr, (unsigned)array[i].max, rv);
566 @@ -1575,15 +1575,15 @@ PRBool test_017(void)
568 if( (char *)0 == rv )
570 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
571 - array[i].chr, array[i].max, array[i].off);
572 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
573 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
577 if( &array[i].str[ array[i].off ] != rv )
579 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
580 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
581 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
582 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
586 @@ -1650,8 +1650,8 @@ PRBool test_018(void)
588 if( (char *)0 != rv )
590 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
591 - array[i].chr, array[i].max, rv);
592 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
593 + array[i].chr, (unsigned)array[i].max, rv);
597 @@ -1659,15 +1659,15 @@ PRBool test_018(void)
599 if( (char *)0 == rv )
601 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
602 - array[i].chr, array[i].max, array[i].off);
603 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
604 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
608 - if( &array[i].str[ array[i].off ] != rv )
609 + if( &array[i].str[ array[i].off ] != rv)
611 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
612 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
613 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
614 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
618 @@ -1746,19 +1746,19 @@ PRBool test_019(void)
620 if( (char *)0 == rv )
622 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
623 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
624 array[i].str ? array[i].str : "(null)",
625 array[i].chrs ? array[i].chrs : "(null)",
627 + (unsigned)array[i].off);
631 if( &array[i].str[ array[i].off ] != rv )
633 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
634 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
635 array[i].str ? array[i].str : "(null)",
636 array[i].chrs ? array[i].chrs : "(null)",
637 - rv, array[i].str, array[i].off);
638 + rv, array[i].str, (unsigned)array[i].off);
642 @@ -1837,19 +1837,19 @@ PRBool test_020(void)
644 if( (char *)0 == rv )
646 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
647 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
648 array[i].str ? array[i].str : "(null)",
649 array[i].chrs ? array[i].chrs : "(null)",
651 + (unsigned)array[i].off);
655 if( &array[i].str[ array[i].off ] != rv )
657 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
658 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
659 array[i].str ? array[i].str : "(null)",
660 array[i].chrs ? array[i].chrs : "(null)",
661 - rv, array[i].str, array[i].off);
662 + rv, array[i].str, (unsigned)array[i].off);
666 @@ -1923,10 +1923,10 @@ PRBool test_021(void)
668 if( (char *)0 != rv )
670 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
671 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
672 array[i].str ? array[i].str : "(null)",
673 array[i].chrs ? array[i].chrs : "(null)",
675 + (unsigned)array[i].max, rv);
679 @@ -1934,19 +1934,19 @@ PRBool test_021(void)
681 if( (char *)0 == rv )
683 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
684 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
685 array[i].str ? array[i].str : "(null)",
686 array[i].chrs ? array[i].chrs : "(null)",
687 - array[i].max, array[i].off);
688 + (unsigned)array[i].max, array[i].off);
692 if( &array[i].str[ array[i].off ] != rv )
694 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
695 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
696 array[i].str ? array[i].str : "(null)",
697 array[i].chrs ? array[i].chrs : "(null)",
698 - array[i].max, rv, array[i].str, array[i].off);
699 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
703 @@ -2029,10 +2029,10 @@ PRBool test_022(void)
705 if( (char *)0 != rv )
707 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
708 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
709 array[i].str ? array[i].str : "(null)",
710 array[i].chrs ? array[i].chrs : "(null)",
712 + (unsigned)array[i].max, rv);
716 @@ -2040,19 +2040,19 @@ PRBool test_022(void)
718 if( (char *)0 == rv )
720 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
721 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
722 array[i].str ? array[i].str : "(null)",
723 array[i].chrs ? array[i].chrs : "(null)",
724 - array[i].max, array[i].off);
725 + (unsigned)array[i].max, array[i].off);
729 if( &array[i].str[ array[i].off ] != rv )
731 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
732 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
733 array[i].str ? array[i].str : "(null)",
734 array[i].chrs ? array[i].chrs : "(null)",
735 - array[i].max, rv, array[i].str, array[i].off);
736 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
740 @@ -2148,19 +2148,19 @@ PRBool test_023(void)
742 if( (char *)0 == rv )
744 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
745 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
746 array[i].str ? array[i].str : "(null)",
747 array[i].sub ? array[i].sub : "(null)",
748 - array[i].str, array[i].off);
749 + array[i].str, (unsigned)array[i].off);
753 if( &array[i].str[ array[i].off ] != rv )
755 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
756 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
757 array[i].str ? array[i].str : "(null)",
758 array[i].sub ? array[i].sub : "(null)",
759 - rv, array[i].str, array[i].off);
760 + rv, array[i].str, (unsigned)array[i].off);
764 @@ -2256,19 +2256,19 @@ PRBool test_024(void)
766 if( (char *)0 == rv )
768 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
769 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
770 array[i].str ? array[i].str : "(null)",
771 array[i].sub ? array[i].sub : "(null)",
772 - array[i].str, array[i].off);
773 + array[i].str, (unsigned)array[i].off);
777 if( &array[i].str[ array[i].off ] != rv )
779 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
780 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
781 array[i].str ? array[i].str : "(null)",
782 array[i].sub ? array[i].sub : "(null)",
783 - rv, array[i].str, array[i].off);
784 + rv, array[i].str, (unsigned)array[i].off);
788 @@ -2375,10 +2375,10 @@ PRBool test_025(void)
790 if( (char *)0 != rv )
792 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
793 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
794 array[i].str ? array[i].str : "(null)",
795 array[i].sub ? array[i].sub : "(null)",
797 + (unsigned)array[i].max, rv);
801 @@ -2386,19 +2386,19 @@ PRBool test_025(void)
803 if( (char *)0 == rv )
805 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
806 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
807 array[i].str ? array[i].str : "(null)",
808 array[i].sub ? array[i].sub : "(null)",
809 - array[i].max, array[i].str, array[i].off);
810 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
814 if( &array[i].str[ array[i].off ] != rv )
816 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
817 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
818 array[i].str ? array[i].str : "(null)",
819 array[i].sub ? array[i].sub : "(null)",
820 - array[i].max, rv, array[i].str, array[i].off);
821 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
825 @@ -2507,10 +2507,10 @@ PRBool test_026(void)
827 if( (char *)0 != rv )
829 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
830 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
831 array[i].str ? array[i].str : "(null)",
832 array[i].sub ? array[i].sub : "(null)",
834 + (unsigned)array[i].max, rv);
838 @@ -2518,19 +2518,19 @@ PRBool test_026(void)
840 if( (char *)0 == rv )
842 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
843 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
844 array[i].str ? array[i].str : "(null)",
845 array[i].sub ? array[i].sub : "(null)",
846 - array[i].max, array[i].str, array[i].off);
847 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
851 if( &array[i].str[ array[i].off ] != rv )
853 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
854 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
855 array[i].str ? array[i].str : "(null)",
856 array[i].sub ? array[i].sub : "(null)",
857 - array[i].max, rv, array[i].str, array[i].off);
858 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
862 @@ -2626,19 +2626,19 @@ PRBool test_027(void)
864 if( (char *)0 == rv )
866 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
867 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
868 array[i].str ? array[i].str : "(null)",
869 array[i].sub ? array[i].sub : "(null)",
870 - array[i].str, array[i].off);
871 + array[i].str, (unsigned)array[i].off);
875 if( &array[i].str[ array[i].off ] != rv )
877 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
878 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
879 array[i].str ? array[i].str : "(null)",
880 array[i].sub ? array[i].sub : "(null)",
881 - rv, array[i].str, array[i].off);
882 + rv, array[i].str, (unsigned)array[i].off);
886 @@ -2734,19 +2734,19 @@ PRBool test_028(void)
888 if( (char *)0 == rv )
890 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
891 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
892 array[i].str ? array[i].str : "(null)",
893 array[i].sub ? array[i].sub : "(null)",
894 - array[i].str, array[i].off);
895 + array[i].str, (unsigned)array[i].off);
899 if( &array[i].str[ array[i].off ] != rv )
901 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
902 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
903 array[i].str ? array[i].str : "(null)",
904 array[i].sub ? array[i].sub : "(null)",
905 - rv, array[i].str, array[i].off);
906 + rv, array[i].str, (unsigned)array[i].off);
910 @@ -2853,10 +2853,10 @@ PRBool test_029(void)
912 if( (char *)0 != rv )
914 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
915 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
916 array[i].str ? array[i].str : "(null)",
917 array[i].sub ? array[i].sub : "(null)",
919 + (unsigned)array[i].max, rv);
923 @@ -2864,19 +2864,19 @@ PRBool test_029(void)
925 if( (char *)0 == rv )
927 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
928 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
929 array[i].str ? array[i].str : "(null)",
930 array[i].sub ? array[i].sub : "(null)",
931 - array[i].max, array[i].str, array[i].off);
932 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
936 if( &array[i].str[ array[i].off ] != rv )
938 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
939 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
940 array[i].str ? array[i].str : "(null)",
941 array[i].sub ? array[i].sub : "(null)",
942 - array[i].max, rv, array[i].str, array[i].off);
943 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
947 @@ -2985,10 +2985,10 @@ PRBool test_030(void)
949 if( (char *)0 != rv )
951 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
952 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
953 array[i].str ? array[i].str : "(null)",
954 array[i].sub ? array[i].sub : "(null)",
956 + (unsigned)array[i].max, rv);
960 @@ -2996,19 +2996,19 @@ PRBool test_030(void)
962 if( (char *)0 == rv )
964 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
965 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
966 array[i].str ? array[i].str : "(null)",
967 array[i].sub ? array[i].sub : "(null)",
968 - array[i].max, array[i].str, array[i].off);
969 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
973 if( &array[i].str[ array[i].off ] != rv )
975 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
976 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
977 array[i].str ? array[i].str : "(null)",
978 array[i].sub ? array[i].sub : "(null)",
979 - array[i].max, rv, array[i].str, array[i].off);
980 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
986 [FILE:6203:patches/patch-pr_include_md___dragonfly.cfg]
987 --- /dev/null 2020-09-20 11:06:55 UTC
988 +++ pr/include/md/_dragonfly.cfg
990 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
991 +/* This Source Code Form is subject to the terms of the Mozilla Public
992 + * License, v. 2.0. If a copy of the MPL was not distributed with this
993 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
995 +#ifndef nspr_cpucfg___
996 +#define nspr_cpucfg___
1002 +#define PR_AF_INET6 28 /* same as AF_INET6 */
1004 +#ifndef HAVE_LONG_LONG
1005 +#define HAVE_LONG_LONG
1008 +#if defined(__i386__)
1010 +#define IS_LITTLE_ENDIAN 1
1011 +#undef IS_BIG_ENDIAN
1012 +#undef HAVE_ALIGNED_DOUBLES
1013 +#undef HAVE_ALIGNED_LONGLONGS
1015 +#define PR_BYTES_PER_BYTE 1
1016 +#define PR_BYTES_PER_SHORT 2
1017 +#define PR_BYTES_PER_INT 4
1018 +#define PR_BYTES_PER_INT64 8
1019 +#define PR_BYTES_PER_LONG 4
1020 +#define PR_BYTES_PER_FLOAT 4
1021 +#define PR_BYTES_PER_DOUBLE 8
1022 +#define PR_BYTES_PER_WORD 4
1023 +#define PR_BYTES_PER_DWORD 8
1024 +#define PR_BYTES_PER_WORD_LOG2 2
1025 +#define PR_BYTES_PER_DWORD_LOG2 3
1027 +#define PR_BITS_PER_BYTE 8
1028 +#define PR_BITS_PER_SHORT 16
1029 +#define PR_BITS_PER_INT 32
1030 +#define PR_BITS_PER_INT64 64
1031 +#define PR_BITS_PER_LONG 32
1032 +#define PR_BITS_PER_FLOAT 32
1033 +#define PR_BITS_PER_DOUBLE 64
1034 +#define PR_BITS_PER_WORD 32
1036 +#define PR_BITS_PER_BYTE_LOG2 3
1037 +#define PR_BITS_PER_SHORT_LOG2 4
1038 +#define PR_BITS_PER_INT_LOG2 5
1039 +#define PR_BITS_PER_INT64_LOG2 6
1040 +#define PR_BITS_PER_LONG_LOG2 5
1041 +#define PR_BITS_PER_FLOAT_LOG2 5
1042 +#define PR_BITS_PER_DOUBLE_LOG2 6
1043 +#define PR_BITS_PER_WORD_LOG2 5
1045 +#define PR_ALIGN_OF_SHORT 2
1046 +#define PR_ALIGN_OF_INT 4
1047 +#define PR_ALIGN_OF_LONG 4
1048 +#define PR_ALIGN_OF_INT64 4
1049 +#define PR_ALIGN_OF_FLOAT 4
1050 +#define PR_ALIGN_OF_DOUBLE 4
1051 +#define PR_ALIGN_OF_POINTER 4
1053 +#elif defined(__alpha__)
1055 +#define IS_LITTLE_ENDIAN 1
1056 +#undef IS_BIG_ENDIAN
1057 +#define HAVE_ALIGNED_DOUBLES
1058 +#define HAVE_ALIGNED_LONGLONGS
1061 +#define PR_BYTES_PER_BYTE 1
1062 +#define PR_BYTES_PER_SHORT 2
1063 +#define PR_BYTES_PER_INT 4
1064 +#define PR_BYTES_PER_INT64 8
1065 +#define PR_BYTES_PER_LONG 8
1066 +#define PR_BYTES_PER_FLOAT 4
1067 +#define PR_BYTES_PER_DOUBLE 8
1068 +#define PR_BYTES_PER_WORD 8
1069 +#define PR_BYTES_PER_DWORD 8
1070 +#define PR_BYTES_PER_WORD_LOG2 3
1071 +#define PR_BYTES_PER_DWORD_LOG2 3
1073 +#define PR_BITS_PER_BYTE 8
1074 +#define PR_BITS_PER_SHORT 16
1075 +#define PR_BITS_PER_INT 32
1076 +#define PR_BITS_PER_INT64 64
1077 +#define PR_BITS_PER_LONG 64
1078 +#define PR_BITS_PER_FLOAT 32
1079 +#define PR_BITS_PER_DOUBLE 64
1080 +#define PR_BITS_PER_WORD 64
1082 +#define PR_BITS_PER_BYTE_LOG2 3
1083 +#define PR_BITS_PER_SHORT_LOG2 4
1084 +#define PR_BITS_PER_INT_LOG2 5
1085 +#define PR_BITS_PER_INT64_LOG2 6
1086 +#define PR_BITS_PER_LONG_LOG2 6
1087 +#define PR_BITS_PER_FLOAT_LOG2 5
1088 +#define PR_BITS_PER_DOUBLE_LOG2 6
1089 +#define PR_BITS_PER_WORD_LOG2 6
1091 +#define PR_ALIGN_OF_SHORT 2
1092 +#define PR_ALIGN_OF_INT 4
1093 +#define PR_ALIGN_OF_LONG 8
1094 +#define PR_ALIGN_OF_INT64 8
1095 +#define PR_ALIGN_OF_FLOAT 4
1096 +#define PR_ALIGN_OF_DOUBLE 8
1097 +#define PR_ALIGN_OF_POINTER 8
1099 +#elif defined(__amd64__)
1101 +#define IS_LITTLE_ENDIAN 1
1102 +#undef IS_BIG_ENDIAN
1103 +#define HAVE_ALIGNED_DOUBLES
1104 +#define HAVE_ALIGNED_LONGLONGS
1107 +#define PR_BYTES_PER_BYTE 1
1108 +#define PR_BYTES_PER_SHORT 2
1109 +#define PR_BYTES_PER_INT 4
1110 +#define PR_BYTES_PER_INT64 8
1111 +#define PR_BYTES_PER_LONG 8
1112 +#define PR_BYTES_PER_FLOAT 4
1113 +#define PR_BYTES_PER_DOUBLE 8
1114 +#define PR_BYTES_PER_WORD 8
1115 +#define PR_BYTES_PER_DWORD 8
1116 +#define PR_BYTES_PER_WORD_LOG2 3
1117 +#define PR_BYTES_PER_DWORD_LOG2 3
1119 +#define PR_BITS_PER_BYTE 8
1120 +#define PR_BITS_PER_SHORT 16
1121 +#define PR_BITS_PER_INT 32
1122 +#define PR_BITS_PER_INT64 64
1123 +#define PR_BITS_PER_LONG 64
1124 +#define PR_BITS_PER_FLOAT 32
1125 +#define PR_BITS_PER_DOUBLE 64
1126 +#define PR_BITS_PER_WORD 64
1128 +#define PR_BITS_PER_BYTE_LOG2 3
1129 +#define PR_BITS_PER_SHORT_LOG2 4
1130 +#define PR_BITS_PER_INT_LOG2 5
1131 +#define PR_BITS_PER_INT64_LOG2 6
1132 +#define PR_BITS_PER_LONG_LOG2 6
1133 +#define PR_BITS_PER_FLOAT_LOG2 5
1134 +#define PR_BITS_PER_DOUBLE_LOG2 6
1135 +#define PR_BITS_PER_WORD_LOG2 6
1137 +#define PR_ALIGN_OF_SHORT 2
1138 +#define PR_ALIGN_OF_INT 4
1139 +#define PR_ALIGN_OF_LONG 8
1140 +#define PR_ALIGN_OF_INT64 8
1141 +#define PR_ALIGN_OF_FLOAT 4
1142 +#define PR_ALIGN_OF_DOUBLE 8
1143 +#define PR_ALIGN_OF_POINTER 8
1144 +#define PR_ALIGN_OF_WORD 8
1148 +#error "Unknown CPU architecture"
1152 +#ifndef NO_NSPR_10_SUPPORT
1154 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
1155 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
1156 +#define BYTES_PER_INT PR_BYTES_PER_INT
1157 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
1158 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
1159 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
1160 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
1161 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
1162 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
1164 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
1165 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
1166 +#define BITS_PER_INT PR_BITS_PER_INT
1167 +#define BITS_PER_INT64 PR_BITS_PER_INT64
1168 +#define BITS_PER_LONG PR_BITS_PER_LONG
1169 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
1170 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
1171 +#define BITS_PER_WORD PR_BITS_PER_WORD
1173 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
1174 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
1175 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
1176 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
1177 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
1178 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
1179 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
1180 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
1182 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
1183 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
1184 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
1185 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
1186 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
1187 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
1188 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
1189 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
1191 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
1192 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
1193 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
1195 +#endif /* NO_NSPR_10_SUPPORT */
1197 +#endif /* nspr_cpucfg___ */
1200 [FILE:6201:patches/patch-pr_include_md___dragonfly.h]
1201 --- /dev/null 2020-09-20 11:06:55 UTC
1202 +++ pr/include/md/_dragonfly.h
1204 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
1205 +/* This Source Code Form is subject to the terms of the Mozilla Public
1206 + * License, v. 2.0. If a copy of the MPL was not distributed with this
1207 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1209 +#ifndef nspr_dragonfly_defs_h___
1210 +#define nspr_dragonfly_defs_h___
1212 +#include "prthread.h"
1215 +#if __FreeBSD__ >= 2
1216 +#include <osreldate.h> /* for __FreeBSD_version */
1218 +#include <sys/syscall.h>
1221 +#define PR_LINKER_ARCH "dragonfly"
1222 +#define _PR_SI_SYSNAME "DRAGONFLY"
1223 +#if defined(__i386__)
1224 +#define _PR_SI_ARCHITECTURE "x86"
1225 +#elif defined(__amd64__)
1226 +#define _PR_SI_ARCHITECTURE "amd64"
1228 +#error "Unknown CPU architecture"
1231 +#define PR_DLL_SUFFIX ".so"
1233 +#define _PR_VMBASE 0x30000000
1234 +#define _PR_STACK_VMBASE 0x50000000
1235 +#define _MD_DEFAULT_STACK_SIZE 65536L
1236 +#define _MD_MMAP_FLAGS MAP_PRIVATE
1238 +#undef HAVE_STACK_GROWING_UP
1241 +#define _PR_HAVE_SOCKADDR_LEN
1242 +#define _PR_STAT_HAS_ST_ATIMESPEC
1243 +#define _PR_HAVE_LARGE_OFF_T
1245 +#define _PR_HAVE_GETPROTO_R
1246 +#define _PR_HAVE_5_ARG_GETPROTO_R
1247 +#define _PR_HAVE_GETHOST_R
1248 +#define _PR_HAVE_GETHOST_R_INT
1250 +#define _PR_POLL_AVAILABLE
1252 +#define _PR_HAVE_SYSV_SEMAPHORES
1253 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
1256 +#define _PR_HAVE_INET_NTOP
1257 +#define _PR_HAVE_GETHOSTBYNAME2
1258 +#define _PR_HAVE_GETADDRINFO
1259 +#define _PR_INET6_PROBE
1260 +#define _PR_IPV6_V6ONLY_PROBE
1264 +#ifndef _PR_PTHREADS
1265 +#include <setjmp.h>
1267 +#define PR_CONTEXT_TYPE sigjmp_buf
1269 +#define CONTEXT(_th) ((_th)->md.context)
1271 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
1272 +#define PR_NUM_GCREGS _JBLEN
1275 +** Initialize a thread context to run "_main()" when started
1277 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
1279 + *status = PR_TRUE; \
1280 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
1283 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
1286 +#define _MD_SWITCH_CONTEXT(_thread) \
1287 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
1288 + (_thread)->md.errcode = errno; \
1293 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
1295 +#define _MD_RESTORE_CONTEXT(_thread) \
1297 + errno = (_thread)->md.errcode; \
1298 + _MD_SET_CURRENT_THREAD(_thread); \
1299 + siglongjmp(CONTEXT(_thread), 1); \
1302 +/* Machine-dependent (MD) data structures */
1305 + PR_CONTEXT_TYPE context;
1310 +struct _MDThreadStack {
1318 +struct _MDSemaphore {
1326 +struct _MDSegment {
1331 + * md-specific cpu structure field
1333 +#define _PR_MD_MAX_OSFD FD_SETSIZE
1335 +struct _MDCPU_Unix {
1337 + PRUint32 ioq_timeout;
1338 + PRInt32 ioq_max_osfd;
1339 + PRInt32 ioq_osfd_cnt;
1340 +#ifndef _PR_USE_POLL
1341 + fd_set fd_read_set, fd_write_set, fd_exception_set;
1342 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
1343 + fd_exception_cnt[_PR_MD_MAX_OSFD];
1345 + struct pollfd *ioq_pollfds;
1346 + int ioq_pollfds_size;
1347 +#endif /* _PR_USE_POLL */
1350 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
1351 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
1352 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
1353 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
1354 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
1355 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
1356 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
1357 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
1358 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
1359 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
1360 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
1361 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
1362 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
1364 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
1367 + struct _MDCPU_Unix md_unix;
1370 +#define _MD_INIT_LOCKS()
1371 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
1372 +#define _MD_FREE_LOCK(lock)
1373 +#define _MD_LOCK(lock)
1374 +#define _MD_UNLOCK(lock)
1375 +#define _MD_INIT_IO()
1376 +#define _MD_IOQ_LOCK()
1377 +#define _MD_IOQ_UNLOCK()
1379 +extern PRStatus _MD_InitializeThread(PRThread *thread);
1381 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
1382 +#define _MD_INIT_THREAD _MD_InitializeThread
1383 +#define _MD_EXIT_THREAD(thread)
1384 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
1385 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
1386 +#define _MD_CLEAN_THREAD(_thread)
1388 +extern PRStatus _MD_CREATE_THREAD(
1390 + void (*start) (void *),
1391 + PRThreadPriority priority,
1392 + PRThreadScope scope,
1393 + PRThreadState state,
1394 + PRUint32 stackSize);
1395 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
1396 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
1397 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
1398 +extern void _MD_YIELD(void);
1400 +#endif /* ! _PR_PTHREADS */
1402 +extern void _MD_EarlyInit(void);
1404 +#define _MD_EARLY_INIT _MD_EarlyInit
1405 +#define _MD_FINAL_INIT _PR_UnixInit
1406 +#define _MD_INTERVAL_USE_GTOD
1409 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
1410 + * unwrapped version.
1412 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
1414 +#if defined(_PR_POLL_AVAILABLE)
1416 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
1419 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
1420 + want to be including that.. */
1421 +#ifndef INADDR_LOOPBACK
1422 +#define INADDR_LOOPBACK (u_long)0x7F000001
1426 +#include <sys/uio.h>
1428 +#endif /* nspr_freebsd_defs_h___ */
1431 [FILE:1099:patches/patch-pr_include_md___freebsd.h]
1432 --- pr/include/md/_freebsd.h.orig 2020-08-20 23:04:43 UTC
1433 +++ pr/include/md/_freebsd.h
1435 #define _PR_HAVE_LARGE_OFF_T
1437 #if defined(_PR_PTHREADS)
1438 -#if __FreeBSD_version >= 400008
1439 +#if defined(__DragonFly__) || __FreeBSD_version >= 602000
1440 +#define _PR_HAVE_GETPROTO_R
1441 +#define _PR_HAVE_5_ARG_GETPROTO_R
1443 +#if __FreeBSD_version >= 700016
1444 +#define _PR_HAVE_GETHOST_R
1445 +#define _PR_HAVE_GETHOST_R_INT
1447 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
1449 * libc_r before this version of FreeBSD doesn't have poll().
1450 * Although libc has poll(), it is not thread-safe so we can't
1452 #define _PR_POLL_AVAILABLE
1455 -#if __FreeBSD_version >= 300000
1456 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
1457 #define _PR_POLL_AVAILABLE
1458 #define _PR_USE_POLL
1461 #define _PR_HAVE_SYSV_SEMAPHORES
1462 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
1464 -#if __FreeBSD_version >= 400014
1465 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
1467 #define _PR_HAVE_INET_NTOP
1468 #define _PR_HAVE_GETHOSTBYNAME2
1471 [FILE:1235:patches/patch-pr_include_md___pth.h]
1472 --- pr/include/md/_pth.h.orig 2020-08-20 23:04:43 UTC
1473 +++ pr/include/md/_pth.h
1476 #if defined(AIX) || defined(SOLARIS) \
1477 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1478 + || defined(__DragonFly__) \
1479 || defined(HPUX) || defined(FREEBSD) \
1480 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
1481 || defined(NTO) || defined(DARWIN) \
1483 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
1484 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
1485 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1486 + || defined(__DragonFly__) \
1488 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
1489 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
1490 @@ -175,6 +177,7 @@ extern int (*_PT_aix_yield_fcn)();
1491 #define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)()
1492 #elif defined(HPUX) || defined(SOLARIS) \
1493 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1494 + || defined(__DragonFly__) \
1495 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1496 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1497 || defined(UNIXWARE) || defined(RISCOS)
1500 [FILE:279:patches/patch-pr_include_md_prosdep.h]
1501 --- pr/include/md/prosdep.h.orig 2020-08-20 23:04:43 UTC
1502 +++ pr/include/md/prosdep.h
1503 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
1504 #elif defined(OPENBSD)
1505 #include "md/_openbsd.h"
1507 +#elif defined(__DragonFly__)
1508 +#include "md/_dragonfly.h"
1511 #include "md/_bsdi.h"
1515 [FILE:403:patches/patch-pr_src_md_unix_uxrng.c]
1516 --- pr/src/md/unix/uxrng.c.orig 2020-08-20 23:04:43 UTC
1517 +++ pr/src/md/unix/uxrng.c
1518 @@ -64,6 +64,7 @@ GetHighResClock(void *buf, size_t maxbyt
1520 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
1521 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
1522 + || defined(__DragonFly__) \
1523 || defined(__GNU__))
1524 #include <sys/types.h>
1525 #include <sys/stat.h>
1528 [FILE:699:patches/patch-pr_src_misc_prnetdb.c]
1529 --- pr/src/misc/prnetdb.c.orig 2020-08-20 23:04:43 UTC
1530 +++ pr/src/misc/prnetdb.c
1531 @@ -73,11 +73,6 @@ PRLock *_pr_dnsLock = NULL;
1532 #define _PR_HAVE_GETPROTO_R_INT
1535 -#if __FreeBSD_version >= 602000
1536 -#define _PR_HAVE_GETPROTO_R
1537 -#define _PR_HAVE_5_ARG_GETPROTO_R
1540 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
1541 #if (defined(__GLIBC__) && __GLIBC__ >= 2)
1542 #define _PR_HAVE_GETPROTO_R
1543 @@ -304,7 +299,7 @@ _pr_QueryNetIfs(void)
1546 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
1547 - || defined(NETBSD) || defined(OPENBSD)
1548 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
1551 * Use the BSD getifaddrs function.
1554 [FILE:1246:patches/patch-pr_src_pthreads_ptio.c]
1555 --- pr/src/pthreads/ptio.c.orig 2020-08-20 23:04:43 UTC
1556 +++ pr/src/pthreads/ptio.c
1557 @@ -182,6 +182,7 @@ static PRBool _pr_ipv6_v6only_on_by_defa
1558 || defined(HPUX10_30) || defined(HPUX11) \
1559 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1560 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1561 + || defined(__DragonFly__) \
1562 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1563 || defined(UNIXWARE) || defined(RISCOS)
1564 #define _PRSelectFdSetArg_t fd_set *
1565 @@ -3476,6 +3477,7 @@ static PRIOMethods _pr_socketpollfd_meth
1566 #if defined(HPUX) || defined(SOLARIS) \
1567 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1568 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
1569 + || defined(__DragonFly__) \
1570 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
1571 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS)
1572 #define _PR_FCNTL_FLAGS O_NONBLOCK
1573 @@ -5262,6 +5264,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
1575 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
1577 + start = 0; /* Not needed, but shuts down a warning */
1579 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
1580 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
1583 [FILE:836:patches/patch-pr_src_pthreads_ptsynch.c]
1584 --- pr/src/pthreads/ptsynch.c.orig 2020-08-20 23:04:43 UTC
1585 +++ pr/src/pthreads/ptsynch.c
1586 @@ -25,7 +25,7 @@ static pthread_condattr_t _pt_cvar_attr;
1587 extern PTDebug pt_debug; /* this is shared between several modules */
1588 #endif /* defined(DEBUG) */
1590 -#if defined(FREEBSD)
1591 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
1593 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
1594 * Newer versions return EBUSY. We still need to support both.
1595 @@ -952,6 +952,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
1597 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
1598 || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
1599 + || defined(__DragonFly__) \
1600 || defined(OPENBSD) || defined(BSDI) \
1602 /* union semun is defined by including <sys/sem.h> */
1605 [FILE:83888:patches/patch-tests]
1606 --- lib/tests/Makefile.in.orig 2020-08-20 23:04:43 UTC
1607 +++ lib/tests/Makefile.in
1608 @@ -159,7 +159,7 @@ else
1609 ifeq ($(OS_ARCH),OS2)
1610 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1612 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1613 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1617 --- pr/tests/cleanup.c.orig 2020-08-20 23:04:43 UTC
1618 +++ pr/tests/cleanup.c
1621 static void PR_CALLBACK Thread(void *sleep)
1623 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1624 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1625 printf("Thread exiting\n");
1628 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1629 PRThreadScope type = PR_LOCAL_THREAD;
1630 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1631 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1632 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1633 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1634 + intptr_t child_sleep = 10;
1637 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1638 @@ -82,7 +83,7 @@ int main(int argc, char **argv)
1639 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1640 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1641 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1642 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1643 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1644 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1645 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1647 --- pr/tests/cltsrv.c.orig 2020-08-20 23:04:43 UTC
1648 +++ pr/tests/cltsrv.c
1649 @@ -949,7 +949,7 @@ int main(int argc, char** argv)
1653 - CSClient_t *client;
1654 + CSClient_t *client = NULL;
1655 PRStatus rv, joinStatus;
1656 CSServer_t *server = NULL;
1658 --- pr/tests/cvar.c.orig 2020-08-20 23:04:43 UTC
1660 @@ -138,15 +138,15 @@ static int alive;
1661 static void PR_CALLBACK CXReader(void *arg)
1663 CircBuf *cbp = (CircBuf *)arg;
1669 for (i = 0; i < n; i++) {
1670 data = GetCBData(cbp);
1671 - if ((int)data != i)
1672 + if ((intptr_t)data != i)
1674 - printf("data mismatch at for i = %d usec\n", i);
1675 + printf("data mismatch at for i = %ld usec\n", (long)i);
1679 @@ -159,7 +159,7 @@ static void PR_CALLBACK CXReader(void *a
1680 static void PR_CALLBACK CXWriter(void *arg)
1682 CircBuf *cbp = (CircBuf *)arg;
1687 for (i = 0; i < n; i++) {
1688 --- pr/tests/cvar2.c.orig 2020-08-20 23:04:43 UTC
1689 +++ pr/tests/cvar2.c
1690 @@ -96,7 +96,7 @@ PrivateCondVarThread(void *_info)
1691 for (index=0; index<info->loops; index++) {
1692 PR_Lock(info->lock);
1693 if (*info->tcount == 0) {
1694 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1695 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1696 PR_GetCurrentThread(), info->cvar));
1697 PR_WaitCondVar(info->cvar, info->timeout);
1699 @@ -109,8 +109,8 @@ PrivateCondVarThread(void *_info)
1700 PR_Lock(info->exitlock);
1701 (*info->exitcount)++;
1702 PR_NotifyCondVar(info->exitcvar);
1703 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1704 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1705 + DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1706 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1707 PR_Unlock(info->exitlock);
1710 @@ -159,7 +159,7 @@ CreateTestThread(threadinfo *info,
1712 CondVarTestSUU(void *_arg)
1714 - PRInt32 arg = (PRInt32)_arg;
1715 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1716 PRInt32 index, loops;
1719 @@ -191,7 +191,7 @@ CondVarTestSUU(void *_arg)
1723 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1724 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1727 for (loops = 0; loops < count; loops++) {
1728 @@ -201,7 +201,7 @@ CondVarTestSUU(void *_arg)
1729 (*list[index].tcount)++;
1730 PR_NotifyCondVar(list[index].cvar);
1731 PR_Unlock(list[index].lock);
1732 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1733 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1734 PR_GetCurrentThread(), list[index].cvar));
1737 @@ -231,7 +231,7 @@ CondVarTestSUU(void *_arg)
1739 CondVarTestSUK(void *_arg)
1741 - PRInt32 arg = (PRInt32)_arg;
1742 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1743 PRInt32 index, loops;
1746 @@ -307,7 +307,7 @@ CondVarTestSUK(void *_arg)
1748 CondVarTestPUU(void *_arg)
1750 - PRInt32 arg = (PRInt32)_arg;
1751 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1752 PRInt32 index, loops;
1755 @@ -342,7 +342,7 @@ CondVarTestPUU(void *_arg)
1759 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1760 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1764 @@ -360,8 +360,8 @@ CondVarTestPUU(void *_arg)
1766 /* Wait for threads to finish */
1767 while(exitcount < arg) {
1768 - DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1769 - PR_GetCurrentThread(), exitcvar, exitcount));
1770 + DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1771 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1772 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1774 PR_ASSERT(exitcount >= arg);
1775 @@ -371,7 +371,7 @@ CondVarTestPUU(void *_arg)
1777 /* Join all the threads */
1778 for(index=0; index<(arg); index++) {
1779 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1780 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1781 PR_JoinThread(list[index].thread);
1782 if (list[index].internal) {
1783 PR_Lock(list[index].lock);
1784 @@ -393,7 +393,7 @@ CondVarTestPUU(void *_arg)
1786 CondVarTestPUK(void *_arg)
1788 - PRInt32 arg = (PRInt32)_arg;
1789 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1790 PRInt32 index, loops;
1793 @@ -475,7 +475,7 @@ CondVarTestPUK(void *_arg)
1795 CondVarTest(void *_arg)
1797 - PRInt32 arg = (PRInt32)_arg;
1798 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1799 PRInt32 index, loops;
1802 @@ -609,7 +609,7 @@ CondVarTest(void *_arg)
1804 CondVarTimeoutTest(void *_arg)
1806 - PRInt32 arg = (PRInt32)_arg;
1807 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1808 PRInt32 index, loops;
1811 @@ -721,7 +721,7 @@ CondVarTimeoutTest(void *_arg)
1813 CondVarMixedTest(void *_arg)
1815 - PRInt32 arg = (PRInt32)_arg;
1816 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1817 PRInt32 index, loops;
1820 @@ -811,7 +811,7 @@ CondVarMixedTest(void *_arg)
1821 for(index=0; index<(arg*4); index+=3) {
1823 PR_Lock(list[index].lock);
1824 - *list[index].tcount++;
1825 + list[index].tcount++;
1826 PR_NotifyCondVar(list[index].cvar);
1827 PR_Unlock(list[index].lock);
1829 @@ -883,7 +883,7 @@ static void Measure(void (*func)(void *)
1832 start = PR_IntervalNow();
1833 - (*func)((void *)arg);
1834 + (*func)((void *)(intptr_t)arg);
1835 stop = PR_IntervalNow();
1837 d = (double)PR_IntervalToMicroseconds(stop - start);
1838 @@ -948,7 +948,7 @@ This test is run with %d, %d, %d, and %d
1839 PR_SetConcurrency(2);
1841 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1842 - printf("\n%ld Thread tests\n", threads);
1843 + printf("\n%d Thread tests\n", (int)threads);
1844 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1845 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1846 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1847 --- pr/tests/foreign.c.orig 2020-08-20 23:04:43 UTC
1848 +++ pr/tests/foreign.c
1849 @@ -175,7 +175,7 @@ static void OneShot(void *arg)
1852 PRFileDesc *pair[2];
1853 - PRIntn test = (PRIntn)arg;
1854 + intptr_t test = (intptr_t)arg;
1856 for (test = 0; test < 12; ++test) {
1858 @@ -272,7 +272,7 @@ static void OneShot(void *arg)
1859 int main(int argc, char **argv)
1862 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1863 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1865 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1867 --- pr/tests/forktest.c.orig 2020-08-20 23:04:43 UTC
1868 +++ pr/tests/forktest.c
1869 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1872 PRFileDesc *sock = NULL;
1873 - PRInt32 tmp = (PRInt32)arg;
1874 + intptr_t tmp = (intptr_t)arg;
1877 * Make sure the PR_Accept call will block
1878 @@ -143,7 +143,7 @@ DoIO(void)
1881 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1882 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1883 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1884 PR_JOINABLE_THREAD, 0);
1885 if (clientThread == NULL) {
1886 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1887 @@ -151,6 +151,9 @@ DoIO(void)
1891 + printf("Wait one second before accept\n");
1893 + PR_Sleep(PR_SecondsToInterval(1));
1894 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1896 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1897 --- pr/tests/getai.c.orig 2020-08-20 23:04:43 UTC
1898 +++ pr/tests/getai.c
1899 @@ -13,8 +13,15 @@ int main(int argc, char **argv)
1905 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1910 + host = "www.FreeBSD.org";
1912 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1914 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1915 PR_GetError(), PR_GetOSError());
1916 --- pr/tests/instrumt.c.orig 2020-08-20 23:04:43 UTC
1917 +++ pr/tests/instrumt.c
1924 #include <prclist.h>
1927 #define COUNT_LIMIT (10 * ( 1024))
1929 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1934 @@ -78,10 +78,10 @@ static void Help(void)
1936 static void ListCounters(void)
1938 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1939 PR_DEFINE_COUNTER( qh );
1940 PR_DEFINE_COUNTER( rh );
1941 const char *qn, *rn, *dn;
1942 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1945 PR_INIT_COUNTER_HANDLE( qh, NULL );
1946 @@ -92,7 +92,7 @@ static void ListCounters(void)
1947 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1948 while ( rh != NULL )
1950 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1951 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1952 PR_GET_COUNTER(tCtr, rh);
1953 PR_LOG( lm, msgLevel,
1954 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1955 @@ -101,15 +101,15 @@ static void ListCounters(void)
1957 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1961 } /* end ListCounters() */
1963 static void ListTraces(void)
1965 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1966 PR_DEFINE_TRACE( qh );
1967 PR_DEFINE_TRACE( rh );
1968 const char *qn, *rn, *dn;
1969 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1971 PR_INIT_TRACE_HANDLE( qh, NULL );
1972 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1973 @@ -119,7 +119,7 @@ static void ListTraces(void)
1974 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1975 while ( rh != NULL )
1977 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1978 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1979 PR_LOG( lm, msgLevel,
1980 ( "QName: %s RName: %s Desc: %s",
1982 @@ -127,7 +127,7 @@ static void ListTraces(void)
1984 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1988 } /* end ListCounters() */
1991 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1993 static void TraceTest( void )
1998 PR_DEFINE_TRACE( th );
2000 --- pr/tests/io_timeout.c.orig 2020-08-20 23:04:43 UTC
2001 +++ pr/tests/io_timeout.c
2003 /* Used to get the command line option */
2004 #include "plgetopt.h"
2008 +#include <string.h>
2011 #define NUM_THREADS 1
2012 -#define BASE_PORT 8000
2013 +#define BASE_PORT 38011
2014 #define DEFAULT_ACCEPT_TIMEOUT 2
2016 typedef struct threadInfo {
2017 @@ -38,7 +40,7 @@ typedef struct threadInfo {
2020 PRIntn failed_already = 0;
2021 -PRIntn debug_mode = 0;
2022 +PRIntn debug_mode = 1;
2024 #define LOCAL_SCOPE_STRING "LOCAL scope"
2025 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
2026 @@ -54,7 +56,7 @@ thread_main(void *_info)
2027 PRFileDesc *clientSock;
2029 PRThreadScope tscope;
2031 + const char *scope_str;
2035 @@ -74,6 +76,7 @@ thread_main(void *_info)
2038 PR_NOT_REACHED("Invalid thread scope");
2042 printf("thread id %d, scope %s\n", info->id, scope_str);
2043 @@ -92,8 +95,12 @@ thread_main(void *_info)
2044 listenAddr.inet.ip = PR_htonl(PR_INADDR_ANY);
2045 rv = PR_Bind(listenSock, &listenAddr);
2046 if (rv == PR_FAILURE) {
2048 - printf("unable to bind\n");
2050 + printf("unable to bind to %d: %s\n",
2051 + BASE_PORT + info->id, strerror(PR_GetOSError()));
2052 + if (PR_GetOSError() == EADDRINUSE) {
2053 + printf("can not proceed with this test\n");
2058 @@ -117,8 +124,9 @@ thread_main(void *_info)
2059 if (clientSock == NULL) {
2060 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
2062 - printf("PR_Accept() timeout worked!\n");
2063 - printf("TEST PASSED! PR_Accept() returned error %d\n",
2064 + printf("PR_Accept() timeout worked!\n"
2065 + "TEST PASSED! PR_Accept() returned error "
2066 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
2067 PR_IO_TIMEOUT_ERROR);
2070 --- pr/tests/layer.c.orig 2020-08-20 23:04:43 UTC
2071 +++ pr/tests/layer.c
2072 @@ -57,7 +57,10 @@ static PRUint16 default_port = 12273 POR
2073 static PRFileDesc *PushLayer(PRFileDesc *stack)
2075 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
2076 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
2077 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
2078 + PRStatus rv = /* we only need rv for PR_ASSERT() */
2080 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
2081 if (verbosity > quiet) {
2082 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
2084 --- pr/tests/lazyinit.c.orig 2020-08-20 23:04:43 UTC
2085 +++ pr/tests/lazyinit.c
2086 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
2090 - PRCondVar *cv = NULL;
2091 PRThread *thread = NULL;
2092 PRIntervalTime interval = 0;
2093 PRFileDesc *file, *udp, *tcp, *pair[2];
2094 --- pr/tests/lltest.c.orig 2020-08-20 23:04:43 UTC
2095 +++ pr/tests/lltest.c
2096 @@ -651,6 +651,7 @@ TestConversion( void )
2101 static void ShiftCompileOnly()
2104 @@ -667,6 +668,7 @@ static void ShiftCompileOnly()
2105 LL_ISHL(ia, 49, 32);
2107 } /* ShiftCompileOnly */
2112 @@ -751,7 +753,6 @@ TestArithmetic( void )
2113 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
2114 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
2115 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
2116 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
2117 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
2118 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
2119 PRInt64 result, result2;
2120 --- pr/tests/mbcs.c.orig 2020-08-20 23:04:43 UTC
2122 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
2124 ** Traverse directory
2126 -static void TraverseDirectory( unsigned char *dir )
2127 +static void TraverseDirectory(const char *dir)
2130 PRDirEntry *dirEntry;
2137 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
2140 if ( PR_FILE_FILE == info.type ) {
2141 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
2142 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
2143 fd = PR_Open( file, PR_RDONLY, 0 );
2145 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
2146 - PR_GetError(), PR_GetOSError());
2147 + (long)PR_GetError(), (long)PR_GetOSError());
2149 rc = PR_Close( fd );
2150 if ( PR_FAILURE == rc ) {
2151 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
2152 - PR_GetError(), PR_GetOSError());
2153 + (long)PR_GetError(), (long)PR_GetOSError());
2155 } else if ( PR_FILE_DIRECTORY == info.type ) {
2156 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
2157 --- pr/tests/nbconn.c.orig 2020-08-20 23:04:43 UTC
2158 +++ pr/tests/nbconn.c
2159 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
2161 PRSocketOptionData optData;
2162 const char *hostname = NULL;
2163 - PRIntn default_case, n, bytes_read, bytes_sent;
2164 - PRInt32 failed_already = 0;
2165 + PRIntn default_case, n;
2169 @@ -169,7 +168,7 @@ int main(int argc, char **argv)
2172 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
2173 - PR_GetError(), PR_GetOSError());
2174 + (long)PR_GetError(), (long)PR_GetOSError());
2178 @@ -240,7 +239,7 @@ connection_success_test()
2179 PRThread *thr = NULL;
2181 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
2182 - PRIntn default_case, n, bytes_read, bytes_sent;
2183 + PRIntn n, bytes_read, bytes_sent;
2184 PRIntn failed_already = 0;
2187 @@ -317,7 +316,7 @@ connection_success_test()
2191 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
2192 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
2194 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
2195 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
2196 @@ -396,7 +395,7 @@ connection_success_test()
2197 DPRINTF(("Data integrity verified\n"));
2199 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
2200 - PR_GetError(), PR_GetOSError());
2201 + (long)PR_GetError(), (long)PR_GetOSError());
2205 @@ -505,7 +504,6 @@ connection_failure_test()
2208 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
2210 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
2213 --- pr/tests/nblayer.c.orig 2020-08-20 23:04:43 UTC
2214 +++ pr/tests/nblayer.c
2215 @@ -360,7 +360,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
2216 static PRInt16 PR_CALLBACK MyPoll(
2217 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
2219 - PRInt16 my_flags, new_flags;
2220 + PRInt16 my_flags = -1, new_flags;
2221 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
2222 if (0 != (PR_POLL_READ & in_flags))
2224 @@ -405,7 +405,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
2225 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
2228 - PRFileDesc *newfd, *layer = fd;
2229 + PRFileDesc *newfd;
2230 PRFileDesc *newstack;
2231 PRFilePrivate *newsecret;
2233 @@ -507,6 +507,8 @@ static PRInt32 PR_CALLBACK MyRecv(
2234 mine->rcvinprogress = 0;
2235 return mine->rcvreq; /* << -- that's it! */
2237 + PR_ASSERT(!"How did I get this mine->rcvstate?");
2242 @@ -575,6 +577,8 @@ static PRInt32 PR_CALLBACK MySend(
2243 mine->xmtinprogress = 0;
2244 return mine->xmtreq; /* <<-- That's the one! */
2246 + PR_ASSERT(!"How did I get this mine->xmtstate?");
2251 --- pr/tests/nonblock.c.orig 2020-08-20 23:04:43 UTC
2252 +++ pr/tests/nonblock.c
2254 static void PR_CALLBACK
2255 clientThreadFunc(void *arg)
2257 - PRUintn port = (PRUintn)arg;
2258 + intptr_t port = (intptr_t)arg;
2261 char buf[CHUNK_SIZE];
2262 @@ -145,7 +145,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2265 clientThread = PR_CreateThread(PR_USER_THREAD,
2266 - clientThreadFunc, (void *) listenPort,
2267 + clientThreadFunc, (void *) (intptr_t)listenPort,
2268 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2269 PR_UNJOINABLE_THREAD, 0);
2270 if (clientThread == NULL) {
2271 @@ -189,7 +189,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2272 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
2273 PL_PrintError("First Receive:\n");
2274 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
2275 - retVal, PR_GetError());
2276 + (long)retVal, (long)PR_GetError());
2279 printf("read: EWOULDBLOCK, good\n");
2280 @@ -199,7 +199,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2281 if (retVal != CHUNK_SIZE) {
2282 PL_PrintError("Second Receive:\n");
2283 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
2284 - retVal, PR_GetError());
2285 + (long)retVal, (long)PR_GetError());
2288 printf("read: %d bytes, good\n", retVal);
2289 --- pr/tests/obsints.c.orig 2020-08-20 23:04:43 UTC
2290 +++ pr/tests/obsints.c
2291 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
2292 #else /* NO_NSPR_10_SUPPORT */
2294 #include "prtypes.h" /* which includes protypes.h */
2295 +#if !defined(__GNUC__)
2299 int main(int argc, char **argv)
2301 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
2302 * Compilation fails if any of these integer types are not
2303 * defined by protypes.h.
2317 + uintn uin __unused;
2320 + uint8 ui8 __unused;
2321 + int16 i16 __unused;
2322 + uint16 ui16 __unused;
2323 + int32 i32 __unused;
2324 + uint32 ui32 __unused;
2325 + int64 i64 __unused;
2326 + uint64 ui64 __unused;
2330 --- pr/tests/parsetm.c.orig 2020-08-20 23:04:43 UTC
2331 +++ pr/tests/parsetm.c
2332 @@ -32,8 +32,8 @@ static void PrintExplodedTime(const PREx
2334 /* Print day of the week, month, day, hour, minute, and second */
2335 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
2336 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
2337 - et->tm_hour, et->tm_min, et->tm_sec);
2338 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
2339 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
2341 /* Print time zone */
2342 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
2343 @@ -50,7 +50,7 @@ static void PrintExplodedTime(const PREx
2344 hourOffset = totalOffset / 3600;
2345 minOffset = (totalOffset % 3600) / 60;
2347 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
2348 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
2352 --- pr/tests/peek.c.orig 2020-08-20 23:04:43 UTC
2354 @@ -137,7 +137,7 @@ static void ClientNB(void *arg)
2357 PRSocketOptionData opt;
2358 - PRUint16 port = (PRUint16) arg;
2359 + PRUint16 port = (intptr_t) arg;
2361 char buf[BUFFER_SIZE];
2363 @@ -301,7 +301,7 @@ RunTest(PRThreadScope scope, PRFileDesc
2366 client = PR_CreateThread(
2367 - PR_USER_THREAD, ClientNB, (void *) port,
2368 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
2369 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2370 if (NULL == client) {
2371 fprintf(stderr, "PR_CreateThread failed\n");
2372 --- pr/tests/perf.c.orig 2020-08-20 23:04:43 UTC
2374 @@ -142,7 +142,7 @@ static void PR_CALLBACK CXReader(void *a
2376 for (i = 0; i < n; i++) {
2378 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
2379 + DPRINTF(("CXReader: thread = %p waiting\n",
2380 PR_GetCurrentThread()));
2381 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
2383 @@ -155,7 +155,7 @@ static void PR_CALLBACK CXReader(void *a
2386 PR_ExitMonitor(mon2);
2387 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2388 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
2391 static void PR_CALLBACK CXWriter(void *arg)
2392 @@ -166,7 +166,7 @@ static void PR_CALLBACK CXWriter(void *a
2394 for (i = 0; i < n; i++) {
2396 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
2397 + DPRINTF(("CXWriter: thread = %p waiting\n",
2398 PR_GetCurrentThread()));
2399 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
2401 @@ -179,7 +179,7 @@ static void PR_CALLBACK CXWriter(void *a
2404 PR_ExitMonitor(mon2);
2405 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2406 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
2409 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
2410 @@ -199,7 +199,7 @@ static void ContextSwitch(PRThreadScope
2412 fprintf(stderr, "ContextSwitch: cannot create thread\n");
2414 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
2415 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
2416 (scope1 == PR_GLOBAL_THREAD ?
2417 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2419 @@ -213,7 +213,7 @@ static void ContextSwitch(PRThreadScope
2421 fprintf(stderr, "ContextSwitch: cannot create thread\n");
2423 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
2424 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
2425 (scope2 == PR_GLOBAL_THREAD ?
2426 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2428 @@ -255,10 +255,10 @@ static void PR_CALLBACK SemaThread(void
2431 for (i = 0; i < n; i++) {
2432 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
2433 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
2434 PR_GetCurrentThread(), sem[0]));
2436 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
2437 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
2438 PR_GetCurrentThread(), sem[1]));
2441 @@ -267,7 +267,7 @@ static void PR_CALLBACK SemaThread(void
2444 PR_ExitMonitor(mon2);
2445 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2446 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
2449 static PRSemaphore *sem_set1[2];
2450 @@ -295,7 +295,7 @@ static void SemaContextSwitch(PRThreadSc
2452 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
2454 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
2455 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
2456 (scope1 == PR_GLOBAL_THREAD ?
2457 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2459 @@ -310,7 +310,7 @@ static void SemaContextSwitch(PRThreadSc
2461 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
2463 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
2464 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
2465 (scope2 == PR_GLOBAL_THREAD ?
2466 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2468 --- pr/tests/pipepong.c.orig 2020-08-20 23:04:43 UTC
2469 +++ pr/tests/pipepong.c
2470 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
2471 nBytes = fread(buf, 1, 5, stdin);
2472 fprintf(stderr, "pong process: received \"%s\"\n", buf);
2474 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
2475 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
2479 --- pr/tests/poll_nm.c.orig 2020-08-20 23:04:43 UTC
2480 +++ pr/tests/poll_nm.c
2481 @@ -47,7 +47,7 @@ PRIntn debug_mode;
2482 static void PR_CALLBACK
2483 clientThreadFunc(void *arg)
2485 - PRUintn port = (PRUintn) arg;
2486 + PRUintn port = (intptr_t) arg;
2490 @@ -200,7 +200,7 @@ int main(int argc, char **argv)
2493 clientThread = PR_CreateThread(PR_USER_THREAD,
2494 - clientThreadFunc, (void *) listenPort1,
2495 + clientThreadFunc, (void *)(intptr_t)listenPort1,
2496 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2497 PR_UNJOINABLE_THREAD, 0);
2498 if (clientThread == NULL) {
2499 @@ -210,7 +210,7 @@ int main(int argc, char **argv)
2502 clientThread = PR_CreateThread(PR_USER_THREAD,
2503 - clientThreadFunc, (void *) listenPort2,
2504 + clientThreadFunc, (void *)(intptr_t)listenPort2,
2505 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2506 PR_UNJOINABLE_THREAD, 0);
2507 if (clientThread == NULL) {
2508 --- pr/tests/prfz.c.orig 2020-08-20 23:04:43 UTC
2514 -#include <sys/types.h>
2515 +#include <stdint.h>
2519 --- pr/tests/provider.c.orig 2020-08-20 23:04:43 UTC
2520 +++ pr/tests/provider.c
2521 @@ -1078,7 +1078,7 @@ int main(int argc, char **argv)
2525 - CSClient_t *client;
2526 + CSClient_t *client = NULL;
2527 PRStatus rv, joinStatus;
2528 CSServer_t *server = NULL;
2530 --- pr/tests/prpoll.c.orig 2020-08-20 23:04:43 UTC
2531 +++ pr/tests/prpoll.c
2532 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
2534 clientThreadFunc(void *arg)
2536 - PRUint16 port = (PRUint16) arg;
2537 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2541 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
2544 struct sockaddr_in saddr;
2546 + socklen_t saddr_len;
2547 PRUint16 listenPort3;
2548 PRFileDesc *socket_poll_fd;
2550 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
2553 clientThread = PR_CreateThread(PR_USER_THREAD,
2554 - clientThreadFunc, (void *) listenPort1,
2555 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2556 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2557 PR_UNJOINABLE_THREAD, 0);
2558 if (clientThread == NULL) {
2559 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2562 clientThread = PR_CreateThread(PR_USER_THREAD,
2563 - clientThreadFunc, (void *) listenPort2,
2564 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2565 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2566 PR_UNJOINABLE_THREAD, 0);
2567 if (clientThread == NULL) {
2568 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2571 clientThread = PR_CreateThread(PR_USER_THREAD,
2572 - clientThreadFunc, (void *) listenPort3,
2573 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
2574 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2575 PR_UNJOINABLE_THREAD, 0);
2576 if (clientThread == NULL) {
2577 --- pr/tests/randseed.c.orig 2020-08-20 23:04:43 UTC
2578 +++ pr/tests/randseed.c
2579 @@ -48,7 +48,6 @@ static void Help( void )
2580 static void PrintRand( void *buf, PRIntn size )
2585 printf("%4.4d--\n", size );
2587 --- pr/tests/ranfile.c.orig 2020-08-20 23:04:43 UTC
2588 +++ pr/tests/ranfile.c
2589 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2590 PRStatus rv = PR_SUCCESS;
2591 Hammer_t *cd = (Hammer_t*)arg;
2593 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2594 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2597 printf("Starting work on %s\n", filename);
2598 @@ -405,8 +405,8 @@ int main(int argc, char **argv)
2599 durationTot += duration;
2601 else if (debug_mode) printf(
2602 - "%s: test failed %s after %ld seconds\n",
2603 - programName, where[hammer[poll].problem], duration);
2604 + "%s: test failed %s after %d seconds\n",
2605 + programName, where[hammer[poll].problem], (int)duration);
2609 @@ -414,7 +414,7 @@ int main(int argc, char **argv)
2612 if (debug_mode) printf(
2613 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2614 + "%s: [%d [%d] %d] writes/sec average\n",
2615 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2617 PR_DestroyCondVar(cv);
2618 --- pr/tests/runtests.sh.orig 2020-08-20 23:04:43 UTC
2619 +++ pr/tests/runtests.sh
2620 @@ -226,7 +226,7 @@ OBJDIR=`basename $PWD`
2621 printf "\nNSPR Test Results - $OBJDIR\n\n"
2622 printf "BEGIN\t\t\t`date`\n"
2623 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2624 -printf "Test\t\t\tResult\n\n"
2625 +printf " Test\t\t\tResult\n\n"
2626 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2629 @@ -244,10 +244,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2633 - printf "$prog (`date +%T`)"
2634 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2636 - ./$prog >> ${LOGFILE} 2>&1 &
2638 + ./$prog >> $prog.output 2>&1 &
2641 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2642 @@ -262,9 +260,9 @@ else
2643 printf "\t\t\tPassed\n";
2645 printf "\t\t\tFAILED\n";
2646 + sed "s,^, $prog: ," < $prog.output
2649 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2653 --- pr/tests/sel_spd.c.orig 2020-08-20 23:04:43 UTC
2654 +++ pr/tests/sel_spd.c
2659 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2660 +# include <unistd.h> /* getopt(3) */
2664 #define PORT_INC_DO +100
2666 #define PORT_BASE 19000 PORT_INC_DO PORT_INC_3264
2668 typedef struct timer_slot_t {
2669 - unsigned long d_connect;
2670 - unsigned long d_cl_data;
2671 - unsigned long d_sv_data;
2672 - unsigned long d_close;
2673 - unsigned long d_total;
2674 - unsigned long requests;
2675 + unsigned int d_connect;
2676 + unsigned int d_cl_data;
2677 + unsigned int d_sv_data;
2678 + unsigned int d_close;
2679 + unsigned int d_total;
2680 + unsigned int requests;
2683 -static long _iterations = 5;
2684 -static long _client_data = 8192;
2685 +static int _iterations = 5;
2686 +static int _client_data = 8192;
2688 -static long _server_data = (128*1024);
2689 -static long _threads_max = 10, _threads = 10;
2690 +static int _server_data = (128*1024);
2691 +static int _threads_max = 10, _threads = 10;
2693 static int verbose=0;
2694 static PRMonitor *exit_cv;
2695 @@ -98,7 +101,7 @@ _server_thread(void *arg_id)
2697 void _client_thread(void *);
2698 int *id = (int *)arg_id;
2700 + PRFileDesc *sock = NULL;
2701 PRSocketOptionData sockopt;
2703 PRFileDesc * newsock;
2704 @@ -476,12 +479,12 @@ void
2705 tally_results(int verbose)
2708 - unsigned long tot_connect = 0;
2709 - unsigned long tot_cl_data = 0;
2710 - unsigned long tot_sv_data = 0;
2711 - unsigned long tot_close = 0;
2712 - unsigned long tot_all = 0;
2713 - unsigned long tot_requests = 0;
2714 + unsigned int tot_connect = 0;
2715 + unsigned int tot_cl_data = 0;
2716 + unsigned int tot_sv_data = 0;
2717 + unsigned int tot_close = 0;
2718 + unsigned int tot_all = 0;
2719 + unsigned int tot_requests = 0;
2721 fprintf(stdout, "Server results:\n\n");
2722 for (index=0; index<_threads_max*2; index+=2) {
2723 --- pr/tests/selct_nm.c.orig 2020-08-20 23:04:43 UTC
2724 +++ pr/tests/selct_nm.c
2725 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2727 clientThreadFunc(void *arg)
2729 - PRUintn port = (PRUintn) arg;
2730 + PRUintn port = (PRUintn)(uintptr_t)arg;
2734 @@ -169,7 +169,7 @@ int main(int argc, char **argv)
2737 clientThread = PR_CreateThread(PR_USER_THREAD,
2738 - clientThreadFunc, (void *) listenPort1,
2739 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2740 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2741 PR_UNJOINABLE_THREAD, 0);
2742 if (clientThread == NULL) {
2743 @@ -179,7 +179,7 @@ int main(int argc, char **argv)
2746 clientThread = PR_CreateThread(PR_USER_THREAD,
2747 - clientThreadFunc, (void *) listenPort2,
2748 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2749 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2750 PR_UNJOINABLE_THREAD, 0);
2751 if (clientThread == NULL) {
2752 --- pr/tests/select2.c.orig 2020-08-20 23:04:43 UTC
2753 +++ pr/tests/select2.c
2754 @@ -53,6 +53,7 @@ PRInt32 count;
2756 ***********************************************************************/
2758 +static int exitcode = 2;
2760 static void Test_Result (int result)
2762 @@ -60,9 +61,13 @@ static void Test_Result (int result)
2766 + if (exitcode == 2) {
2775 printf ("NOSTATUS\n");
2776 @@ -382,4 +387,5 @@ int main(int argc, char **argv)
2782 --- pr/tests/semaerr.c.orig 2020-08-20 23:04:43 UTC
2783 +++ pr/tests/semaerr.c
2784 @@ -72,7 +72,7 @@ int main(int argc, char **argv)
2787 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2788 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2789 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2790 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2793 --- pr/tests/semaerr1.c.orig 2020-08-20 23:04:43 UTC
2794 +++ pr/tests/semaerr1.c
2795 @@ -83,7 +83,7 @@ int main(int argc, char **argv)
2798 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2799 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2800 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2804 --- pr/tests/sendzlf.c.orig 2020-08-20 23:04:43 UTC
2805 +++ pr/tests/sendzlf.c
2806 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2810 - PRUint16 port = (PRUint16) arg;
2811 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2815 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2818 clientThread = PR_CreateThread(PR_USER_THREAD,
2819 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2820 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2821 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2822 if (NULL == clientThread) {
2823 fprintf(stderr, "PR_CreateThread failed\n");
2824 --- pr/tests/server_test.c.orig 2020-08-20 23:04:43 UTC
2825 +++ pr/tests/server_test.c
2826 @@ -61,7 +61,7 @@ PRCondVar *ServerStateCV;
2828 #define DPRINTF printf
2831 +#define DPRINTF(...)
2835 @@ -582,6 +582,7 @@ static void do_workUU(void)
2840 static void do_workUK(void)
2842 ServerScope = PR_LOCAL_THREAD;
2843 @@ -602,6 +603,7 @@ static void do_workKK(void)
2844 ClientScope = PR_GLOBAL_THREAD;
2850 static void Measure(void (*func)(void), const char *msg)
2851 --- pr/tests/servr_kk.c.orig 2020-08-20 23:04:43 UTC
2852 +++ pr/tests/servr_kk.c
2853 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2855 #define DPRINTF printf
2858 +#define DPRINTF(...)
2861 PRIntn failed_already=0;
2862 @@ -539,6 +539,7 @@ void do_work()
2863 PR_JoinThread(ServerThread);
2867 static void do_workUU(void)
2869 ServerScope = PR_LOCAL_THREAD;
2870 @@ -559,6 +560,7 @@ static void do_workKU(void)
2871 ClientScope = PR_LOCAL_THREAD;
2876 static void do_workKK(void)
2878 --- pr/tests/servr_ku.c.orig 2020-08-20 23:04:43 UTC
2879 +++ pr/tests/servr_ku.c
2880 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2882 #define DPRINTF printf
2885 +#define DPRINTF(...)
2888 PRIntn failed_already=0;
2889 --- pr/tests/servr_uk.c.orig 2020-08-20 23:04:43 UTC
2890 +++ pr/tests/servr_uk.c
2891 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2893 #define DPRINTF printf
2896 +#define DPRINTF(...)
2899 PRIntn failed_already=0;
2900 --- pr/tests/servr_uu.c.orig 2020-08-20 23:04:43 UTC
2901 +++ pr/tests/servr_uu.c
2902 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2904 #define DPRINTF printf
2907 +#define DPRINTF(...)
2910 PRIntn failed_already=0;
2911 --- pr/tests/short_thread.c.orig 2020-08-20 23:04:43 UTC
2912 +++ pr/tests/short_thread.c
2913 @@ -45,7 +45,7 @@ int main (int argc, char **argv)
2914 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2917 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2918 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2919 PR_GetError(), PR_GetOSError());
2922 --- pr/tests/socket.c.orig 2020-08-20 23:04:43 UTC
2923 +++ pr/tests/socket.c
2924 @@ -173,7 +173,9 @@ readn(PRFileDesc *sockfd, char *buf, int
2931 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2933 if (test_cancelio) {
2934 @@ -181,12 +183,14 @@ readn(PRFileDesc *sockfd, char *buf, int
2937 for (rem=len; rem; offset += bytes, rem -= bytes) {
2938 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2939 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2940 PR_GetCurrentThread(), rem));
2944 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2946 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2947 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2948 PR_GetCurrentThread(), bytes));
2951 @@ -218,11 +222,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2954 for (rem=len; rem; offset += bytes, rem -= bytes) {
2955 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2956 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2957 PR_GetCurrentThread(), rem));
2958 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2959 PR_INTERVAL_NO_TIMEOUT);
2960 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2961 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2962 PR_GetCurrentThread(), bytes));
2965 @@ -272,7 +276,7 @@ Serve_Client(void *arg)
2966 if (PR_Shutdown(sockfd, PR_SHUTDOWN_RCV) < 0) {
2967 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2969 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2970 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2971 (*((int *) in_buf->data))));
2972 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2973 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2974 @@ -414,7 +418,7 @@ TCP_Server(void *arg)
2978 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2979 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2980 netaddr.inet.ip, netaddr.inet.port));
2981 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2982 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2983 @@ -466,7 +470,7 @@ TCP_Server(void *arg)
2987 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2988 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2992 @@ -482,7 +486,7 @@ exit:
2993 --(*sp->exit_counter);
2994 PR_Notify(sp->exit_mon);
2995 PR_ExitMonitor(sp->exit_mon);
2996 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2997 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
3001 @@ -541,7 +545,7 @@ UDP_Server(void *arg)
3005 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3006 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3007 netaddr.inet.ip, netaddr.inet.port));
3009 * We can't use the IP address returned by PR_GetSockName in
3010 @@ -579,13 +583,13 @@ UDP_Server(void *arg)
3012 memset(&netaddr, 0, sizeof(netaddr));
3013 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
3014 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
3015 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
3016 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
3019 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
3020 PR_INTERVAL_NO_TIMEOUT);
3021 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
3022 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
3023 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
3026 @@ -608,7 +612,7 @@ UDP_Server(void *arg)
3027 --(*sp->exit_counter);
3028 PR_Notify(sp->exit_mon);
3029 PR_ExitMonitor(sp->exit_mon);
3030 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
3031 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
3035 @@ -652,7 +656,7 @@ TCP_Client(void *arg)
3037 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3038 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3039 - PR_GetError(), PR_GetOSError());
3040 + (long)PR_GetError(), (long)PR_GetOSError());
3044 @@ -660,7 +664,7 @@ TCP_Client(void *arg)
3046 * fill in random data
3048 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3049 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3053 @@ -674,7 +678,7 @@ TCP_Client(void *arg)
3057 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
3058 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
3059 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
3060 if (readn(sockfd, in_buf->data, bytes) < bytes) {
3061 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
3062 @@ -711,7 +715,7 @@ TCP_Client(void *arg)
3063 --(*cp->exit_counter);
3064 PR_Notify(cp->exit_mon);
3065 PR_ExitMonitor(cp->exit_mon);
3066 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
3067 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
3071 @@ -775,7 +779,7 @@ UDP_Client(void *arg)
3075 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3076 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3077 netaddr.inet.ip, netaddr.inet.port));
3079 netaddr = cp->server_addr;
3080 @@ -792,9 +796,9 @@ UDP_Client(void *arg)
3082 * fill in random data
3084 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
3085 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
3086 PR_GetCurrentThread(), out_buf->data, bytes));
3087 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
3088 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
3092 @@ -807,7 +811,7 @@ UDP_Client(void *arg)
3096 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
3097 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
3098 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
3099 if (cp->udp_connect)
3100 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
3101 @@ -818,7 +822,7 @@ UDP_Client(void *arg)
3105 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
3106 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
3107 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
3109 * verify the data read
3110 @@ -843,7 +847,7 @@ UDP_Client(void *arg)
3111 PR_Notify(cp->exit_mon);
3112 PR_ExitMonitor(cp->exit_mon);
3114 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
3115 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
3119 @@ -910,7 +914,7 @@ TCP_Socket_Client_Server_Test(void)
3123 - DPRINTF(("Created TCP server = 0x%lx\n", t));
3124 + DPRINTF(("Created TCP server = %p\n", t));
3128 @@ -944,7 +948,7 @@ TCP_Socket_Client_Server_Test(void)
3132 - DPRINTF(("Created TCP client = 0x%lx\n", t));
3133 + DPRINTF(("Created TCP client = %p\n", t));
3136 /* Wait for server and client threads to exit */
3137 @@ -954,9 +958,9 @@ TCP_Socket_Client_Server_Test(void)
3139 PR_ExitMonitor(mon2);
3140 printf("%30s","TCP_Socket_Client_Server_Test:");
3141 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3142 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3143 num_tcp_clients, num_tcp_connections_per_client);
3144 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3145 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3146 num_tcp_mesgs_per_connection, tcp_mesg_size);
3149 @@ -1081,8 +1085,8 @@ UDP_Socket_Client_Server_Test(void)
3151 PR_ExitMonitor(mon2);
3152 printf("%30s","UDP_Socket_Client_Server_Test: ");
3153 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
3154 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
3155 + printf(" 1 Server %2d Clients\n", num_udp_clients);
3156 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
3157 num_udp_datagrams_per_client, udp_datagram_size);
3160 @@ -1438,7 +1442,7 @@ TransmitFile_Client(void *arg)
3161 --(*cp->exit_counter);
3162 PR_Notify(cp->exit_mon);
3163 PR_ExitMonitor(cp->exit_mon);
3164 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
3165 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
3169 @@ -1481,7 +1485,7 @@ Serve_TransmitFile_Client(void *arg)
3170 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
3172 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
3173 - PR_GetError(), PR_GetOSError());
3174 + (long)PR_GetError(), (long)PR_GetOSError());
3177 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
3178 @@ -1489,7 +1493,7 @@ Serve_TransmitFile_Client(void *arg)
3179 if (bytes != LARGE_FILE_SIZE) {
3181 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
3182 - PR_GetError(), PR_GetOSError());
3183 + (long)PR_GetError(), (long)PR_GetOSError());
3187 @@ -1517,7 +1521,7 @@ Serve_TransmitFile_Client(void *arg)
3190 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3191 - PR_GetError(), PR_GetOSError());
3192 + (long)PR_GetError(), (long)PR_GetOSError());
3196 @@ -1541,7 +1545,7 @@ Serve_TransmitFile_Client(void *arg)
3199 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3200 - PR_GetError(), PR_GetOSError());
3201 + (long)PR_GetError(), (long)PR_GetOSError());
3205 @@ -1563,7 +1567,7 @@ Serve_TransmitFile_Client(void *arg)
3208 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3209 - PR_GetError(), PR_GetOSError());
3210 + (long)PR_GetError(), (long)PR_GetOSError());
3214 @@ -1585,7 +1589,7 @@ Serve_TransmitFile_Client(void *arg)
3217 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3218 - PR_GetError(), PR_GetOSError());
3219 + (long)PR_GetError(), (long)PR_GetOSError());
3223 @@ -1607,7 +1611,7 @@ Serve_TransmitFile_Client(void *arg)
3226 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3227 - PR_GetError(), PR_GetOSError());
3228 + (long)PR_GetError(), (long)PR_GetOSError());
3232 @@ -1629,7 +1633,7 @@ Serve_TransmitFile_Client(void *arg)
3235 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3236 - PR_GetError(), PR_GetOSError());
3237 + (long)PR_GetError(), (long)PR_GetOSError());
3241 @@ -1651,7 +1655,7 @@ Serve_TransmitFile_Client(void *arg)
3244 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3245 - PR_GetError(), PR_GetOSError());
3246 + (long)PR_GetError(), (long)PR_GetOSError());
3250 @@ -1675,7 +1679,7 @@ Serve_TransmitFile_Client(void *arg)
3253 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3254 - PR_GetError(), PR_GetOSError());
3255 + (long)PR_GetError(), (long)PR_GetOSError());
3259 @@ -1752,7 +1756,7 @@ TransmitFile_Server(void *arg)
3263 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3264 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3265 netaddr.inet.ip, netaddr.inet.port));
3266 tcp_server_addr.inet.family = netaddr.inet.family;
3267 tcp_server_addr.inet.port = netaddr.inet.port;
3268 @@ -1818,7 +1822,7 @@ TransmitFile_Server(void *arg)
3272 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
3273 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
3277 @@ -1846,7 +1850,7 @@ exit:
3278 --(*sp->exit_counter);
3279 PR_Notify(sp->exit_mon);
3280 PR_ExitMonitor(sp->exit_mon);
3281 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
3282 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
3286 @@ -1986,7 +1990,7 @@ Socket_Misc_Test(void)
3288 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
3290 - PR_GetError(), PR_GetOSError());
3291 + (long)PR_GetError(), (long)PR_GetOSError());
3295 @@ -2076,7 +2080,7 @@ Socket_Misc_Test(void)
3299 - DPRINTF(("Created TCP server = 0x%x\n", t));
3300 + DPRINTF(("Created TCP server = %p\n", t));
3304 @@ -2113,7 +2117,7 @@ Socket_Misc_Test(void)
3308 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
3309 + DPRINTF(("Created TransmitFile client = %p\n", t));
3312 /* Wait for server and client threads to exit */
3313 @@ -2144,7 +2148,7 @@ done:
3315 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
3316 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
3317 - TEST_DIR, PR_GetError(), PR_GetOSError());
3318 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
3322 --- pr/tests/sprintf.c.orig 2020-08-20 23:04:43 UTC
3323 +++ pr/tests/sprintf.c
3324 @@ -133,7 +133,7 @@ static void test_l(char *pattern, char *
3325 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
3327 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
3328 - pattern, l, s, buf, sbuf);
3329 + pattern, (long)l, s, buf, sbuf);
3330 PR_smprintf_free(s);
3333 --- pr/tests/stack.c.orig 2020-08-20 23:04:43 UTC
3334 +++ pr/tests/stack.c
3335 @@ -53,7 +53,7 @@ PRFileDesc *errhandle;
3337 int main(int argc, char **argv)
3339 - PRInt32 rv, cnt, sum;
3342 PRStack *list1, *list2;
3344 @@ -211,7 +211,7 @@ int main(int argc, char **argv)
3345 static void stackop(void *thread_arg)
3347 PRInt32 val, cnt, index, loops;
3348 - DataRecord *Items, *Item;
3349 + DataRecord *Items;
3350 PRStack *list1, *list2;
3352 stack_data *arg = (stack_data *) thread_arg;
3353 --- pr/tests/suspend.c.orig 2020-08-20 23:04:43 UTC
3354 +++ pr/tests/suspend.c
3355 @@ -21,14 +21,14 @@ void PR_CALLBACK
3356 Level_2_Thread(void *arg)
3358 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
3359 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3360 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
3365 Level_1_Thread(void *arg)
3367 - PRUint32 tmp = (PRUint32)arg;
3368 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
3369 PRThreadScope scope = (PRThreadScope) tmp;
3372 @@ -43,7 +43,7 @@ Level_1_Thread(void *arg)
3374 printf("Could not create thread!\n");
3376 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
3377 + printf("Level_1_Thread[%p] created %15s thread %p\n",
3378 PR_GetCurrentThread(),
3379 (scope == PR_GLOBAL_THREAD) ?
3380 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3381 @@ -54,7 +54,7 @@ Level_1_Thread(void *arg)
3384 PR_ExitMonitor(mon);
3385 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3386 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
3389 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
3390 @@ -63,14 +63,15 @@ static PRStatus PR_CALLBACK print_thread
3394 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
3395 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
3396 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
3397 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
3398 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
3400 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3401 - registers[0],registers[1],registers[2],registers[3]);
3402 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
3403 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3404 + (unsigned long)registers[0], (unsigned long)registers[1],
3405 + (unsigned long)registers[2], (unsigned long)registers[3]);
3406 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
3410 @@ -98,7 +99,7 @@ static void Level_0_Thread(PRThreadScope
3411 printf("Could not create thread!\n");
3414 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
3415 + printf("Level_0_Thread[%p] created %15s thread %p\n",
3416 PR_GetCurrentThread(),
3417 (scope1 == PR_GLOBAL_THREAD) ?
3418 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3419 @@ -110,9 +111,10 @@ static void Level_0_Thread(PRThreadScope
3420 PR_EnumerateThreads(print_thread, NULL);
3421 registers = PR_GetGCRegisters(me, 1, (int *)&words);
3423 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3424 - registers[0],registers[1],registers[2],registers[3]);
3425 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
3426 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3427 + (unsigned long)registers[0], (unsigned long)registers[1],
3428 + (unsigned long)registers[2], (unsigned long)registers[3]);
3429 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
3432 /* Wait for all threads to exit */
3433 --- pr/tests/switch.c.orig 2020-08-20 23:04:43 UTC
3434 +++ pr/tests/switch.c
3435 @@ -83,7 +83,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
3437 PRBool help = PR_FALSE;
3438 PRUintn concurrency = 1;
3439 - Shared *shared, *link;
3440 + Shared *shared = NULL, *link;
3441 PRIntervalTime timein, timeout;
3442 PRThreadScope thread_scope = PR_LOCAL_THREAD;
3443 PRUintn thread_count, inner_count, loop_count, average;
3444 --- pr/tests/testfile.c.orig 2020-08-20 23:04:43 UTC
3445 +++ pr/tests/testfile.c
3446 @@ -33,6 +33,9 @@ static int _debug_on = 0;
3450 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
3451 +# include <unistd.h> /* getopt(3) */
3454 #define DPRINTF(arg) if (_debug_on) printf arg
3456 @@ -86,7 +89,7 @@ static PRInt32 PR_CALLBACK DirTest(void
3457 PRInt32 dirtest_failed = 0;
3459 PRThread* create_new_thread(PRThreadType type,
3460 - void (*start)(void *arg),
3461 + void *(*start)(void *arg),
3463 PRThreadPriority priority,
3464 PRThreadScope scope,
3465 @@ -151,7 +154,7 @@ PRThread* create_new_thread(PRThreadType
3466 return((PRThread *) thandle);
3469 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3470 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
3473 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3474 @@ -312,8 +315,8 @@ static PRInt32 Misc_File_Tests(char *pat
3476 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3478 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3479 - file_info1.creationTime);
3480 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3481 + (long long)file_info1.creationTime);
3485 @@ -338,8 +341,8 @@ static PRInt32 Misc_File_Tests(char *pat
3487 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3489 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3490 - file_info1.modifyTime);
3491 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3492 + (long long)file_info1.modifyTime);
3496 @@ -465,7 +468,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3497 memset(fparamp->buf, i, len);
3499 t = create_new_thread(PR_USER_THREAD,
3500 - File_Write, (void *)fparamp,
3501 + (void *(*)(void *))File_Write, (void *)fparamp,
3504 PR_UNJOINABLE_THREAD,
3505 @@ -500,7 +503,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3508 t = create_new_thread(PR_USER_THREAD,
3509 - File_Read, (void *)fparamp,
3510 + (void *(*)(void *))File_Read, (void *)fparamp,
3513 PR_UNJOINABLE_THREAD,
3514 @@ -569,7 +572,7 @@ static PRInt32 RunDirTest(void)
3517 t = create_new_thread(PR_USER_THREAD,
3519 + (void *(*)(void *))DirTest, &thrarg,
3522 PR_UNJOINABLE_THREAD,
3523 @@ -893,8 +896,6 @@ int main(int argc, char **argv)
3525 #if defined(XP_UNIX) || defined(XP_OS2)
3527 - extern char *optarg;
3528 - extern int optind;
3530 #if defined(XP_UNIX) || defined(XP_OS2)
3531 while ((opt = getopt(argc, argv, "d")) != EOF) {
3532 --- pr/tests/threads.c.orig 2020-08-20 23:04:43 UTC
3533 +++ pr/tests/threads.c
3534 @@ -27,7 +27,7 @@ void
3536 DumbThread(void *arg)
3538 - PRInt32 tmp = (PRInt32)arg;
3539 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3540 PRThreadScope scope = (PRThreadScope)tmp;
3543 @@ -173,10 +173,10 @@ int main(int argc, char **argv)
3548 -** Tests lots of thread creations. \n\
3549 -** Create %ld native threads %ld times. \n\
3550 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3551 + printf("** Tests lots of thread creations.\n"
3552 + "** Create %d native threads %d times.\n"
3553 + "** Create %d user threads %d times.\n", iterations, count,
3554 + iterations, count);
3557 for (index=0; index<iterations; index++) {
3558 --- pr/tests/thrpool_client.c.orig 2020-08-20 23:04:43 UTC
3559 +++ pr/tests/thrpool_client.c
3560 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3561 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3563 for (rem=len; rem; offset += bytes, rem -= bytes) {
3564 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3565 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3566 PR_GetCurrentThread(), rem));
3567 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3569 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3570 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3571 PR_GetCurrentThread(), bytes));
3574 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3577 for (rem=len; rem; offset += bytes, rem -= bytes) {
3578 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3579 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3580 PR_GetCurrentThread(), rem));
3581 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3582 PR_INTERVAL_NO_TIMEOUT);
3583 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3584 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3585 PR_GetCurrentThread(), bytes));
3588 @@ -165,7 +165,7 @@ TCP_Client(void *arg)
3590 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3591 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3592 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3593 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3594 PR_GetError(), PR_GetOSError());
3597 @@ -174,7 +174,7 @@ TCP_Client(void *arg)
3599 * fill in random data
3601 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3602 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3606 @@ -282,7 +282,7 @@ TCP_Socket_Client_Server_Test(void)
3607 PR_EnterMonitor(mon2);
3609 PR_ExitMonitor(mon2);
3610 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3611 + DPRINTF(("Created TCP client = %p\n", thr));
3613 /* Wait for client jobs to exit */
3614 PR_EnterMonitor(mon2);
3615 @@ -292,9 +292,9 @@ TCP_Socket_Client_Server_Test(void)
3617 PR_ExitMonitor(mon2);
3618 printf("%30s","TCP_Socket_Client_Server_Test:");
3619 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3620 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3621 num_tcp_clients, num_tcp_connections_per_client);
3622 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3623 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3624 num_tcp_mesgs_per_connection, tcp_mesg_size);
3627 --- pr/tests/thrpool_server.c.orig 2020-08-20 23:04:43 UTC
3628 +++ pr/tests/thrpool_server.c
3629 @@ -330,7 +330,7 @@ TCP_Server(void *arg)
3633 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3634 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3635 netaddr.inet.ip, netaddr.inet.port));
3637 sp = PR_NEW(Server_Param);
3638 @@ -342,7 +342,7 @@ TCP_Server(void *arg)
3639 sp->iod.socket = sockfd;
3640 sp->iod.timeout = PR_SecondsToInterval(60);
3641 sp->datalen = tcp_mesg_size;
3642 - sp->exit_mon = sc_mon;
3643 + sp->exit_mon = NULL;
3644 sp->job_counterp = &job_counter;
3645 sp->conn_counter = 0;
3647 @@ -465,7 +465,7 @@ TCP_Server_Accept(void *arg)
3650 PR_ASSERT(NULL != jobp);
3651 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3652 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3655 * single-threaded update; no lock needed
3656 @@ -482,7 +482,7 @@ TCP_Server_Accept(void *arg)
3657 print_stats, sp, PR_FALSE);
3659 PR_ASSERT(NULL != jobp);
3660 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3661 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3664 PR_EnterMonitor(sp->exit_mon);
3665 @@ -499,9 +499,9 @@ exit:
3667 PR_DestroyMonitor(sp->exit_mon);
3668 printf("%30s","TCP_Socket_Client_Server_Test:");
3669 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3670 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3671 num_tcp_clients, num_tcp_connections_per_client);
3672 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3673 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3674 num_tcp_mesgs_per_connection, tcp_mesg_size);
3676 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3677 --- pr/tests/thruput.c.orig 2020-08-20 23:04:43 UTC
3678 +++ pr/tests/thruput.c
3679 @@ -82,7 +82,7 @@ static void PR_CALLBACK Clientel(void *a
3683 - PRInt32 bytes, sampled;
3684 + PRInt32 bytes, sampled = -1;
3685 PRIntervalTime now, interval;
3686 PRBool do_display = PR_FALSE;
3687 Shared *shared = (Shared*)arg;
3688 @@ -196,7 +196,7 @@ static void Client(const char *server_na
3690 static void PR_CALLBACK Servette(void *arg)
3692 - PRInt32 bytes, sampled;
3693 + PRInt32 bytes, sampled = -1;
3694 PRIntervalTime now, interval;
3695 PRBool do_display = PR_FALSE;
3696 PRFileDesc *client = (PRFileDesc*)arg;
3697 @@ -408,6 +408,7 @@ int main(int argc, char **argv)
3705 --- pr/tests/timemac.c.orig 2020-08-20 23:04:43 UTC
3706 +++ pr/tests/timemac.c
3707 @@ -25,7 +25,7 @@ static void printExplodedTime(const PREx
3710 /* Print day of the week, month, day, hour, minute, and second */
3711 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3712 + printf( "%s %s %d %02d:%02d:%02d ",
3713 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3714 et->tm_hour, et->tm_min, et->tm_sec);
3716 @@ -41,7 +41,7 @@ static void printExplodedTime(const PREx
3718 hourOffset = totalOffset / 3600;
3719 minOffset = (totalOffset % 3600) / 60;
3720 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3721 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3725 @@ -98,7 +98,7 @@ int main(int argc, char** argv)
3726 printf("Current local time is ");
3727 printExplodedTime(&et);
3729 - printf("GMT offset is %ld, DST offset is %ld\n",
3730 + printf("GMT offset is %d, DST offset is %d\n",
3731 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3732 t2 = PR_ImplodeTime(&et);
3733 if (LL_NE(t1, t2)) {
3734 --- pr/tests/timetest.c.orig 2020-08-20 23:04:43 UTC
3735 +++ pr/tests/timetest.c
3736 @@ -37,7 +37,7 @@ static void PrintExplodedTime(const PREx
3739 /* Print day of the week, month, day, hour, minute, and second */
3740 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3741 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3742 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3743 et->tm_hour, et->tm_min, et->tm_sec);
3745 @@ -56,7 +56,7 @@ static void PrintExplodedTime(const PREx
3746 hourOffset = totalOffset / 3600;
3747 minOffset = (totalOffset % 3600) / 60;
3749 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3750 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3754 @@ -262,7 +262,7 @@ int main(int argc, char** argv)
3758 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3759 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3760 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3761 t2 = PR_ImplodeTime(&et);
3762 if (LL_NE(t1, t2)) {
3763 --- pr/tests/y2k.c.orig 2020-08-20 23:04:43 UTC
3765 @@ -44,7 +44,7 @@ static void PrintExplodedTime(const PREx
3768 /* Print day of the week, month, day, hour, minute, and second */
3769 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3770 + printf("%s %s %2d %02d:%02d:%02d ",
3771 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3772 et->tm_hour, et->tm_min, et->tm_sec);
3774 @@ -63,7 +63,7 @@ static void PrintExplodedTime(const PREx
3776 hourOffset = totalOffset / 3600;
3777 minOffset = (totalOffset % 3600) / 60;
3778 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3779 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3781 #ifdef PRINT_DETAILS
3782 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3783 --- pr/tests/y2ktmo.c.orig 2020-08-20 23:04:43 UTC
3784 +++ pr/tests/y2ktmo.c
3785 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3787 static void SleepThread(void *arg)
3789 - PRIntervalTime timeout = (PRIntervalTime) arg;
3790 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3791 PRIntervalTime elapsed;
3792 #if defined(XP_UNIX) || defined(WIN32)
3793 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3794 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3796 static void AcceptThread(void *arg)
3798 - PRIntervalTime timeout = (PRIntervalTime) arg;
3799 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3800 PRIntervalTime elapsed;
3801 #if defined(XP_UNIX) || defined(WIN32)
3802 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3803 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3805 static void PollThread(void *arg)
3807 - PRIntervalTime timeout = (PRIntervalTime) arg;
3808 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3809 PRIntervalTime elapsed;
3810 #if defined(XP_UNIX) || defined(WIN32)
3811 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3812 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3814 static void WaitCondVarThread(void *arg)
3816 - PRIntervalTime timeout = (PRIntervalTime) arg;
3817 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3818 PRIntervalTime elapsed;
3819 #if defined(XP_UNIX) || defined(WIN32)
3820 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3821 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3823 static void WaitMonitorThread(void *arg)
3825 - PRIntervalTime timeout = (PRIntervalTime) arg;
3826 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3827 PRIntervalTime elapsed;
3828 #if defined(XP_UNIX) || defined(WIN32)
3829 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3830 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3832 static void WaitCMonitorThread(void *arg)
3834 - PRIntervalTime timeout = (PRIntervalTime) arg;
3835 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3836 PRIntervalTime elapsed;
3837 #if defined(XP_UNIX) || defined(WIN32)
3838 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3839 @@ -532,7 +532,7 @@ int main(int argc, char **argv)
3840 for (i = 0; i < num_thread_scopes; i++) {
3841 for (j = 0; j < num_thread_funcs; j++) {
3842 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3843 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3844 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3845 threadScopes[i], PR_JOINABLE_THREAD, 0);
3846 if (threads[idx] == NULL) {
3847 fprintf(stderr, "PR_CreateThread failed\n");
3848 --- pr/tests/zerolen.c.orig 2020-08-20 23:04:43 UTC
3849 +++ pr/tests/zerolen.c
3850 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3854 - PRUint16 port = (PRUint16) arg;
3855 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3859 @@ -124,7 +124,7 @@ int main()
3860 * First test PR_Writev.
3862 clientThread = PR_CreateThread(PR_USER_THREAD,
3863 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3864 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3865 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3866 if (NULL == clientThread) {
3867 fprintf(stderr, "PR_CreateThread failed\n");
3868 @@ -165,7 +165,7 @@ int main()
3869 * Then test PR_Write.
3871 clientThread = PR_CreateThread(PR_USER_THREAD,
3872 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3873 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3874 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3875 if (NULL == clientThread) {
3876 fprintf(stderr, "PR_CreateThread failed\n");
3877 @@ -204,7 +204,7 @@ int main()
3878 * Finally test PR_Send.
3880 clientThread = PR_CreateThread(PR_USER_THREAD,
3881 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3882 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3883 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3884 if (NULL == clientThread) {
3885 fprintf(stderr, "PR_CreateThread failed\n");
3888 [FILE:1546:patches/patch-warnings]
3889 --- pr/include/prcountr.h.orig 2020-08-20 23:04:43 UTC
3890 +++ pr/include/prcountr.h
3891 @@ -394,7 +394,7 @@ PR_SubtractFromCounter(
3892 #define PR_GET_COUNTER(counter,handle)\
3893 (counter) = PR_GetCounter((handle))
3895 -#define PR_GET_COUNTER(counter,handle) 0
3896 +#define PR_GET_COUNTER(counter,handle)
3900 @@ -468,7 +468,7 @@ PR_SetCounter(
3901 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3902 (next) = PR_FindNextCounterQname((handle))
3904 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3905 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3908 NSPR_API(PRCounterHandle)
3909 --- pr/src/misc/pralarm.c.orig 2020-08-20 23:04:43 UTC
3910 +++ pr/src/misc/pralarm.c
3911 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier
3913 while (why != abort)
3915 - PRIntervalTime pause;
3916 + PRIntervalTime pause = 0;
3918 PR_Lock(alarm->lock);
3920 --- pr/src/misc/prdtoa.c.orig 2020-08-20 23:04:43 UTC
3921 +++ pr/src/misc/prdtoa.c
3922 @@ -2896,9 +2896,9 @@ double dd; int mode, ndigits, *decpt, *s
3923 to hold the suppressed trailing zeros.
3926 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3927 - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3928 - spec_case, try_quick;
3929 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3930 + j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3931 + spec_case, try_quick;
3933 #ifndef Sudden_Underflow