1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
8 SDESC[standard]= Platform-neutral API for system-like functions
9 HOMEPAGE= https://firefox-source-docs.mozilla.org/nspr/index.html
13 SITES[main]= MOZILLA/nspr/releases/v4.35/src
14 DISTFILE[1]= nspr-4.35.tar.gz:main
16 SPKGS[standard]= complete
20 OPTIONS_AVAILABLE= none
21 OPTIONS_STANDARD= none
25 DISTNAME= nspr-4.35/nspr
28 LICENSE_TERMS= primary:{{WRKDIR}}/TERMS
29 LICENSE_FILE= MPL:{{WRKSRC}}/LICENSE
30 LICENSE_AWK= TERMS:"^$$"
31 LICENSE_SOURCE= TERMS:{{WRKSRC}}/pr/include/nspr.h
34 CPE_PRODUCT= netscape_portable_runtime
36 FPC_EQUIVALENT= devel/nspr
39 CONFIGURE_ARGS= --enable-64bit
42 # Do not install tools to build itself
43 ${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
44 ${WRKSRC}/pr/src/misc/Makefile.in
47 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.${LIBEXT}
49 [FILE:207:descriptions/desc.primary]
50 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
51 system level and libc like functions. The API is used in the Mozilla
52 client, many of Netscape/AOL/iPlanet's and other software offerings.
56 7ea3297ea5969b5d25a5dd8d47f2443cda88e9ee746301f6e1e1426f8a6abc8f 1096974 nspr-4.35.tar.gz
59 [FILE:74:manifests/plist.primary]
60 @(,,444) lib/libnspr4.so
61 @(,,444) lib/libplc4.so
62 @(,,444) lib/libplds4.so
65 [FILE:1050:manifests/plist.dev]
138 include/nspr/obsolete/
143 include/nspr/private/
147 @(,,444) lib/libnspr4.a
148 @(,,444) lib/libplc4.a
149 @(,,444) lib/libplds4.a
150 lib/pkgconfig/nspr.pc
151 share/aclocal/nspr.m4
154 [FILE:1192:patches/patch-bug301986]
155 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
156 Better to just keep calling it pthread_t isntead of casting to anything.
160 --- pr/include/private/pprthred.h.orig 2022-05-25 21:34:56 UTC
161 +++ pr/include/private/pprthred.h
166 +#include <pthread.h>
170 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
171 ** Get the id of the named thread. Each thread is assigned a unique id
172 ** when it is created or attached.
174 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
175 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
178 ** Set the procedure that is called when a thread is dumped. The procedure
179 --- pr/src/pthreads/ptthread.c.orig 2022-05-25 21:34:56 UTC
180 +++ pr/src/pthreads/ptthread.c
181 @@ -1183,9 +1183,9 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
185 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
186 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
188 - return (PRUint32)thred->id; /* and I don't know what they will do with it */
189 + return thred->id; /* and I don't know what they will do with it */
195 [FILE:489:patches/patch-config_nspr.pc.in]
196 --- config/nspr.pc.in.orig 2022-05-25 21:34:56 UTC
197 +++ config/nspr.pc.in
198 @@ -6,5 +6,5 @@ includedir=@includedir@
200 Description: The Netscape Portable Runtime
201 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
202 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
203 -Cflags: -I@includedir@
204 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
205 +Cflags: -I${includedir}
208 [FILE:2145:patches/patch-configure]
209 --- configure.orig 2022-09-12 11:40:15 UTC
211 @@ -6563,7 +6563,22 @@ tools are selected during the Xcode/Deve
217 + if test -z "$USE_NSPR_THREADS"; then
220 + $as_echo "#define XP_UNIX 1" >>confdefs.h
221 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
222 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
223 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
224 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
226 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
227 + MDCPUCFG_H=_dragonfly.cfg
228 + PR_MD_CSRCS=freebsd.c
231 +*-freebsd*|*-midnight*)
232 if test -z "$USE_NSPR_THREADS"; then
235 @@ -7232,7 +7247,6 @@ $as_echo "$as_me: WARNING: Unknown versi
237 MDCPUCFG_H=_solaris.cfg
238 PR_MD_CSRCS=solaris.c
240 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
241 RESOLVE_LINK_SYMBOLS=1
242 case "${OS_RELEASE}" in
243 @@ -7240,7 +7254,6 @@ $as_echo "$as_me: WARNING: Unknown versi
246 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
250 if test -n "$GNU_CC"; then
251 @@ -7936,7 +7949,7 @@ $as_echo_n "checking whether ${CC-cc} ac
252 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
253 ac_cv_have_dash_pthread=yes
256 + freebsd*|dragonfly*|midnight*)
257 # Freebsd doesn't use -pthread for compiles, it uses them for linking
260 @@ -7974,7 +7987,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
265 + *-freebsd*|*-dragonfly*|*-midnight*)
266 $as_echo "#define _REENTRANT 1" >>confdefs.h
268 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
269 @@ -8064,7 +8077,7 @@ case "$target" in
274 +*-freebsd*|*-dragonfly*|*-midnight*)
275 if test -n "$USE_NSPR_THREADS"; then
276 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
280 [FILE:29818:patches/patch-libtests]
281 --- lib/tests/arena.c.orig 2022-05-25 21:34:56 UTC
282 +++ lib/tests/arena.c
283 @@ -36,6 +36,7 @@ void DumpAll( void )
289 ** Test Arena allocation.
291 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
294 } /* end ArenaGrow() */
299 --- lib/tests/base64t.c.orig 2022-05-25 21:34:56 UTC
300 +++ lib/tests/base64t.c
301 @@ -2362,7 +2362,6 @@ PRBool test_008(void)
302 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
304 PRUint32 plen = PL_strlen(array[i].plaintext);
305 - PRUint32 clen = ((plen + 2)/3)*4;
307 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
309 @@ -3122,9 +3121,6 @@ PRBool test_024(void)
311 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
313 - PRUint32 plen = PL_strlen(array[i].plaintext);
314 - PRUint32 clen = ((plen + 2)/3)*4;
316 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
318 if( (char *)0 == rv )
319 @@ -3258,8 +3254,6 @@ PRBool test_027(void)
321 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
323 - PRUint32 clen = PL_strlen(array[i].cyphertext);
325 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
327 if( (char *)0 == rv )
328 --- lib/tests/string.c.orig 2022-05-25 21:34:56 UTC
329 +++ lib/tests/string.c
330 @@ -127,7 +127,7 @@ PRBool test_003(void)
331 rv = PL_strcpy(array[i].dest, array[i].str);
332 if( array[i].rv != rv )
334 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
335 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
336 array[i].str ? array[i].str : "(null)", rv);
339 @@ -240,8 +240,8 @@ PRBool test_004(void)
340 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
341 if( array[i].rv != rv )
343 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
344 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
345 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
346 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
350 @@ -367,8 +367,8 @@ PRBool test_005(void)
351 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
352 if( array[i].rv != rv )
354 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
355 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
356 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
357 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
361 @@ -421,7 +421,7 @@ PRBool test_006(void)
363 if( (char *)0 == rv )
365 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
366 + printf("FAIL %d: %p -> 0\n", i, array[i]);
370 @@ -507,8 +507,8 @@ PRBool test_007(void)
372 if( (char *)0 == rv )
374 - printf("FAIL %d: %s,%lu -> 0\n", i,
375 - array[i].str ? array[i].str : "(null)", array[i].len);
376 + printf("FAIL %d: %s,%u -> 0\n", i,
377 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
381 @@ -700,10 +700,10 @@ PRBool test_009(void)
383 if( (char *)0 != rv )
385 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
386 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
387 array[i].first ? array[i].first : "(null)",
388 array[i].second ? array[i].second : "(null)",
389 - array[i].length, rv);
390 + (unsigned)array[i].length, rv);
394 @@ -711,10 +711,10 @@ PRBool test_009(void)
396 if( (char *)0 == rv )
398 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
399 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
400 array[i].first ? array[i].first : "(null)",
401 array[i].second ? array[i].second : "(null)",
402 - array[i].length, array[i].result);
403 + (unsigned)array[i].length, array[i].result);
407 @@ -726,10 +726,10 @@ PRBool test_009(void)
411 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
412 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
413 array[i].first ? array[i].first : "(null)",
414 array[i].second ? array[i].second : "(null)",
415 - array[i].length, rv, array[i].result);
416 + (unsigned)array[i].length, rv, array[i].result);
420 @@ -741,10 +741,10 @@ PRBool test_009(void)
424 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
425 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
426 array[i].first ? array[i].first : "(null)",
427 array[i].second ? array[i].second : "(null)",
429 + (unsigned)array[i].length);
433 @@ -752,10 +752,10 @@ PRBool test_009(void)
437 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
438 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
439 array[i].first ? array[i].first : "(null)",
440 array[i].second ? array[i].second : "(null)",
442 + (unsigned)array[i].length);
446 @@ -832,10 +832,10 @@ PRBool test_010(void)
448 if( (char *)0 != rv )
450 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
451 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
452 array[i].first ? array[i].first : "(null)",
453 array[i].second ? array[i].second : "(null)",
454 - array[i].length, rv);
455 + (unsigned)array[i].length, rv);
459 @@ -843,10 +843,10 @@ PRBool test_010(void)
461 if( (char *)0 == rv )
463 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
464 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
465 array[i].first ? array[i].first : "(null)",
466 array[i].second ? array[i].second : "(null)",
467 - array[i].length, array[i].result);
468 + (unsigned)array[i].length, array[i].result);
472 @@ -858,10 +858,10 @@ PRBool test_010(void)
476 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
477 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
478 array[i].first ? array[i].first : "(null)",
479 array[i].second ? array[i].second : "(null)",
480 - array[i].length, rv, array[i].result);
481 + (unsigned)array[i].length, rv, array[i].result);
485 @@ -1104,10 +1104,10 @@ PRBool test_012(void)
489 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
490 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
491 array[i].one ? array[i].one : "(null)",
492 array[i].two ? array[i].two : "(null)",
493 - array[i].max, rv, array[i].sign);
494 + (int)array[i].max, rv, array[i].sign);
498 @@ -1338,10 +1338,10 @@ PRBool test_014(void)
502 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
503 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
504 array[i].one ? array[i].one : "(null)",
505 array[i].two ? array[i].two : "(null)",
506 - array[i].max, rv, array[i].sign);
507 + (int)array[i].max, rv, array[i].sign);
511 @@ -1411,15 +1411,15 @@ PRBool test_015(void)
513 if( (char *)0 == rv )
515 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
516 - array[i].chr, array[i].off);
517 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
518 + array[i].chr, (unsigned)array[i].off);
522 if( &array[i].str[ array[i].off ] != rv )
524 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
525 - array[i].chr, rv, array[i].str, array[i].off);
526 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
527 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
531 @@ -1491,15 +1491,15 @@ PRBool test_016(void)
533 if( (char *)0 == rv )
535 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
536 - array[i].chr, array[i].off);
537 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
538 + array[i].chr, (unsigned)array[i].off);
542 if( &array[i].str[ array[i].off ] != rv )
544 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
545 - array[i].chr, rv, array[i].str, array[i].off);
546 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
547 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
551 @@ -1566,8 +1566,8 @@ PRBool test_017(void)
553 if( (char *)0 != rv )
555 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
556 - array[i].chr, array[i].max, rv);
557 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
558 + array[i].chr, (unsigned)array[i].max, rv);
562 @@ -1575,15 +1575,15 @@ PRBool test_017(void)
564 if( (char *)0 == rv )
566 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
567 - array[i].chr, array[i].max, array[i].off);
568 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
569 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
573 if( &array[i].str[ array[i].off ] != rv )
575 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
576 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
577 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
578 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
582 @@ -1650,8 +1650,8 @@ PRBool test_018(void)
584 if( (char *)0 != rv )
586 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
587 - array[i].chr, array[i].max, rv);
588 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
589 + array[i].chr, (unsigned)array[i].max, rv);
593 @@ -1659,15 +1659,15 @@ PRBool test_018(void)
595 if( (char *)0 == rv )
597 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
598 - array[i].chr, array[i].max, array[i].off);
599 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
600 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
604 - if( &array[i].str[ array[i].off ] != rv )
605 + if( &array[i].str[ array[i].off ] != rv)
607 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
608 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
609 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
610 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
614 @@ -1746,19 +1746,19 @@ PRBool test_019(void)
616 if( (char *)0 == rv )
618 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
619 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
620 array[i].str ? array[i].str : "(null)",
621 array[i].chrs ? array[i].chrs : "(null)",
623 + (unsigned)array[i].off);
627 if( &array[i].str[ array[i].off ] != rv )
629 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
630 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
631 array[i].str ? array[i].str : "(null)",
632 array[i].chrs ? array[i].chrs : "(null)",
633 - rv, array[i].str, array[i].off);
634 + rv, array[i].str, (unsigned)array[i].off);
638 @@ -1837,19 +1837,19 @@ PRBool test_020(void)
640 if( (char *)0 == rv )
642 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
643 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
644 array[i].str ? array[i].str : "(null)",
645 array[i].chrs ? array[i].chrs : "(null)",
647 + (unsigned)array[i].off);
651 if( &array[i].str[ array[i].off ] != rv )
653 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
654 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
655 array[i].str ? array[i].str : "(null)",
656 array[i].chrs ? array[i].chrs : "(null)",
657 - rv, array[i].str, array[i].off);
658 + rv, array[i].str, (unsigned)array[i].off);
662 @@ -1923,10 +1923,10 @@ PRBool test_021(void)
664 if( (char *)0 != rv )
666 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
667 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
668 array[i].str ? array[i].str : "(null)",
669 array[i].chrs ? array[i].chrs : "(null)",
671 + (unsigned)array[i].max, rv);
675 @@ -1934,19 +1934,19 @@ PRBool test_021(void)
677 if( (char *)0 == rv )
679 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
680 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
681 array[i].str ? array[i].str : "(null)",
682 array[i].chrs ? array[i].chrs : "(null)",
683 - array[i].max, array[i].off);
684 + (unsigned)array[i].max, array[i].off);
688 if( &array[i].str[ array[i].off ] != rv )
690 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
691 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
692 array[i].str ? array[i].str : "(null)",
693 array[i].chrs ? array[i].chrs : "(null)",
694 - array[i].max, rv, array[i].str, array[i].off);
695 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
699 @@ -2029,10 +2029,10 @@ PRBool test_022(void)
701 if( (char *)0 != rv )
703 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
704 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
705 array[i].str ? array[i].str : "(null)",
706 array[i].chrs ? array[i].chrs : "(null)",
708 + (unsigned)array[i].max, rv);
712 @@ -2040,19 +2040,19 @@ PRBool test_022(void)
714 if( (char *)0 == rv )
716 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
717 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
718 array[i].str ? array[i].str : "(null)",
719 array[i].chrs ? array[i].chrs : "(null)",
720 - array[i].max, array[i].off);
721 + (unsigned)array[i].max, array[i].off);
725 if( &array[i].str[ array[i].off ] != rv )
727 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
728 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
729 array[i].str ? array[i].str : "(null)",
730 array[i].chrs ? array[i].chrs : "(null)",
731 - array[i].max, rv, array[i].str, array[i].off);
732 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
736 @@ -2148,19 +2148,19 @@ PRBool test_023(void)
738 if( (char *)0 == rv )
740 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
741 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
742 array[i].str ? array[i].str : "(null)",
743 array[i].sub ? array[i].sub : "(null)",
744 - array[i].str, array[i].off);
745 + array[i].str, (unsigned)array[i].off);
749 if( &array[i].str[ array[i].off ] != rv )
751 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
752 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
753 array[i].str ? array[i].str : "(null)",
754 array[i].sub ? array[i].sub : "(null)",
755 - rv, array[i].str, array[i].off);
756 + rv, array[i].str, (unsigned)array[i].off);
760 @@ -2256,19 +2256,19 @@ PRBool test_024(void)
762 if( (char *)0 == rv )
764 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
765 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
766 array[i].str ? array[i].str : "(null)",
767 array[i].sub ? array[i].sub : "(null)",
768 - array[i].str, array[i].off);
769 + array[i].str, (unsigned)array[i].off);
773 if( &array[i].str[ array[i].off ] != rv )
775 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
776 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
777 array[i].str ? array[i].str : "(null)",
778 array[i].sub ? array[i].sub : "(null)",
779 - rv, array[i].str, array[i].off);
780 + rv, array[i].str, (unsigned)array[i].off);
784 @@ -2375,10 +2375,10 @@ PRBool test_025(void)
786 if( (char *)0 != rv )
788 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
789 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
790 array[i].str ? array[i].str : "(null)",
791 array[i].sub ? array[i].sub : "(null)",
793 + (unsigned)array[i].max, rv);
797 @@ -2386,19 +2386,19 @@ PRBool test_025(void)
799 if( (char *)0 == rv )
801 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
802 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
803 array[i].str ? array[i].str : "(null)",
804 array[i].sub ? array[i].sub : "(null)",
805 - array[i].max, array[i].str, array[i].off);
806 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
810 if( &array[i].str[ array[i].off ] != rv )
812 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
813 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
814 array[i].str ? array[i].str : "(null)",
815 array[i].sub ? array[i].sub : "(null)",
816 - array[i].max, rv, array[i].str, array[i].off);
817 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
821 @@ -2507,10 +2507,10 @@ PRBool test_026(void)
823 if( (char *)0 != rv )
825 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
826 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
827 array[i].str ? array[i].str : "(null)",
828 array[i].sub ? array[i].sub : "(null)",
830 + (unsigned)array[i].max, rv);
834 @@ -2518,19 +2518,19 @@ PRBool test_026(void)
836 if( (char *)0 == rv )
838 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
839 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
840 array[i].str ? array[i].str : "(null)",
841 array[i].sub ? array[i].sub : "(null)",
842 - array[i].max, array[i].str, array[i].off);
843 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
847 if( &array[i].str[ array[i].off ] != rv )
849 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
850 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
851 array[i].str ? array[i].str : "(null)",
852 array[i].sub ? array[i].sub : "(null)",
853 - array[i].max, rv, array[i].str, array[i].off);
854 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
858 @@ -2626,19 +2626,19 @@ PRBool test_027(void)
860 if( (char *)0 == rv )
862 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
863 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
864 array[i].str ? array[i].str : "(null)",
865 array[i].sub ? array[i].sub : "(null)",
866 - array[i].str, array[i].off);
867 + array[i].str, (unsigned)array[i].off);
871 if( &array[i].str[ array[i].off ] != rv )
873 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
874 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
875 array[i].str ? array[i].str : "(null)",
876 array[i].sub ? array[i].sub : "(null)",
877 - rv, array[i].str, array[i].off);
878 + rv, array[i].str, (unsigned)array[i].off);
882 @@ -2734,19 +2734,19 @@ PRBool test_028(void)
884 if( (char *)0 == rv )
886 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
887 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
888 array[i].str ? array[i].str : "(null)",
889 array[i].sub ? array[i].sub : "(null)",
890 - array[i].str, array[i].off);
891 + array[i].str, (unsigned)array[i].off);
895 if( &array[i].str[ array[i].off ] != rv )
897 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
898 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
899 array[i].str ? array[i].str : "(null)",
900 array[i].sub ? array[i].sub : "(null)",
901 - rv, array[i].str, array[i].off);
902 + rv, array[i].str, (unsigned)array[i].off);
906 @@ -2853,10 +2853,10 @@ PRBool test_029(void)
908 if( (char *)0 != rv )
910 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
911 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
912 array[i].str ? array[i].str : "(null)",
913 array[i].sub ? array[i].sub : "(null)",
915 + (unsigned)array[i].max, rv);
919 @@ -2864,19 +2864,19 @@ PRBool test_029(void)
921 if( (char *)0 == rv )
923 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
924 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
925 array[i].str ? array[i].str : "(null)",
926 array[i].sub ? array[i].sub : "(null)",
927 - array[i].max, array[i].str, array[i].off);
928 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
932 if( &array[i].str[ array[i].off ] != rv )
934 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
935 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
936 array[i].str ? array[i].str : "(null)",
937 array[i].sub ? array[i].sub : "(null)",
938 - array[i].max, rv, array[i].str, array[i].off);
939 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
943 @@ -2985,10 +2985,10 @@ PRBool test_030(void)
945 if( (char *)0 != rv )
947 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
948 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
949 array[i].str ? array[i].str : "(null)",
950 array[i].sub ? array[i].sub : "(null)",
952 + (unsigned)array[i].max, rv);
956 @@ -2996,19 +2996,19 @@ PRBool test_030(void)
958 if( (char *)0 == rv )
960 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
961 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
962 array[i].str ? array[i].str : "(null)",
963 array[i].sub ? array[i].sub : "(null)",
964 - array[i].max, array[i].str, array[i].off);
965 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
969 if( &array[i].str[ array[i].off ] != rv )
971 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
972 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
973 array[i].str ? array[i].str : "(null)",
974 array[i].sub ? array[i].sub : "(null)",
975 - array[i].max, rv, array[i].str, array[i].off);
976 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
982 [FILE:6203:patches/patch-pr_include_md___dragonfly.cfg]
983 --- /dev/null 2022-09-16 19:41:29 UTC
984 +++ pr/include/md/_dragonfly.cfg
986 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
987 +/* This Source Code Form is subject to the terms of the Mozilla Public
988 + * License, v. 2.0. If a copy of the MPL was not distributed with this
989 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
991 +#ifndef nspr_cpucfg___
992 +#define nspr_cpucfg___
998 +#define PR_AF_INET6 28 /* same as AF_INET6 */
1000 +#ifndef HAVE_LONG_LONG
1001 +#define HAVE_LONG_LONG
1004 +#if defined(__i386__)
1006 +#define IS_LITTLE_ENDIAN 1
1007 +#undef IS_BIG_ENDIAN
1008 +#undef HAVE_ALIGNED_DOUBLES
1009 +#undef HAVE_ALIGNED_LONGLONGS
1011 +#define PR_BYTES_PER_BYTE 1
1012 +#define PR_BYTES_PER_SHORT 2
1013 +#define PR_BYTES_PER_INT 4
1014 +#define PR_BYTES_PER_INT64 8
1015 +#define PR_BYTES_PER_LONG 4
1016 +#define PR_BYTES_PER_FLOAT 4
1017 +#define PR_BYTES_PER_DOUBLE 8
1018 +#define PR_BYTES_PER_WORD 4
1019 +#define PR_BYTES_PER_DWORD 8
1020 +#define PR_BYTES_PER_WORD_LOG2 2
1021 +#define PR_BYTES_PER_DWORD_LOG2 3
1023 +#define PR_BITS_PER_BYTE 8
1024 +#define PR_BITS_PER_SHORT 16
1025 +#define PR_BITS_PER_INT 32
1026 +#define PR_BITS_PER_INT64 64
1027 +#define PR_BITS_PER_LONG 32
1028 +#define PR_BITS_PER_FLOAT 32
1029 +#define PR_BITS_PER_DOUBLE 64
1030 +#define PR_BITS_PER_WORD 32
1032 +#define PR_BITS_PER_BYTE_LOG2 3
1033 +#define PR_BITS_PER_SHORT_LOG2 4
1034 +#define PR_BITS_PER_INT_LOG2 5
1035 +#define PR_BITS_PER_INT64_LOG2 6
1036 +#define PR_BITS_PER_LONG_LOG2 5
1037 +#define PR_BITS_PER_FLOAT_LOG2 5
1038 +#define PR_BITS_PER_DOUBLE_LOG2 6
1039 +#define PR_BITS_PER_WORD_LOG2 5
1041 +#define PR_ALIGN_OF_SHORT 2
1042 +#define PR_ALIGN_OF_INT 4
1043 +#define PR_ALIGN_OF_LONG 4
1044 +#define PR_ALIGN_OF_INT64 4
1045 +#define PR_ALIGN_OF_FLOAT 4
1046 +#define PR_ALIGN_OF_DOUBLE 4
1047 +#define PR_ALIGN_OF_POINTER 4
1049 +#elif defined(__alpha__)
1051 +#define IS_LITTLE_ENDIAN 1
1052 +#undef IS_BIG_ENDIAN
1053 +#define HAVE_ALIGNED_DOUBLES
1054 +#define HAVE_ALIGNED_LONGLONGS
1057 +#define PR_BYTES_PER_BYTE 1
1058 +#define PR_BYTES_PER_SHORT 2
1059 +#define PR_BYTES_PER_INT 4
1060 +#define PR_BYTES_PER_INT64 8
1061 +#define PR_BYTES_PER_LONG 8
1062 +#define PR_BYTES_PER_FLOAT 4
1063 +#define PR_BYTES_PER_DOUBLE 8
1064 +#define PR_BYTES_PER_WORD 8
1065 +#define PR_BYTES_PER_DWORD 8
1066 +#define PR_BYTES_PER_WORD_LOG2 3
1067 +#define PR_BYTES_PER_DWORD_LOG2 3
1069 +#define PR_BITS_PER_BYTE 8
1070 +#define PR_BITS_PER_SHORT 16
1071 +#define PR_BITS_PER_INT 32
1072 +#define PR_BITS_PER_INT64 64
1073 +#define PR_BITS_PER_LONG 64
1074 +#define PR_BITS_PER_FLOAT 32
1075 +#define PR_BITS_PER_DOUBLE 64
1076 +#define PR_BITS_PER_WORD 64
1078 +#define PR_BITS_PER_BYTE_LOG2 3
1079 +#define PR_BITS_PER_SHORT_LOG2 4
1080 +#define PR_BITS_PER_INT_LOG2 5
1081 +#define PR_BITS_PER_INT64_LOG2 6
1082 +#define PR_BITS_PER_LONG_LOG2 6
1083 +#define PR_BITS_PER_FLOAT_LOG2 5
1084 +#define PR_BITS_PER_DOUBLE_LOG2 6
1085 +#define PR_BITS_PER_WORD_LOG2 6
1087 +#define PR_ALIGN_OF_SHORT 2
1088 +#define PR_ALIGN_OF_INT 4
1089 +#define PR_ALIGN_OF_LONG 8
1090 +#define PR_ALIGN_OF_INT64 8
1091 +#define PR_ALIGN_OF_FLOAT 4
1092 +#define PR_ALIGN_OF_DOUBLE 8
1093 +#define PR_ALIGN_OF_POINTER 8
1095 +#elif defined(__amd64__)
1097 +#define IS_LITTLE_ENDIAN 1
1098 +#undef IS_BIG_ENDIAN
1099 +#define HAVE_ALIGNED_DOUBLES
1100 +#define HAVE_ALIGNED_LONGLONGS
1103 +#define PR_BYTES_PER_BYTE 1
1104 +#define PR_BYTES_PER_SHORT 2
1105 +#define PR_BYTES_PER_INT 4
1106 +#define PR_BYTES_PER_INT64 8
1107 +#define PR_BYTES_PER_LONG 8
1108 +#define PR_BYTES_PER_FLOAT 4
1109 +#define PR_BYTES_PER_DOUBLE 8
1110 +#define PR_BYTES_PER_WORD 8
1111 +#define PR_BYTES_PER_DWORD 8
1112 +#define PR_BYTES_PER_WORD_LOG2 3
1113 +#define PR_BYTES_PER_DWORD_LOG2 3
1115 +#define PR_BITS_PER_BYTE 8
1116 +#define PR_BITS_PER_SHORT 16
1117 +#define PR_BITS_PER_INT 32
1118 +#define PR_BITS_PER_INT64 64
1119 +#define PR_BITS_PER_LONG 64
1120 +#define PR_BITS_PER_FLOAT 32
1121 +#define PR_BITS_PER_DOUBLE 64
1122 +#define PR_BITS_PER_WORD 64
1124 +#define PR_BITS_PER_BYTE_LOG2 3
1125 +#define PR_BITS_PER_SHORT_LOG2 4
1126 +#define PR_BITS_PER_INT_LOG2 5
1127 +#define PR_BITS_PER_INT64_LOG2 6
1128 +#define PR_BITS_PER_LONG_LOG2 6
1129 +#define PR_BITS_PER_FLOAT_LOG2 5
1130 +#define PR_BITS_PER_DOUBLE_LOG2 6
1131 +#define PR_BITS_PER_WORD_LOG2 6
1133 +#define PR_ALIGN_OF_SHORT 2
1134 +#define PR_ALIGN_OF_INT 4
1135 +#define PR_ALIGN_OF_LONG 8
1136 +#define PR_ALIGN_OF_INT64 8
1137 +#define PR_ALIGN_OF_FLOAT 4
1138 +#define PR_ALIGN_OF_DOUBLE 8
1139 +#define PR_ALIGN_OF_POINTER 8
1140 +#define PR_ALIGN_OF_WORD 8
1144 +#error "Unknown CPU architecture"
1148 +#ifndef NO_NSPR_10_SUPPORT
1150 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
1151 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
1152 +#define BYTES_PER_INT PR_BYTES_PER_INT
1153 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
1154 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
1155 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
1156 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
1157 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
1158 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
1160 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
1161 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
1162 +#define BITS_PER_INT PR_BITS_PER_INT
1163 +#define BITS_PER_INT64 PR_BITS_PER_INT64
1164 +#define BITS_PER_LONG PR_BITS_PER_LONG
1165 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
1166 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
1167 +#define BITS_PER_WORD PR_BITS_PER_WORD
1169 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
1170 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
1171 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
1172 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
1173 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
1174 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
1175 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
1176 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
1178 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
1179 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
1180 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
1181 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
1182 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
1183 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
1184 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
1185 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
1187 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
1188 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
1189 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
1191 +#endif /* NO_NSPR_10_SUPPORT */
1193 +#endif /* nspr_cpucfg___ */
1196 [FILE:6201:patches/patch-pr_include_md___dragonfly.h]
1197 --- /dev/null 2022-09-16 19:41:29 UTC
1198 +++ pr/include/md/_dragonfly.h
1200 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
1201 +/* This Source Code Form is subject to the terms of the Mozilla Public
1202 + * License, v. 2.0. If a copy of the MPL was not distributed with this
1203 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1205 +#ifndef nspr_dragonfly_defs_h___
1206 +#define nspr_dragonfly_defs_h___
1208 +#include "prthread.h"
1211 +#if __FreeBSD__ >= 2
1212 +#include <osreldate.h> /* for __FreeBSD_version */
1214 +#include <sys/syscall.h>
1217 +#define PR_LINKER_ARCH "dragonfly"
1218 +#define _PR_SI_SYSNAME "DRAGONFLY"
1219 +#if defined(__i386__)
1220 +#define _PR_SI_ARCHITECTURE "x86"
1221 +#elif defined(__amd64__)
1222 +#define _PR_SI_ARCHITECTURE "amd64"
1224 +#error "Unknown CPU architecture"
1227 +#define PR_DLL_SUFFIX ".so"
1229 +#define _PR_VMBASE 0x30000000
1230 +#define _PR_STACK_VMBASE 0x50000000
1231 +#define _MD_DEFAULT_STACK_SIZE 65536L
1232 +#define _MD_MMAP_FLAGS MAP_PRIVATE
1234 +#undef HAVE_STACK_GROWING_UP
1237 +#define _PR_HAVE_SOCKADDR_LEN
1238 +#define _PR_STAT_HAS_ST_ATIMESPEC
1239 +#define _PR_HAVE_LARGE_OFF_T
1241 +#define _PR_HAVE_GETPROTO_R
1242 +#define _PR_HAVE_5_ARG_GETPROTO_R
1243 +#define _PR_HAVE_GETHOST_R
1244 +#define _PR_HAVE_GETHOST_R_INT
1246 +#define _PR_POLL_AVAILABLE
1248 +#define _PR_HAVE_SYSV_SEMAPHORES
1249 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
1252 +#define _PR_HAVE_INET_NTOP
1253 +#define _PR_HAVE_GETHOSTBYNAME2
1254 +#define _PR_HAVE_GETADDRINFO
1255 +#define _PR_INET6_PROBE
1256 +#define _PR_IPV6_V6ONLY_PROBE
1260 +#ifndef _PR_PTHREADS
1261 +#include <setjmp.h>
1263 +#define PR_CONTEXT_TYPE sigjmp_buf
1265 +#define CONTEXT(_th) ((_th)->md.context)
1267 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
1268 +#define PR_NUM_GCREGS _JBLEN
1271 +** Initialize a thread context to run "_main()" when started
1273 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
1275 + *status = PR_TRUE; \
1276 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
1279 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
1282 +#define _MD_SWITCH_CONTEXT(_thread) \
1283 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
1284 + (_thread)->md.errcode = errno; \
1289 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
1291 +#define _MD_RESTORE_CONTEXT(_thread) \
1293 + errno = (_thread)->md.errcode; \
1294 + _MD_SET_CURRENT_THREAD(_thread); \
1295 + siglongjmp(CONTEXT(_thread), 1); \
1298 +/* Machine-dependent (MD) data structures */
1301 + PR_CONTEXT_TYPE context;
1306 +struct _MDThreadStack {
1314 +struct _MDSemaphore {
1322 +struct _MDSegment {
1327 + * md-specific cpu structure field
1329 +#define _PR_MD_MAX_OSFD FD_SETSIZE
1331 +struct _MDCPU_Unix {
1333 + PRUint32 ioq_timeout;
1334 + PRInt32 ioq_max_osfd;
1335 + PRInt32 ioq_osfd_cnt;
1336 +#ifndef _PR_USE_POLL
1337 + fd_set fd_read_set, fd_write_set, fd_exception_set;
1338 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
1339 + fd_exception_cnt[_PR_MD_MAX_OSFD];
1341 + struct pollfd *ioq_pollfds;
1342 + int ioq_pollfds_size;
1343 +#endif /* _PR_USE_POLL */
1346 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
1347 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
1348 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
1349 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
1350 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
1351 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
1352 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
1353 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
1354 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
1355 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
1356 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
1357 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
1358 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
1360 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
1363 + struct _MDCPU_Unix md_unix;
1366 +#define _MD_INIT_LOCKS()
1367 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
1368 +#define _MD_FREE_LOCK(lock)
1369 +#define _MD_LOCK(lock)
1370 +#define _MD_UNLOCK(lock)
1371 +#define _MD_INIT_IO()
1372 +#define _MD_IOQ_LOCK()
1373 +#define _MD_IOQ_UNLOCK()
1375 +extern PRStatus _MD_InitializeThread(PRThread *thread);
1377 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
1378 +#define _MD_INIT_THREAD _MD_InitializeThread
1379 +#define _MD_EXIT_THREAD(thread)
1380 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
1381 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
1382 +#define _MD_CLEAN_THREAD(_thread)
1384 +extern PRStatus _MD_CREATE_THREAD(
1386 + void (*start) (void *),
1387 + PRThreadPriority priority,
1388 + PRThreadScope scope,
1389 + PRThreadState state,
1390 + PRUint32 stackSize);
1391 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
1392 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
1393 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
1394 +extern void _MD_YIELD(void);
1396 +#endif /* ! _PR_PTHREADS */
1398 +extern void _MD_EarlyInit(void);
1400 +#define _MD_EARLY_INIT _MD_EarlyInit
1401 +#define _MD_FINAL_INIT _PR_UnixInit
1402 +#define _MD_INTERVAL_USE_GTOD
1405 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
1406 + * unwrapped version.
1408 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
1410 +#if defined(_PR_POLL_AVAILABLE)
1412 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
1415 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
1416 + want to be including that.. */
1417 +#ifndef INADDR_LOOPBACK
1418 +#define INADDR_LOOPBACK (u_long)0x7F000001
1422 +#include <sys/uio.h>
1424 +#endif /* nspr_freebsd_defs_h___ */
1427 [FILE:1204:patches/patch-pr_include_md___freebsd.h]
1428 --- pr/include/md/_freebsd.h.orig 2022-05-25 21:34:56 UTC
1429 +++ pr/include/md/_freebsd.h
1431 #define _PR_HAVE_LARGE_OFF_T
1433 #if defined(_PR_PTHREADS)
1434 -#if __FreeBSD_version >= 400008
1435 +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
1436 +#define _PR_HAVE_GETPROTO_R
1437 +#define _PR_HAVE_5_ARG_GETPROTO_R
1439 +#if defined(__FreeBSD__) || defined(__MidnightBSD__)
1440 +#define _PR_HAVE_GETHOST_R
1441 +#define _PR_HAVE_GETHOST_R_INT
1443 +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
1445 * libc_r before this version of FreeBSD doesn't have poll().
1446 * Although libc has poll(), it is not thread-safe so we can't
1448 #define _PR_POLL_AVAILABLE
1451 -#if __FreeBSD_version >= 300000
1452 +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
1453 #define _PR_POLL_AVAILABLE
1454 #define _PR_USE_POLL
1457 #define _PR_HAVE_SYSV_SEMAPHORES
1458 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
1460 -#if __FreeBSD_version >= 400014
1461 +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
1463 #define _PR_HAVE_INET_NTOP
1464 #define _PR_HAVE_GETHOSTBYNAME2
1467 [FILE:1235:patches/patch-pr_include_md___pth.h]
1468 --- pr/include/md/_pth.h.orig 2022-05-25 21:34:56 UTC
1469 +++ pr/include/md/_pth.h
1472 #if defined(AIX) || defined(SOLARIS) \
1473 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1474 + || defined(__DragonFly__) \
1475 || defined(HPUX) || defined(FREEBSD) \
1476 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
1477 || defined(NTO) || defined(DARWIN) \
1479 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
1480 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
1481 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1482 + || defined(__DragonFly__) \
1484 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
1485 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
1486 @@ -175,6 +177,7 @@ extern int (*_PT_aix_yield_fcn)();
1487 #define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)()
1488 #elif defined(HPUX) || defined(SOLARIS) \
1489 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1490 + || defined(__DragonFly__) \
1491 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1492 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1493 || defined(UNIXWARE) || defined(RISCOS)
1496 [FILE:279:patches/patch-pr_include_md_prosdep.h]
1497 --- pr/include/md/prosdep.h.orig 2022-05-25 21:34:56 UTC
1498 +++ pr/include/md/prosdep.h
1499 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
1500 #elif defined(OPENBSD)
1501 #include "md/_openbsd.h"
1503 +#elif defined(__DragonFly__)
1504 +#include "md/_dragonfly.h"
1507 #include "md/_bsdi.h"
1511 [FILE:403:patches/patch-pr_src_md_unix_uxrng.c]
1512 --- pr/src/md/unix/uxrng.c.orig 2022-05-25 21:34:56 UTC
1513 +++ pr/src/md/unix/uxrng.c
1514 @@ -64,6 +64,7 @@ GetHighResClock(void *buf, size_t maxbyt
1516 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
1517 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
1518 + || defined(__DragonFly__) \
1519 || defined(__GNU__))
1520 #include <sys/types.h>
1521 #include <sys/stat.h>
1524 [FILE:699:patches/patch-pr_src_misc_prnetdb.c]
1525 --- pr/src/misc/prnetdb.c.orig 2022-05-25 21:34:56 UTC
1526 +++ pr/src/misc/prnetdb.c
1527 @@ -73,11 +73,6 @@ PRLock *_pr_dnsLock = NULL;
1528 #define _PR_HAVE_GETPROTO_R_INT
1531 -#if __FreeBSD_version >= 602000
1532 -#define _PR_HAVE_GETPROTO_R
1533 -#define _PR_HAVE_5_ARG_GETPROTO_R
1536 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
1537 #if (defined(__GLIBC__) && __GLIBC__ >= 2)
1538 #define _PR_HAVE_GETPROTO_R
1539 @@ -302,7 +297,7 @@ _pr_QueryNetIfs(void)
1542 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
1543 - || defined(NETBSD) || defined(OPENBSD)
1544 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
1547 * Use the BSD getifaddrs function.
1550 [FILE:1246:patches/patch-pr_src_pthreads_ptio.c]
1551 --- pr/src/pthreads/ptio.c.orig 2022-05-25 21:34:56 UTC
1552 +++ pr/src/pthreads/ptio.c
1553 @@ -191,6 +191,7 @@ static PRBool _pr_ipv6_v6only_on_by_defa
1554 || defined(HPUX10_30) || defined(HPUX11) \
1555 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1556 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1557 + || defined(__DragonFly__) \
1558 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1559 || defined(UNIXWARE) || defined(RISCOS)
1560 #define _PRSelectFdSetArg_t fd_set *
1561 @@ -3523,6 +3524,7 @@ static PRIOMethods _pr_socketpollfd_meth
1562 #if defined(HPUX) || defined(SOLARIS) \
1563 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1564 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
1565 + || defined(__DragonFly__) \
1566 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
1567 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS)
1568 #define _PR_FCNTL_FLAGS O_NONBLOCK
1569 @@ -5309,6 +5311,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
1571 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
1573 + start = 0; /* Not needed, but shuts down a warning */
1575 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
1576 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
1579 [FILE:881:patches/patch-pr_src_pthreads_ptsynch.c]
1580 --- pr/src/pthreads/ptsynch.c.orig 2022-09-12 11:40:15 UTC
1581 +++ pr/src/pthreads/ptsynch.c
1582 @@ -25,7 +25,7 @@ static pthread_condattr_t _pt_cvar_attr;
1583 extern PTDebug pt_debug; /* this is shared between several modules */
1584 #endif /* defined(DEBUG) */
1586 -#if defined(FREEBSD)
1587 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
1589 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
1590 * Newer versions return EBUSY. We still need to support both.
1591 @@ -951,7 +951,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
1592 * From the semctl(2) man page in glibc 2.0
1594 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
1595 - || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
1596 + || defined(__DragonFly__) \
1597 || defined(OPENBSD) || defined(BSDI) \
1599 /* union semun is defined by including <sys/sem.h> */
1602 [FILE:83892:patches/patch-tests]
1603 --- lib/tests/Makefile.in.orig 2022-05-25 21:34:56 UTC
1604 +++ lib/tests/Makefile.in
1605 @@ -159,7 +159,7 @@ else
1606 ifeq ($(OS_ARCH),OS2)
1607 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1609 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1610 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1614 --- pr/tests/cleanup.c.orig 2022-05-25 21:34:56 UTC
1615 +++ pr/tests/cleanup.c
1618 static void PR_CALLBACK Thread(void *sleep)
1620 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1621 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1622 printf("Thread exiting\n");
1625 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1626 PRThreadScope type = PR_LOCAL_THREAD;
1627 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1628 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1629 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1630 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1631 + intptr_t child_sleep = 10;
1634 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1635 @@ -82,7 +83,7 @@ int main(int argc, char **argv)
1636 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1637 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1638 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1639 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1640 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1641 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1642 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1644 --- pr/tests/cltsrv.c.orig 2022-05-25 21:34:56 UTC
1645 +++ pr/tests/cltsrv.c
1646 @@ -949,7 +949,7 @@ int main(int argc, char** argv)
1650 - CSClient_t *client;
1651 + CSClient_t *client = NULL;
1652 PRStatus rv, joinStatus;
1653 CSServer_t *server = NULL;
1655 --- pr/tests/cvar.c.orig 2022-05-25 21:34:56 UTC
1657 @@ -138,15 +138,15 @@ static int alive;
1658 static void PR_CALLBACK CXReader(void *arg)
1660 CircBuf *cbp = (CircBuf *)arg;
1666 for (i = 0; i < n; i++) {
1667 data = GetCBData(cbp);
1668 - if ((int)data != i)
1669 + if ((intptr_t)data != i)
1671 - printf("data mismatch at for i = %d usec\n", i);
1672 + printf("data mismatch at for i = %ld usec\n", (long)i);
1676 @@ -159,7 +159,7 @@ static void PR_CALLBACK CXReader(void *a
1677 static void PR_CALLBACK CXWriter(void *arg)
1679 CircBuf *cbp = (CircBuf *)arg;
1684 for (i = 0; i < n; i++) {
1685 --- pr/tests/cvar2.c.orig 2022-05-25 21:34:56 UTC
1686 +++ pr/tests/cvar2.c
1687 @@ -96,7 +96,7 @@ PrivateCondVarThread(void *_info)
1688 for (index=0; index<info->loops; index++) {
1689 PR_Lock(info->lock);
1690 if (*info->tcount == 0) {
1691 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1692 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1693 PR_GetCurrentThread(), info->cvar));
1694 PR_WaitCondVar(info->cvar, info->timeout);
1696 @@ -109,8 +109,8 @@ PrivateCondVarThread(void *_info)
1697 PR_Lock(info->exitlock);
1698 (*info->exitcount)++;
1699 PR_NotifyCondVar(info->exitcvar);
1700 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1701 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1702 + DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1703 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1704 PR_Unlock(info->exitlock);
1707 @@ -159,7 +159,7 @@ CreateTestThread(threadinfo *info,
1709 CondVarTestSUU(void *_arg)
1711 - PRInt32 arg = (PRInt32)_arg;
1712 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1713 PRInt32 index, loops;
1716 @@ -191,7 +191,7 @@ CondVarTestSUU(void *_arg)
1720 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1721 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1724 for (loops = 0; loops < count; loops++) {
1725 @@ -201,7 +201,7 @@ CondVarTestSUU(void *_arg)
1726 (*list[index].tcount)++;
1727 PR_NotifyCondVar(list[index].cvar);
1728 PR_Unlock(list[index].lock);
1729 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1730 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1731 PR_GetCurrentThread(), list[index].cvar));
1734 @@ -231,7 +231,7 @@ CondVarTestSUU(void *_arg)
1736 CondVarTestSUK(void *_arg)
1738 - PRInt32 arg = (PRInt32)_arg;
1739 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1740 PRInt32 index, loops;
1743 @@ -307,7 +307,7 @@ CondVarTestSUK(void *_arg)
1745 CondVarTestPUU(void *_arg)
1747 - PRInt32 arg = (PRInt32)_arg;
1748 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1749 PRInt32 index, loops;
1752 @@ -342,7 +342,7 @@ CondVarTestPUU(void *_arg)
1756 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1757 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1761 @@ -360,8 +360,8 @@ CondVarTestPUU(void *_arg)
1763 /* Wait for threads to finish */
1764 while(exitcount < arg) {
1765 - DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1766 - PR_GetCurrentThread(), exitcvar, exitcount));
1767 + DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1768 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1769 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1771 PR_ASSERT(exitcount >= arg);
1772 @@ -371,7 +371,7 @@ CondVarTestPUU(void *_arg)
1774 /* Join all the threads */
1775 for(index=0; index<(arg); index++) {
1776 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1777 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1778 PR_JoinThread(list[index].thread);
1779 if (list[index].internal) {
1780 PR_Lock(list[index].lock);
1781 @@ -393,7 +393,7 @@ CondVarTestPUU(void *_arg)
1783 CondVarTestPUK(void *_arg)
1785 - PRInt32 arg = (PRInt32)_arg;
1786 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1787 PRInt32 index, loops;
1790 @@ -475,7 +475,7 @@ CondVarTestPUK(void *_arg)
1792 CondVarTest(void *_arg)
1794 - PRInt32 arg = (PRInt32)_arg;
1795 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1796 PRInt32 index, loops;
1799 @@ -609,7 +609,7 @@ CondVarTest(void *_arg)
1801 CondVarTimeoutTest(void *_arg)
1803 - PRInt32 arg = (PRInt32)_arg;
1804 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1805 PRInt32 index, loops;
1808 @@ -721,7 +721,7 @@ CondVarTimeoutTest(void *_arg)
1810 CondVarMixedTest(void *_arg)
1812 - PRInt32 arg = (PRInt32)_arg;
1813 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1814 PRInt32 index, loops;
1817 @@ -811,7 +811,7 @@ CondVarMixedTest(void *_arg)
1818 for(index=0; index<(arg*4); index+=3) {
1820 PR_Lock(list[index].lock);
1821 - *list[index].tcount++;
1822 + list[index].tcount++;
1823 PR_NotifyCondVar(list[index].cvar);
1824 PR_Unlock(list[index].lock);
1826 @@ -883,7 +883,7 @@ static void Measure(void (*func)(void *)
1829 start = PR_IntervalNow();
1830 - (*func)((void *)arg);
1831 + (*func)((void *)(intptr_t)arg);
1832 stop = PR_IntervalNow();
1834 d = (double)PR_IntervalToMicroseconds(stop - start);
1835 @@ -948,7 +948,7 @@ This test is run with %d, %d, %d, and %d
1836 PR_SetConcurrency(2);
1838 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1839 - printf("\n%ld Thread tests\n", threads);
1840 + printf("\n%d Thread tests\n", (int)threads);
1841 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1842 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1843 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1844 --- pr/tests/foreign.c.orig 2022-05-25 21:34:56 UTC
1845 +++ pr/tests/foreign.c
1846 @@ -175,7 +175,7 @@ static void OneShot(void *arg)
1849 PRFileDesc *pair[2];
1850 - PRIntn test = (PRIntn)arg;
1851 + intptr_t test = (intptr_t)arg;
1853 for (test = 0; test < 12; ++test) {
1855 @@ -272,7 +272,7 @@ static void OneShot(void *arg)
1856 int main(int argc, char **argv)
1859 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1860 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1862 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1864 --- pr/tests/forktest.c.orig 2022-05-25 21:34:56 UTC
1865 +++ pr/tests/forktest.c
1866 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1869 PRFileDesc *sock = NULL;
1870 - PRInt32 tmp = (PRInt32)arg;
1871 + intptr_t tmp = (intptr_t)arg;
1874 * Make sure the PR_Accept call will block
1875 @@ -143,7 +143,7 @@ DoIO(void)
1878 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1879 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1880 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1881 PR_JOINABLE_THREAD, 0);
1882 if (clientThread == NULL) {
1883 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1884 @@ -151,6 +151,9 @@ DoIO(void)
1888 + printf("Wait one second before accept\n");
1890 + PR_Sleep(PR_SecondsToInterval(1));
1891 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1893 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1894 --- pr/tests/getai.c.orig 2022-05-25 21:34:56 UTC
1895 +++ pr/tests/getai.c
1896 @@ -13,8 +13,15 @@ int main(int argc, char **argv)
1902 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1907 + host = "www.FreeBSD.org";
1909 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1911 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1912 PR_GetError(), PR_GetOSError());
1913 --- pr/tests/instrumt.c.orig 2022-05-25 21:34:56 UTC
1914 +++ pr/tests/instrumt.c
1921 #include <prclist.h>
1924 #define COUNT_LIMIT (10 * ( 1024))
1926 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1931 @@ -78,10 +78,10 @@ static void Help(void)
1933 static void ListCounters(void)
1935 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1936 PR_DEFINE_COUNTER( qh );
1937 PR_DEFINE_COUNTER( rh );
1938 const char *qn, *rn, *dn;
1939 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1942 PR_INIT_COUNTER_HANDLE( qh, NULL );
1943 @@ -92,7 +92,7 @@ static void ListCounters(void)
1944 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1945 while ( rh != NULL )
1947 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1948 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1949 PR_GET_COUNTER(tCtr, rh);
1950 PR_LOG( lm, msgLevel,
1951 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1952 @@ -101,15 +101,15 @@ static void ListCounters(void)
1954 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1958 } /* end ListCounters() */
1960 static void ListTraces(void)
1962 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1963 PR_DEFINE_TRACE( qh );
1964 PR_DEFINE_TRACE( rh );
1965 const char *qn, *rn, *dn;
1966 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1968 PR_INIT_TRACE_HANDLE( qh, NULL );
1969 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1970 @@ -119,7 +119,7 @@ static void ListTraces(void)
1971 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1972 while ( rh != NULL )
1974 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1975 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1976 PR_LOG( lm, msgLevel,
1977 ( "QName: %s RName: %s Desc: %s",
1979 @@ -127,7 +127,7 @@ static void ListTraces(void)
1981 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1985 } /* end ListCounters() */
1988 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1990 static void TraceTest( void )
1995 PR_DEFINE_TRACE( th );
1997 --- pr/tests/io_timeout.c.orig 2022-05-25 21:34:56 UTC
1998 +++ pr/tests/io_timeout.c
2000 /* Used to get the command line option */
2001 #include "plgetopt.h"
2005 +#include <string.h>
2008 #define NUM_THREADS 1
2009 -#define BASE_PORT 8000
2010 +#define BASE_PORT 38011
2011 #define DEFAULT_ACCEPT_TIMEOUT 2
2013 typedef struct threadInfo {
2014 @@ -38,7 +40,7 @@ typedef struct threadInfo {
2017 PRIntn failed_already = 0;
2018 -PRIntn debug_mode = 0;
2019 +PRIntn debug_mode = 1;
2021 #define LOCAL_SCOPE_STRING "LOCAL scope"
2022 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
2023 @@ -54,7 +56,7 @@ thread_main(void *_info)
2024 PRFileDesc *clientSock;
2026 PRThreadScope tscope;
2028 + const char *scope_str;
2032 @@ -74,6 +76,7 @@ thread_main(void *_info)
2035 PR_NOT_REACHED("Invalid thread scope");
2039 printf("thread id %d, scope %s\n", info->id, scope_str);
2040 @@ -92,8 +95,12 @@ thread_main(void *_info)
2041 listenAddr.inet.ip = PR_htonl(PR_INADDR_ANY);
2042 rv = PR_Bind(listenSock, &listenAddr);
2043 if (rv == PR_FAILURE) {
2045 - printf("unable to bind\n");
2047 + printf("unable to bind to %d: %s\n",
2048 + BASE_PORT + info->id, strerror(PR_GetOSError()));
2049 + if (PR_GetOSError() == EADDRINUSE) {
2050 + printf("can not proceed with this test\n");
2055 @@ -117,8 +124,9 @@ thread_main(void *_info)
2056 if (clientSock == NULL) {
2057 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
2059 - printf("PR_Accept() timeout worked!\n");
2060 - printf("TEST PASSED! PR_Accept() returned error %d\n",
2061 + printf("PR_Accept() timeout worked!\n"
2062 + "TEST PASSED! PR_Accept() returned error "
2063 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
2064 PR_IO_TIMEOUT_ERROR);
2067 --- pr/tests/layer.c.orig 2022-05-25 21:34:56 UTC
2068 +++ pr/tests/layer.c
2069 @@ -57,7 +57,10 @@ static PRUint16 default_port = 12273 POR
2070 static PRFileDesc *PushLayer(PRFileDesc *stack)
2072 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
2073 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
2074 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
2075 + PRStatus rv = /* we only need rv for PR_ASSERT() */
2077 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
2078 if (verbosity > quiet) {
2079 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
2081 --- pr/tests/lazyinit.c.orig 2022-05-25 21:34:56 UTC
2082 +++ pr/tests/lazyinit.c
2083 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
2087 - PRCondVar *cv = NULL;
2088 PRThread *thread = NULL;
2089 PRIntervalTime interval = 0;
2090 PRFileDesc *file, *udp, *tcp, *pair[2];
2091 --- pr/tests/lltest.c.orig 2022-05-25 21:34:56 UTC
2092 +++ pr/tests/lltest.c
2093 @@ -651,6 +651,7 @@ TestConversion( void )
2098 static void ShiftCompileOnly()
2101 @@ -667,6 +668,7 @@ static void ShiftCompileOnly()
2102 LL_ISHL(ia, 49, 32);
2104 } /* ShiftCompileOnly */
2109 @@ -751,7 +753,6 @@ TestArithmetic( void )
2110 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
2111 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
2112 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
2113 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
2114 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
2115 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
2116 PRInt64 result, result2;
2117 --- pr/tests/mbcs.c.orig 2022-05-25 21:34:56 UTC
2119 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
2121 ** Traverse directory
2123 -static void TraverseDirectory( unsigned char *dir )
2124 +static void TraverseDirectory(const char *dir)
2127 PRDirEntry *dirEntry;
2134 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
2137 if ( PR_FILE_FILE == info.type ) {
2138 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
2139 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
2140 fd = PR_Open( file, PR_RDONLY, 0 );
2142 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
2143 - PR_GetError(), PR_GetOSError());
2144 + (long)PR_GetError(), (long)PR_GetOSError());
2146 rc = PR_Close( fd );
2147 if ( PR_FAILURE == rc ) {
2148 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
2149 - PR_GetError(), PR_GetOSError());
2150 + (long)PR_GetError(), (long)PR_GetOSError());
2152 } else if ( PR_FILE_DIRECTORY == info.type ) {
2153 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
2154 --- pr/tests/nbconn.c.orig 2022-05-25 21:34:56 UTC
2155 +++ pr/tests/nbconn.c
2156 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
2158 PRSocketOptionData optData;
2159 const char *hostname = NULL;
2160 - PRIntn default_case, n, bytes_read, bytes_sent;
2161 - PRInt32 failed_already = 0;
2162 + PRIntn default_case, n;
2166 @@ -169,7 +168,7 @@ int main(int argc, char **argv)
2169 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
2170 - PR_GetError(), PR_GetOSError());
2171 + (long)PR_GetError(), (long)PR_GetOSError());
2175 @@ -240,7 +239,7 @@ connection_success_test()
2176 PRThread *thr = NULL;
2178 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
2179 - PRIntn default_case, n, bytes_read, bytes_sent;
2180 + PRIntn n, bytes_read, bytes_sent;
2181 PRIntn failed_already = 0;
2184 @@ -317,7 +316,7 @@ connection_success_test()
2188 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
2189 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
2191 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
2192 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
2193 @@ -396,7 +395,7 @@ connection_success_test()
2194 DPRINTF(("Data integrity verified\n"));
2196 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
2197 - PR_GetError(), PR_GetOSError());
2198 + (long)PR_GetError(), (long)PR_GetOSError());
2202 @@ -505,7 +504,6 @@ connection_failure_test()
2205 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
2207 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
2210 --- pr/tests/nblayer.c.orig 2022-05-25 21:34:56 UTC
2211 +++ pr/tests/nblayer.c
2212 @@ -360,7 +360,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
2213 static PRInt16 PR_CALLBACK MyPoll(
2214 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
2216 - PRInt16 my_flags, new_flags;
2217 + PRInt16 my_flags = -1, new_flags;
2218 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
2219 if (0 != (PR_POLL_READ & in_flags))
2221 @@ -405,7 +405,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
2222 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
2225 - PRFileDesc *newfd, *layer = fd;
2226 + PRFileDesc *newfd;
2227 PRFileDesc *newstack;
2228 PRFilePrivate *newsecret;
2230 @@ -507,6 +507,8 @@ static PRInt32 PR_CALLBACK MyRecv(
2231 mine->rcvinprogress = 0;
2232 return mine->rcvreq; /* << -- that's it! */
2234 + PR_ASSERT(!"How did I get this mine->rcvstate?");
2239 @@ -575,6 +577,8 @@ static PRInt32 PR_CALLBACK MySend(
2240 mine->xmtinprogress = 0;
2241 return mine->xmtreq; /* <<-- That's the one! */
2243 + PR_ASSERT(!"How did I get this mine->xmtstate?");
2248 --- pr/tests/nonblock.c.orig 2022-05-25 21:34:56 UTC
2249 +++ pr/tests/nonblock.c
2251 static void PR_CALLBACK
2252 clientThreadFunc(void *arg)
2254 - PRUintn port = (PRUintn)arg;
2255 + intptr_t port = (intptr_t)arg;
2258 char buf[CHUNK_SIZE];
2259 @@ -145,7 +145,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2262 clientThread = PR_CreateThread(PR_USER_THREAD,
2263 - clientThreadFunc, (void *) listenPort,
2264 + clientThreadFunc, (void *) (intptr_t)listenPort,
2265 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2266 PR_UNJOINABLE_THREAD, 0);
2267 if (clientThread == NULL) {
2268 @@ -189,7 +189,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2269 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
2270 PL_PrintError("First Receive:\n");
2271 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
2272 - retVal, PR_GetError());
2273 + (long)retVal, (long)PR_GetError());
2276 printf("read: EWOULDBLOCK, good\n");
2277 @@ -199,7 +199,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2278 if (retVal != CHUNK_SIZE) {
2279 PL_PrintError("Second Receive:\n");
2280 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
2281 - retVal, PR_GetError());
2282 + (long)retVal, (long)PR_GetError());
2285 printf("read: %d bytes, good\n", retVal);
2286 --- pr/tests/obsints.c.orig 2022-05-25 21:34:56 UTC
2287 +++ pr/tests/obsints.c
2288 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
2289 #else /* NO_NSPR_10_SUPPORT */
2291 #include "prtypes.h" /* which includes protypes.h */
2292 +#if !defined(__GNUC__)
2296 int main(int argc, char **argv)
2298 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
2299 * Compilation fails if any of these integer types are not
2300 * defined by protypes.h.
2314 + uintn uin __unused;
2317 + uint8 ui8 __unused;
2318 + int16 i16 __unused;
2319 + uint16 ui16 __unused;
2320 + int32 i32 __unused;
2321 + uint32 ui32 __unused;
2322 + int64 i64 __unused;
2323 + uint64 ui64 __unused;
2327 --- pr/tests/parsetm.c.orig 2022-05-25 21:34:56 UTC
2328 +++ pr/tests/parsetm.c
2329 @@ -32,8 +32,8 @@ static void PrintExplodedTime(const PREx
2331 /* Print day of the week, month, day, hour, minute, and second */
2332 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
2333 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
2334 - et->tm_hour, et->tm_min, et->tm_sec);
2335 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
2336 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
2338 /* Print time zone */
2339 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
2340 @@ -50,7 +50,7 @@ static void PrintExplodedTime(const PREx
2341 hourOffset = totalOffset / 3600;
2342 minOffset = (totalOffset % 3600) / 60;
2344 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
2345 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
2349 --- pr/tests/peek.c.orig 2022-05-25 21:34:56 UTC
2351 @@ -137,7 +137,7 @@ static void ClientNB(void *arg)
2354 PRSocketOptionData opt;
2355 - PRUint16 port = (PRUint16) arg;
2356 + PRUint16 port = (intptr_t) arg;
2358 char buf[BUFFER_SIZE];
2360 @@ -301,7 +301,7 @@ RunTest(PRThreadScope scope, PRFileDesc
2363 client = PR_CreateThread(
2364 - PR_USER_THREAD, ClientNB, (void *) port,
2365 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
2366 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2367 if (NULL == client) {
2368 fprintf(stderr, "PR_CreateThread failed\n");
2369 --- pr/tests/perf.c.orig 2022-05-25 21:34:56 UTC
2371 @@ -142,7 +142,7 @@ static void PR_CALLBACK CXReader(void *a
2373 for (i = 0; i < n; i++) {
2375 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
2376 + DPRINTF(("CXReader: thread = %p waiting\n",
2377 PR_GetCurrentThread()));
2378 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
2380 @@ -155,7 +155,7 @@ static void PR_CALLBACK CXReader(void *a
2383 PR_ExitMonitor(mon2);
2384 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2385 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
2388 static void PR_CALLBACK CXWriter(void *arg)
2389 @@ -166,7 +166,7 @@ static void PR_CALLBACK CXWriter(void *a
2391 for (i = 0; i < n; i++) {
2393 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
2394 + DPRINTF(("CXWriter: thread = %p waiting\n",
2395 PR_GetCurrentThread()));
2396 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
2398 @@ -179,7 +179,7 @@ static void PR_CALLBACK CXWriter(void *a
2401 PR_ExitMonitor(mon2);
2402 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2403 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
2406 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
2407 @@ -199,7 +199,7 @@ static void ContextSwitch(PRThreadScope
2409 fprintf(stderr, "ContextSwitch: cannot create thread\n");
2411 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
2412 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
2413 (scope1 == PR_GLOBAL_THREAD ?
2414 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2416 @@ -213,7 +213,7 @@ static void ContextSwitch(PRThreadScope
2418 fprintf(stderr, "ContextSwitch: cannot create thread\n");
2420 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
2421 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
2422 (scope2 == PR_GLOBAL_THREAD ?
2423 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2425 @@ -255,10 +255,10 @@ static void PR_CALLBACK SemaThread(void
2428 for (i = 0; i < n; i++) {
2429 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
2430 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
2431 PR_GetCurrentThread(), sem[0]));
2433 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
2434 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
2435 PR_GetCurrentThread(), sem[1]));
2438 @@ -267,7 +267,7 @@ static void PR_CALLBACK SemaThread(void
2441 PR_ExitMonitor(mon2);
2442 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2443 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
2446 static PRSemaphore *sem_set1[2];
2447 @@ -295,7 +295,7 @@ static void SemaContextSwitch(PRThreadSc
2449 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
2451 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
2452 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
2453 (scope1 == PR_GLOBAL_THREAD ?
2454 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2456 @@ -310,7 +310,7 @@ static void SemaContextSwitch(PRThreadSc
2458 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
2460 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
2461 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
2462 (scope2 == PR_GLOBAL_THREAD ?
2463 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2465 --- pr/tests/pipepong.c.orig 2022-05-25 21:34:56 UTC
2466 +++ pr/tests/pipepong.c
2467 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
2468 nBytes = fread(buf, 1, 5, stdin);
2469 fprintf(stderr, "pong process: received \"%s\"\n", buf);
2471 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
2472 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
2476 --- pr/tests/poll_nm.c.orig 2022-05-25 21:34:56 UTC
2477 +++ pr/tests/poll_nm.c
2478 @@ -47,7 +47,7 @@ PRIntn debug_mode;
2479 static void PR_CALLBACK
2480 clientThreadFunc(void *arg)
2482 - PRUintn port = (PRUintn) arg;
2483 + PRUintn port = (intptr_t) arg;
2487 @@ -200,7 +200,7 @@ int main(int argc, char **argv)
2490 clientThread = PR_CreateThread(PR_USER_THREAD,
2491 - clientThreadFunc, (void *) listenPort1,
2492 + clientThreadFunc, (void *)(intptr_t)listenPort1,
2493 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2494 PR_UNJOINABLE_THREAD, 0);
2495 if (clientThread == NULL) {
2496 @@ -210,7 +210,7 @@ int main(int argc, char **argv)
2499 clientThread = PR_CreateThread(PR_USER_THREAD,
2500 - clientThreadFunc, (void *) listenPort2,
2501 + clientThreadFunc, (void *)(intptr_t)listenPort2,
2502 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2503 PR_UNJOINABLE_THREAD, 0);
2504 if (clientThread == NULL) {
2505 --- pr/tests/prfz.c.orig 2022-05-25 21:34:56 UTC
2511 -#include <sys/types.h>
2512 +#include <stdint.h>
2516 --- pr/tests/provider.c.orig 2022-05-25 21:34:56 UTC
2517 +++ pr/tests/provider.c
2518 @@ -1078,7 +1078,7 @@ int main(int argc, char **argv)
2522 - CSClient_t *client;
2523 + CSClient_t *client = NULL;
2524 PRStatus rv, joinStatus;
2525 CSServer_t *server = NULL;
2527 --- pr/tests/prpoll.c.orig 2022-05-25 21:34:56 UTC
2528 +++ pr/tests/prpoll.c
2529 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
2531 clientThreadFunc(void *arg)
2533 - PRUint16 port = (PRUint16) arg;
2534 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2538 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
2541 struct sockaddr_in saddr;
2543 + socklen_t saddr_len;
2544 PRUint16 listenPort3;
2545 PRFileDesc *socket_poll_fd;
2547 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
2550 clientThread = PR_CreateThread(PR_USER_THREAD,
2551 - clientThreadFunc, (void *) listenPort1,
2552 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2553 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2554 PR_UNJOINABLE_THREAD, 0);
2555 if (clientThread == NULL) {
2556 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2559 clientThread = PR_CreateThread(PR_USER_THREAD,
2560 - clientThreadFunc, (void *) listenPort2,
2561 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2562 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2563 PR_UNJOINABLE_THREAD, 0);
2564 if (clientThread == NULL) {
2565 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2568 clientThread = PR_CreateThread(PR_USER_THREAD,
2569 - clientThreadFunc, (void *) listenPort3,
2570 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
2571 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2572 PR_UNJOINABLE_THREAD, 0);
2573 if (clientThread == NULL) {
2574 --- pr/tests/randseed.c.orig 2022-05-25 21:34:56 UTC
2575 +++ pr/tests/randseed.c
2576 @@ -48,7 +48,6 @@ static void Help( void )
2577 static void PrintRand( void *buf, PRIntn size )
2582 printf("%4.4d--\n", size );
2584 --- pr/tests/ranfile.c.orig 2022-05-25 21:34:56 UTC
2585 +++ pr/tests/ranfile.c
2586 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2587 PRStatus rv = PR_SUCCESS;
2588 Hammer_t *cd = (Hammer_t*)arg;
2590 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2591 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2594 printf("Starting work on %s\n", filename);
2595 @@ -405,8 +405,8 @@ int main(int argc, char **argv)
2596 durationTot += duration;
2598 else if (debug_mode) printf(
2599 - "%s: test failed %s after %ld seconds\n",
2600 - programName, where[hammer[poll].problem], duration);
2601 + "%s: test failed %s after %d seconds\n",
2602 + programName, where[hammer[poll].problem], (int)duration);
2606 @@ -414,7 +414,7 @@ int main(int argc, char **argv)
2609 if (debug_mode) printf(
2610 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2611 + "%s: [%d [%d] %d] writes/sec average\n",
2612 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2614 PR_DestroyCondVar(cv);
2615 --- pr/tests/runtests.sh.orig 2022-05-25 21:34:56 UTC
2616 +++ pr/tests/runtests.sh
2617 @@ -226,7 +226,7 @@ OBJDIR=`basename $PWD`
2618 printf "\nNSPR Test Results - $OBJDIR\n\n"
2619 printf "BEGIN\t\t\t`date`\n"
2620 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2621 -printf "Test\t\t\tResult\n\n"
2622 +printf " Test\t\t\tResult\n\n"
2623 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2626 @@ -244,10 +244,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2630 - printf "$prog (`date +%T`)"
2631 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2633 - ./$prog >> ${LOGFILE} 2>&1 &
2635 + ./$prog >> $prog.output 2>&1 &
2638 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2639 @@ -262,9 +260,9 @@ else
2640 printf "\t\t\tPassed\n";
2642 printf "\t\t\tFAILED\n";
2643 + sed "s,^, $prog: ," < $prog.output
2646 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2650 --- pr/tests/sel_spd.c.orig 2022-05-25 21:34:56 UTC
2651 +++ pr/tests/sel_spd.c
2656 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2657 +# include <unistd.h> /* getopt(3) */
2660 #if defined(XP_UNIX)
2663 #define PORT_BASE 19000 PORT_INC_DO PORT_INC_3264
2665 typedef struct timer_slot_t {
2666 - unsigned long d_connect;
2667 - unsigned long d_cl_data;
2668 - unsigned long d_sv_data;
2669 - unsigned long d_close;
2670 - unsigned long d_total;
2671 - unsigned long requests;
2672 + unsigned int d_connect;
2673 + unsigned int d_cl_data;
2674 + unsigned int d_sv_data;
2675 + unsigned int d_close;
2676 + unsigned int d_total;
2677 + unsigned int requests;
2680 -static long _iterations = 5;
2681 -static long _client_data = 8192;
2682 +static int _iterations = 5;
2683 +static int _client_data = 8192;
2685 -static long _server_data = (128*1024);
2686 -static long _threads_max = 10, _threads = 10;
2687 +static int _server_data = (128*1024);
2688 +static int _threads_max = 10, _threads = 10;
2690 static int verbose=0;
2691 static PRMonitor *exit_cv;
2692 @@ -102,7 +105,7 @@ _server_thread(void *arg_id)
2694 void _client_thread(void *);
2695 int *id = (int *)arg_id;
2697 + PRFileDesc *sock = NULL;
2698 PRSocketOptionData sockopt;
2700 PRFileDesc * newsock;
2701 @@ -480,12 +483,12 @@ void
2702 tally_results(int verbose)
2705 - unsigned long tot_connect = 0;
2706 - unsigned long tot_cl_data = 0;
2707 - unsigned long tot_sv_data = 0;
2708 - unsigned long tot_close = 0;
2709 - unsigned long tot_all = 0;
2710 - unsigned long tot_requests = 0;
2711 + unsigned int tot_connect = 0;
2712 + unsigned int tot_cl_data = 0;
2713 + unsigned int tot_sv_data = 0;
2714 + unsigned int tot_close = 0;
2715 + unsigned int tot_all = 0;
2716 + unsigned int tot_requests = 0;
2718 fprintf(stdout, "Server results:\n\n");
2719 for (index=0; index<_threads_max*2; index+=2) {
2720 --- pr/tests/selct_nm.c.orig 2022-05-25 21:34:56 UTC
2721 +++ pr/tests/selct_nm.c
2722 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2724 clientThreadFunc(void *arg)
2726 - PRUintn port = (PRUintn) arg;
2727 + PRUintn port = (PRUintn)(uintptr_t)arg;
2731 @@ -169,7 +169,7 @@ int main(int argc, char **argv)
2734 clientThread = PR_CreateThread(PR_USER_THREAD,
2735 - clientThreadFunc, (void *) listenPort1,
2736 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2737 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2738 PR_UNJOINABLE_THREAD, 0);
2739 if (clientThread == NULL) {
2740 @@ -179,7 +179,7 @@ int main(int argc, char **argv)
2743 clientThread = PR_CreateThread(PR_USER_THREAD,
2744 - clientThreadFunc, (void *) listenPort2,
2745 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2746 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2747 PR_UNJOINABLE_THREAD, 0);
2748 if (clientThread == NULL) {
2749 --- pr/tests/select2.c.orig 2022-05-25 21:34:56 UTC
2750 +++ pr/tests/select2.c
2751 @@ -53,6 +53,7 @@ PRInt32 count;
2753 ***********************************************************************/
2755 +static int exitcode = 2;
2757 static void Test_Result (int result)
2759 @@ -60,9 +61,13 @@ static void Test_Result (int result)
2763 + if (exitcode == 2) {
2772 printf ("NOSTATUS\n");
2773 @@ -382,4 +387,5 @@ int main(int argc, char **argv)
2779 --- pr/tests/semaerr.c.orig 2022-05-25 21:34:56 UTC
2780 +++ pr/tests/semaerr.c
2781 @@ -72,7 +72,7 @@ int main(int argc, char **argv)
2784 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2785 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2786 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2787 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2790 --- pr/tests/semaerr1.c.orig 2022-05-25 21:34:56 UTC
2791 +++ pr/tests/semaerr1.c
2792 @@ -83,7 +83,7 @@ int main(int argc, char **argv)
2795 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2796 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2797 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2801 --- pr/tests/sendzlf.c.orig 2022-05-25 21:34:56 UTC
2802 +++ pr/tests/sendzlf.c
2803 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2807 - PRUint16 port = (PRUint16) arg;
2808 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2812 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2815 clientThread = PR_CreateThread(PR_USER_THREAD,
2816 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2817 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2818 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2819 if (NULL == clientThread) {
2820 fprintf(stderr, "PR_CreateThread failed\n");
2821 --- pr/tests/server_test.c.orig 2022-05-25 21:34:56 UTC
2822 +++ pr/tests/server_test.c
2823 @@ -61,7 +61,7 @@ PRCondVar *ServerStateCV;
2825 #define DPRINTF printf
2828 +#define DPRINTF(...)
2832 @@ -582,6 +582,7 @@ static void do_workUU(void)
2837 static void do_workUK(void)
2839 ServerScope = PR_LOCAL_THREAD;
2840 @@ -602,6 +603,7 @@ static void do_workKK(void)
2841 ClientScope = PR_GLOBAL_THREAD;
2847 static void Measure(void (*func)(void), const char *msg)
2848 --- pr/tests/servr_kk.c.orig 2022-05-25 21:34:56 UTC
2849 +++ pr/tests/servr_kk.c
2850 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2852 #define DPRINTF printf
2855 +#define DPRINTF(...)
2858 PRIntn failed_already=0;
2859 @@ -539,6 +539,7 @@ void do_work()
2860 PR_JoinThread(ServerThread);
2864 static void do_workUU(void)
2866 ServerScope = PR_LOCAL_THREAD;
2867 @@ -559,6 +560,7 @@ static void do_workKU(void)
2868 ClientScope = PR_LOCAL_THREAD;
2873 static void do_workKK(void)
2875 --- pr/tests/servr_ku.c.orig 2022-05-25 21:34:56 UTC
2876 +++ pr/tests/servr_ku.c
2877 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2879 #define DPRINTF printf
2882 +#define DPRINTF(...)
2885 PRIntn failed_already=0;
2886 --- pr/tests/servr_uk.c.orig 2022-05-25 21:34:56 UTC
2887 +++ pr/tests/servr_uk.c
2888 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2890 #define DPRINTF printf
2893 +#define DPRINTF(...)
2896 PRIntn failed_already=0;
2897 --- pr/tests/servr_uu.c.orig 2022-05-25 21:34:56 UTC
2898 +++ pr/tests/servr_uu.c
2899 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2901 #define DPRINTF printf
2904 +#define DPRINTF(...)
2907 PRIntn failed_already=0;
2908 --- pr/tests/short_thread.c.orig 2022-05-25 21:34:56 UTC
2909 +++ pr/tests/short_thread.c
2910 @@ -45,7 +45,7 @@ int main (int argc, char **argv)
2911 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2914 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2915 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2916 PR_GetError(), PR_GetOSError());
2919 --- pr/tests/socket.c.orig 2022-05-25 21:34:56 UTC
2920 +++ pr/tests/socket.c
2921 @@ -173,7 +173,9 @@ readn(PRFileDesc *sockfd, char *buf, int
2928 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2930 if (test_cancelio) {
2931 @@ -181,12 +183,14 @@ readn(PRFileDesc *sockfd, char *buf, int
2934 for (rem=len; rem; offset += bytes, rem -= bytes) {
2935 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2936 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2937 PR_GetCurrentThread(), rem));
2941 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2943 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2944 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2945 PR_GetCurrentThread(), bytes));
2948 @@ -218,11 +222,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2951 for (rem=len; rem; offset += bytes, rem -= bytes) {
2952 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2953 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2954 PR_GetCurrentThread(), rem));
2955 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2956 PR_INTERVAL_NO_TIMEOUT);
2957 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2958 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2959 PR_GetCurrentThread(), bytes));
2962 @@ -272,7 +276,7 @@ Serve_Client(void *arg)
2963 if (PR_Shutdown(sockfd, PR_SHUTDOWN_RCV) < 0) {
2964 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2966 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2967 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2968 (*((int *) in_buf->data))));
2969 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2970 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2971 @@ -414,7 +418,7 @@ TCP_Server(void *arg)
2975 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2976 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2977 netaddr.inet.ip, netaddr.inet.port));
2978 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2979 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2980 @@ -466,7 +470,7 @@ TCP_Server(void *arg)
2984 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2985 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2989 @@ -482,7 +486,7 @@ exit:
2990 --(*sp->exit_counter);
2991 PR_Notify(sp->exit_mon);
2992 PR_ExitMonitor(sp->exit_mon);
2993 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2994 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2998 @@ -541,7 +545,7 @@ UDP_Server(void *arg)
3002 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3003 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3004 netaddr.inet.ip, netaddr.inet.port));
3006 * We can't use the IP address returned by PR_GetSockName in
3007 @@ -579,13 +583,13 @@ UDP_Server(void *arg)
3009 memset(&netaddr, 0, sizeof(netaddr));
3010 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
3011 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
3012 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
3013 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
3016 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
3017 PR_INTERVAL_NO_TIMEOUT);
3018 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
3019 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
3020 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
3023 @@ -608,7 +612,7 @@ UDP_Server(void *arg)
3024 --(*sp->exit_counter);
3025 PR_Notify(sp->exit_mon);
3026 PR_ExitMonitor(sp->exit_mon);
3027 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
3028 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
3032 @@ -652,7 +656,7 @@ TCP_Client(void *arg)
3034 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3035 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3036 - PR_GetError(), PR_GetOSError());
3037 + (long)PR_GetError(), (long)PR_GetOSError());
3041 @@ -660,7 +664,7 @@ TCP_Client(void *arg)
3043 * fill in random data
3045 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3046 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3050 @@ -674,7 +678,7 @@ TCP_Client(void *arg)
3054 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
3055 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
3056 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
3057 if (readn(sockfd, in_buf->data, bytes) < bytes) {
3058 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
3059 @@ -711,7 +715,7 @@ TCP_Client(void *arg)
3060 --(*cp->exit_counter);
3061 PR_Notify(cp->exit_mon);
3062 PR_ExitMonitor(cp->exit_mon);
3063 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
3064 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
3068 @@ -775,7 +779,7 @@ UDP_Client(void *arg)
3072 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3073 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3074 netaddr.inet.ip, netaddr.inet.port));
3076 netaddr = cp->server_addr;
3077 @@ -792,9 +796,9 @@ UDP_Client(void *arg)
3079 * fill in random data
3081 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
3082 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
3083 PR_GetCurrentThread(), out_buf->data, bytes));
3084 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
3085 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
3089 @@ -807,7 +811,7 @@ UDP_Client(void *arg)
3093 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
3094 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
3095 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
3096 if (cp->udp_connect)
3097 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
3098 @@ -818,7 +822,7 @@ UDP_Client(void *arg)
3102 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
3103 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
3104 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
3106 * verify the data read
3107 @@ -843,7 +847,7 @@ UDP_Client(void *arg)
3108 PR_Notify(cp->exit_mon);
3109 PR_ExitMonitor(cp->exit_mon);
3111 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
3112 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
3116 @@ -910,7 +914,7 @@ TCP_Socket_Client_Server_Test(void)
3120 - DPRINTF(("Created TCP server = 0x%lx\n", t));
3121 + DPRINTF(("Created TCP server = %p\n", t));
3125 @@ -944,7 +948,7 @@ TCP_Socket_Client_Server_Test(void)
3129 - DPRINTF(("Created TCP client = 0x%lx\n", t));
3130 + DPRINTF(("Created TCP client = %p\n", t));
3133 /* Wait for server and client threads to exit */
3134 @@ -954,9 +958,9 @@ TCP_Socket_Client_Server_Test(void)
3136 PR_ExitMonitor(mon2);
3137 printf("%30s","TCP_Socket_Client_Server_Test:");
3138 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3139 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3140 num_tcp_clients, num_tcp_connections_per_client);
3141 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3142 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3143 num_tcp_mesgs_per_connection, tcp_mesg_size);
3146 @@ -1081,8 +1085,8 @@ UDP_Socket_Client_Server_Test(void)
3148 PR_ExitMonitor(mon2);
3149 printf("%30s","UDP_Socket_Client_Server_Test: ");
3150 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
3151 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
3152 + printf(" 1 Server %2d Clients\n", num_udp_clients);
3153 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
3154 num_udp_datagrams_per_client, udp_datagram_size);
3157 @@ -1438,7 +1442,7 @@ TransmitFile_Client(void *arg)
3158 --(*cp->exit_counter);
3159 PR_Notify(cp->exit_mon);
3160 PR_ExitMonitor(cp->exit_mon);
3161 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
3162 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
3166 @@ -1481,7 +1485,7 @@ Serve_TransmitFile_Client(void *arg)
3167 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
3169 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
3170 - PR_GetError(), PR_GetOSError());
3171 + (long)PR_GetError(), (long)PR_GetOSError());
3174 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
3175 @@ -1489,7 +1493,7 @@ Serve_TransmitFile_Client(void *arg)
3176 if (bytes != LARGE_FILE_SIZE) {
3178 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
3179 - PR_GetError(), PR_GetOSError());
3180 + (long)PR_GetError(), (long)PR_GetOSError());
3184 @@ -1517,7 +1521,7 @@ Serve_TransmitFile_Client(void *arg)
3187 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3188 - PR_GetError(), PR_GetOSError());
3189 + (long)PR_GetError(), (long)PR_GetOSError());
3193 @@ -1541,7 +1545,7 @@ Serve_TransmitFile_Client(void *arg)
3196 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3197 - PR_GetError(), PR_GetOSError());
3198 + (long)PR_GetError(), (long)PR_GetOSError());
3202 @@ -1563,7 +1567,7 @@ Serve_TransmitFile_Client(void *arg)
3205 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3206 - PR_GetError(), PR_GetOSError());
3207 + (long)PR_GetError(), (long)PR_GetOSError());
3211 @@ -1585,7 +1589,7 @@ Serve_TransmitFile_Client(void *arg)
3214 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3215 - PR_GetError(), PR_GetOSError());
3216 + (long)PR_GetError(), (long)PR_GetOSError());
3220 @@ -1607,7 +1611,7 @@ Serve_TransmitFile_Client(void *arg)
3223 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3224 - PR_GetError(), PR_GetOSError());
3225 + (long)PR_GetError(), (long)PR_GetOSError());
3229 @@ -1629,7 +1633,7 @@ Serve_TransmitFile_Client(void *arg)
3232 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3233 - PR_GetError(), PR_GetOSError());
3234 + (long)PR_GetError(), (long)PR_GetOSError());
3238 @@ -1651,7 +1655,7 @@ Serve_TransmitFile_Client(void *arg)
3241 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3242 - PR_GetError(), PR_GetOSError());
3243 + (long)PR_GetError(), (long)PR_GetOSError());
3247 @@ -1675,7 +1679,7 @@ Serve_TransmitFile_Client(void *arg)
3250 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3251 - PR_GetError(), PR_GetOSError());
3252 + (long)PR_GetError(), (long)PR_GetOSError());
3256 @@ -1752,7 +1756,7 @@ TransmitFile_Server(void *arg)
3260 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3261 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3262 netaddr.inet.ip, netaddr.inet.port));
3263 tcp_server_addr.inet.family = netaddr.inet.family;
3264 tcp_server_addr.inet.port = netaddr.inet.port;
3265 @@ -1818,7 +1822,7 @@ TransmitFile_Server(void *arg)
3269 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
3270 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
3274 @@ -1846,7 +1850,7 @@ exit:
3275 --(*sp->exit_counter);
3276 PR_Notify(sp->exit_mon);
3277 PR_ExitMonitor(sp->exit_mon);
3278 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
3279 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
3283 @@ -1986,7 +1990,7 @@ Socket_Misc_Test(void)
3285 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
3287 - PR_GetError(), PR_GetOSError());
3288 + (long)PR_GetError(), (long)PR_GetOSError());
3292 @@ -2076,7 +2080,7 @@ Socket_Misc_Test(void)
3296 - DPRINTF(("Created TCP server = 0x%x\n", t));
3297 + DPRINTF(("Created TCP server = %p\n", t));
3301 @@ -2113,7 +2117,7 @@ Socket_Misc_Test(void)
3305 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
3306 + DPRINTF(("Created TransmitFile client = %p\n", t));
3309 /* Wait for server and client threads to exit */
3310 @@ -2144,7 +2148,7 @@ done:
3312 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
3313 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
3314 - TEST_DIR, PR_GetError(), PR_GetOSError());
3315 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
3319 --- pr/tests/sprintf.c.orig 2022-05-25 21:34:56 UTC
3320 +++ pr/tests/sprintf.c
3321 @@ -133,7 +133,7 @@ static void test_l(char *pattern, char *
3322 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
3324 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
3325 - pattern, l, s, buf, sbuf);
3326 + pattern, (long)l, s, buf, sbuf);
3327 PR_smprintf_free(s);
3330 --- pr/tests/stack.c.orig 2022-05-25 21:34:56 UTC
3331 +++ pr/tests/stack.c
3332 @@ -53,7 +53,7 @@ PRFileDesc *errhandle;
3334 int main(int argc, char **argv)
3336 - PRInt32 rv, cnt, sum;
3339 PRStack *list1, *list2;
3341 @@ -211,7 +211,7 @@ int main(int argc, char **argv)
3342 static void stackop(void *thread_arg)
3344 PRInt32 val, cnt, index, loops;
3345 - DataRecord *Items, *Item;
3346 + DataRecord *Items;
3347 PRStack *list1, *list2;
3349 stack_data *arg = (stack_data *) thread_arg;
3350 --- pr/tests/suspend.c.orig 2022-05-25 21:34:56 UTC
3351 +++ pr/tests/suspend.c
3352 @@ -21,14 +21,14 @@ void PR_CALLBACK
3353 Level_2_Thread(void *arg)
3355 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
3356 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3357 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
3362 Level_1_Thread(void *arg)
3364 - PRUint32 tmp = (PRUint32)arg;
3365 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
3366 PRThreadScope scope = (PRThreadScope) tmp;
3369 @@ -43,7 +43,7 @@ Level_1_Thread(void *arg)
3371 printf("Could not create thread!\n");
3373 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
3374 + printf("Level_1_Thread[%p] created %15s thread %p\n",
3375 PR_GetCurrentThread(),
3376 (scope == PR_GLOBAL_THREAD) ?
3377 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3378 @@ -54,7 +54,7 @@ Level_1_Thread(void *arg)
3381 PR_ExitMonitor(mon);
3382 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3383 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
3386 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
3387 @@ -63,14 +63,15 @@ static PRStatus PR_CALLBACK print_thread
3391 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
3392 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
3393 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
3394 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
3395 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
3397 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3398 - registers[0],registers[1],registers[2],registers[3]);
3399 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
3400 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3401 + (unsigned long)registers[0], (unsigned long)registers[1],
3402 + (unsigned long)registers[2], (unsigned long)registers[3]);
3403 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
3407 @@ -98,7 +99,7 @@ static void Level_0_Thread(PRThreadScope
3408 printf("Could not create thread!\n");
3411 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
3412 + printf("Level_0_Thread[%p] created %15s thread %p\n",
3413 PR_GetCurrentThread(),
3414 (scope1 == PR_GLOBAL_THREAD) ?
3415 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3416 @@ -110,9 +111,10 @@ static void Level_0_Thread(PRThreadScope
3417 PR_EnumerateThreads(print_thread, NULL);
3418 registers = PR_GetGCRegisters(me, 1, (int *)&words);
3420 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3421 - registers[0],registers[1],registers[2],registers[3]);
3422 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
3423 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3424 + (unsigned long)registers[0], (unsigned long)registers[1],
3425 + (unsigned long)registers[2], (unsigned long)registers[3]);
3426 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
3429 /* Wait for all threads to exit */
3430 --- pr/tests/switch.c.orig 2022-05-25 21:34:56 UTC
3431 +++ pr/tests/switch.c
3432 @@ -83,7 +83,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
3434 PRBool help = PR_FALSE;
3435 PRUintn concurrency = 1;
3436 - Shared *shared, *link;
3437 + Shared *shared = NULL, *link;
3438 PRIntervalTime timein, timeout;
3439 PRThreadScope thread_scope = PR_LOCAL_THREAD;
3440 PRUintn thread_count, inner_count, loop_count, average;
3441 --- pr/tests/testfile.c.orig 2022-05-25 21:34:56 UTC
3442 +++ pr/tests/testfile.c
3443 @@ -37,6 +37,9 @@ static int _debug_on = 0;
3447 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
3448 +# include <unistd.h> /* getopt(3) */
3451 #define DPRINTF(arg) if (_debug_on) printf arg
3453 @@ -90,7 +93,7 @@ static PRInt32 PR_CALLBACK DirTest(void
3454 PRInt32 dirtest_failed = 0;
3456 PRThread* create_new_thread(PRThreadType type,
3457 - void (*start)(void *arg),
3458 + void *(*start)(void *arg),
3460 PRThreadPriority priority,
3461 PRThreadScope scope,
3462 @@ -155,7 +158,7 @@ PRThread* create_new_thread(PRThreadType
3463 return((PRThread *) thandle);
3466 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3467 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
3470 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3471 @@ -316,8 +319,8 @@ static PRInt32 Misc_File_Tests(char *pat
3473 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3475 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3476 - file_info1.creationTime);
3477 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3478 + (long long)file_info1.creationTime);
3482 @@ -342,8 +345,8 @@ static PRInt32 Misc_File_Tests(char *pat
3484 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3486 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3487 - file_info1.modifyTime);
3488 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3489 + (long long)file_info1.modifyTime);
3493 @@ -469,7 +472,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3494 memset(fparamp->buf, i, len);
3496 t = create_new_thread(PR_USER_THREAD,
3497 - File_Write, (void *)fparamp,
3498 + (void *(*)(void *))File_Write, (void *)fparamp,
3501 PR_UNJOINABLE_THREAD,
3502 @@ -504,7 +507,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3505 t = create_new_thread(PR_USER_THREAD,
3506 - File_Read, (void *)fparamp,
3507 + (void *(*)(void *))File_Read, (void *)fparamp,
3510 PR_UNJOINABLE_THREAD,
3511 @@ -573,7 +576,7 @@ static PRInt32 RunDirTest(void)
3514 t = create_new_thread(PR_USER_THREAD,
3516 + (void *(*)(void *))DirTest, &thrarg,
3519 PR_UNJOINABLE_THREAD,
3520 @@ -897,8 +900,6 @@ int main(int argc, char **argv)
3522 #if defined(XP_UNIX) || defined(XP_OS2)
3524 - extern char *optarg;
3525 - extern int optind;
3527 #if defined(XP_UNIX) || defined(XP_OS2)
3528 while ((opt = getopt(argc, argv, "d")) != EOF) {
3529 --- pr/tests/threads.c.orig 2022-05-25 21:34:56 UTC
3530 +++ pr/tests/threads.c
3531 @@ -27,7 +27,7 @@ void
3533 DumbThread(void *arg)
3535 - PRInt32 tmp = (PRInt32)arg;
3536 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3537 PRThreadScope scope = (PRThreadScope)tmp;
3540 @@ -173,10 +173,10 @@ int main(int argc, char **argv)
3545 -** Tests lots of thread creations. \n\
3546 -** Create %ld native threads %ld times. \n\
3547 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3548 + printf("** Tests lots of thread creations.\n"
3549 + "** Create %d native threads %d times.\n"
3550 + "** Create %d user threads %d times.\n", iterations, count,
3551 + iterations, count);
3554 for (index=0; index<iterations; index++) {
3555 --- pr/tests/thrpool_client.c.orig 2022-05-25 21:34:56 UTC
3556 +++ pr/tests/thrpool_client.c
3557 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3558 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3560 for (rem=len; rem; offset += bytes, rem -= bytes) {
3561 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3562 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3563 PR_GetCurrentThread(), rem));
3564 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3566 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3567 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3568 PR_GetCurrentThread(), bytes));
3571 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3574 for (rem=len; rem; offset += bytes, rem -= bytes) {
3575 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3576 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3577 PR_GetCurrentThread(), rem));
3578 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3579 PR_INTERVAL_NO_TIMEOUT);
3580 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3581 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3582 PR_GetCurrentThread(), bytes));
3585 @@ -165,7 +165,7 @@ TCP_Client(void *arg)
3587 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3588 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3589 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3590 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3591 PR_GetError(), PR_GetOSError());
3594 @@ -174,7 +174,7 @@ TCP_Client(void *arg)
3596 * fill in random data
3598 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3599 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3603 @@ -282,7 +282,7 @@ TCP_Socket_Client_Server_Test(void)
3604 PR_EnterMonitor(mon2);
3606 PR_ExitMonitor(mon2);
3607 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3608 + DPRINTF(("Created TCP client = %p\n", thr));
3610 /* Wait for client jobs to exit */
3611 PR_EnterMonitor(mon2);
3612 @@ -292,9 +292,9 @@ TCP_Socket_Client_Server_Test(void)
3614 PR_ExitMonitor(mon2);
3615 printf("%30s","TCP_Socket_Client_Server_Test:");
3616 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3617 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3618 num_tcp_clients, num_tcp_connections_per_client);
3619 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3620 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3621 num_tcp_mesgs_per_connection, tcp_mesg_size);
3624 --- pr/tests/thrpool_server.c.orig 2022-05-25 21:34:56 UTC
3625 +++ pr/tests/thrpool_server.c
3626 @@ -330,7 +330,7 @@ TCP_Server(void *arg)
3630 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3631 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3632 netaddr.inet.ip, netaddr.inet.port));
3634 sp = PR_NEW(Server_Param);
3635 @@ -342,7 +342,7 @@ TCP_Server(void *arg)
3636 sp->iod.socket = sockfd;
3637 sp->iod.timeout = PR_SecondsToInterval(60);
3638 sp->datalen = tcp_mesg_size;
3639 - sp->exit_mon = sc_mon;
3640 + sp->exit_mon = NULL;
3641 sp->job_counterp = &job_counter;
3642 sp->conn_counter = 0;
3644 @@ -465,7 +465,7 @@ TCP_Server_Accept(void *arg)
3647 PR_ASSERT(NULL != jobp);
3648 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3649 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3652 * single-threaded update; no lock needed
3653 @@ -482,7 +482,7 @@ TCP_Server_Accept(void *arg)
3654 print_stats, sp, PR_FALSE);
3656 PR_ASSERT(NULL != jobp);
3657 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3658 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3661 PR_EnterMonitor(sp->exit_mon);
3662 @@ -499,9 +499,9 @@ exit:
3664 PR_DestroyMonitor(sp->exit_mon);
3665 printf("%30s","TCP_Socket_Client_Server_Test:");
3666 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3667 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3668 num_tcp_clients, num_tcp_connections_per_client);
3669 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3670 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3671 num_tcp_mesgs_per_connection, tcp_mesg_size);
3673 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3674 --- pr/tests/thruput.c.orig 2022-05-25 21:34:56 UTC
3675 +++ pr/tests/thruput.c
3676 @@ -82,7 +82,7 @@ static void PR_CALLBACK Clientel(void *a
3680 - PRInt32 bytes, sampled;
3681 + PRInt32 bytes, sampled = -1;
3682 PRIntervalTime now, interval;
3683 PRBool do_display = PR_FALSE;
3684 Shared *shared = (Shared*)arg;
3685 @@ -196,7 +196,7 @@ static void Client(const char *server_na
3687 static void PR_CALLBACK Servette(void *arg)
3689 - PRInt32 bytes, sampled;
3690 + PRInt32 bytes, sampled = -1;
3691 PRIntervalTime now, interval;
3692 PRBool do_display = PR_FALSE;
3693 PRFileDesc *client = (PRFileDesc*)arg;
3694 @@ -408,6 +408,7 @@ int main(int argc, char **argv)
3702 --- pr/tests/timemac.c.orig 2022-05-25 21:34:56 UTC
3703 +++ pr/tests/timemac.c
3704 @@ -25,7 +25,7 @@ static void printExplodedTime(const PREx
3707 /* Print day of the week, month, day, hour, minute, and second */
3708 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3709 + printf( "%s %s %d %02d:%02d:%02d ",
3710 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3711 et->tm_hour, et->tm_min, et->tm_sec);
3713 @@ -41,7 +41,7 @@ static void printExplodedTime(const PREx
3715 hourOffset = totalOffset / 3600;
3716 minOffset = (totalOffset % 3600) / 60;
3717 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3718 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3722 @@ -98,7 +98,7 @@ int main(int argc, char** argv)
3723 printf("Current local time is ");
3724 printExplodedTime(&et);
3726 - printf("GMT offset is %ld, DST offset is %ld\n",
3727 + printf("GMT offset is %d, DST offset is %d\n",
3728 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3729 t2 = PR_ImplodeTime(&et);
3730 if (LL_NE(t1, t2)) {
3731 --- pr/tests/timetest.c.orig 2022-05-25 21:34:56 UTC
3732 +++ pr/tests/timetest.c
3733 @@ -37,7 +37,7 @@ static void PrintExplodedTime(const PREx
3736 /* Print day of the week, month, day, hour, minute, and second */
3737 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3738 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3739 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3740 et->tm_hour, et->tm_min, et->tm_sec);
3742 @@ -56,7 +56,7 @@ static void PrintExplodedTime(const PREx
3743 hourOffset = totalOffset / 3600;
3744 minOffset = (totalOffset % 3600) / 60;
3746 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3747 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3751 @@ -262,7 +262,7 @@ int main(int argc, char** argv)
3755 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3756 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3757 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3758 t2 = PR_ImplodeTime(&et);
3759 if (LL_NE(t1, t2)) {
3760 --- pr/tests/y2k.c.orig 2022-05-25 21:34:56 UTC
3762 @@ -44,7 +44,7 @@ static void PrintExplodedTime(const PREx
3765 /* Print day of the week, month, day, hour, minute, and second */
3766 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3767 + printf("%s %s %2d %02d:%02d:%02d ",
3768 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3769 et->tm_hour, et->tm_min, et->tm_sec);
3771 @@ -63,7 +63,7 @@ static void PrintExplodedTime(const PREx
3773 hourOffset = totalOffset / 3600;
3774 minOffset = (totalOffset % 3600) / 60;
3775 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3776 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3778 #ifdef PRINT_DETAILS
3779 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3780 --- pr/tests/y2ktmo.c.orig 2022-05-25 21:34:56 UTC
3781 +++ pr/tests/y2ktmo.c
3782 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3784 static void SleepThread(void *arg)
3786 - PRIntervalTime timeout = (PRIntervalTime) arg;
3787 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3788 PRIntervalTime elapsed;
3789 #if defined(XP_UNIX) || defined(WIN32)
3790 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3791 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3793 static void AcceptThread(void *arg)
3795 - PRIntervalTime timeout = (PRIntervalTime) arg;
3796 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3797 PRIntervalTime elapsed;
3798 #if defined(XP_UNIX) || defined(WIN32)
3799 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3800 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3802 static void PollThread(void *arg)
3804 - PRIntervalTime timeout = (PRIntervalTime) arg;
3805 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3806 PRIntervalTime elapsed;
3807 #if defined(XP_UNIX) || defined(WIN32)
3808 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3809 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3811 static void WaitCondVarThread(void *arg)
3813 - PRIntervalTime timeout = (PRIntervalTime) arg;
3814 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3815 PRIntervalTime elapsed;
3816 #if defined(XP_UNIX) || defined(WIN32)
3817 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3818 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3820 static void WaitMonitorThread(void *arg)
3822 - PRIntervalTime timeout = (PRIntervalTime) arg;
3823 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3824 PRIntervalTime elapsed;
3825 #if defined(XP_UNIX) || defined(WIN32)
3826 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3827 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3829 static void WaitCMonitorThread(void *arg)
3831 - PRIntervalTime timeout = (PRIntervalTime) arg;
3832 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3833 PRIntervalTime elapsed;
3834 #if defined(XP_UNIX) || defined(WIN32)
3835 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3836 @@ -532,7 +532,7 @@ int main(int argc, char **argv)
3837 for (i = 0; i < num_thread_scopes; i++) {
3838 for (j = 0; j < num_thread_funcs; j++) {
3839 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3840 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3841 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3842 threadScopes[i], PR_JOINABLE_THREAD, 0);
3843 if (threads[idx] == NULL) {
3844 fprintf(stderr, "PR_CreateThread failed\n");
3845 --- pr/tests/zerolen.c.orig 2022-05-25 21:34:56 UTC
3846 +++ pr/tests/zerolen.c
3847 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3851 - PRUint16 port = (PRUint16) arg;
3852 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3856 @@ -124,7 +124,7 @@ int main()
3857 * First test PR_Writev.
3859 clientThread = PR_CreateThread(PR_USER_THREAD,
3860 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3861 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3862 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3863 if (NULL == clientThread) {
3864 fprintf(stderr, "PR_CreateThread failed\n");
3865 @@ -165,7 +165,7 @@ int main()
3866 * Then test PR_Write.
3868 clientThread = PR_CreateThread(PR_USER_THREAD,
3869 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3870 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3871 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3872 if (NULL == clientThread) {
3873 fprintf(stderr, "PR_CreateThread failed\n");
3874 @@ -204,7 +204,7 @@ int main()
3875 * Finally test PR_Send.
3877 clientThread = PR_CreateThread(PR_USER_THREAD,
3878 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3879 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3880 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3881 if (NULL == clientThread) {
3882 fprintf(stderr, "PR_CreateThread failed\n");
3885 [FILE:1546:patches/patch-warnings]
3886 --- pr/include/prcountr.h.orig 2022-05-25 21:34:56 UTC
3887 +++ pr/include/prcountr.h
3888 @@ -394,7 +394,7 @@ PR_SubtractFromCounter(
3889 #define PR_GET_COUNTER(counter,handle)\
3890 (counter) = PR_GetCounter((handle))
3892 -#define PR_GET_COUNTER(counter,handle) 0
3893 +#define PR_GET_COUNTER(counter,handle)
3897 @@ -468,7 +468,7 @@ PR_SetCounter(
3898 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3899 (next) = PR_FindNextCounterQname((handle))
3901 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3902 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3905 NSPR_API(PRCounterHandle)
3906 --- pr/src/misc/pralarm.c.orig 2022-05-25 21:34:56 UTC
3907 +++ pr/src/misc/pralarm.c
3908 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier
3910 while (why != abort)
3912 - PRIntervalTime pause;
3913 + PRIntervalTime pause = 0;
3915 PR_Lock(alarm->lock);
3917 --- pr/src/misc/prdtoa.c.orig 2022-05-25 21:34:56 UTC
3918 +++ pr/src/misc/prdtoa.c
3919 @@ -2885,9 +2885,9 @@ double dd; int mode, ndigits, *decpt, *s
3920 to hold the suppressed trailing zeros.
3923 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3924 - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3925 - spec_case, try_quick;
3926 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3927 + j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3928 + spec_case, try_quick;
3930 #ifndef Sudden_Underflow