1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Platform-neutral API for system-like functions
8 HOMEPAGE= https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Reference/NSPR_functions
12 SITES[main]= MOZILLA/nspr/releases/v4.35/src
13 DISTFILE[1]= nspr-4.35.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
22 DISTNAME= nspr-4.35/nspr
24 CPE_PRODUCT= netscape_portable_runtime
26 FPC_EQUIVALENT= devel/nspr
29 CONFIGURE_ARGS= --enable-64bit
32 # Do not install tools to build itself
33 ${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
34 ${WRKSRC}/pr/src/misc/Makefile.in
37 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.${LIBEXT}
39 [FILE:207:descriptions/desc.single]
40 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
41 system level and libc like functions. The API is used in the Mozilla
42 client, many of Netscape/AOL/iPlanet's and other software offerings.
46 7ea3297ea5969b5d25a5dd8d47f2443cda88e9ee746301f6e1e1426f8a6abc8f 1096974 nspr-4.35.tar.gz
49 [FILE:1124:manifests/plist.single]
122 include/nspr/obsolete/
127 include/nspr/private/
131 @(,,444) lib/libnspr4.a
132 @(,,444) lib/libnspr4.so
133 @(,,444) lib/libplc4.a
134 @(,,444) lib/libplc4.so
135 @(,,444) lib/libplds4.a
136 @(,,444) lib/libplds4.so
137 lib/pkgconfig/nspr.pc
138 share/aclocal/nspr.m4
141 [FILE:1192:patches/patch-bug301986]
142 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
143 Better to just keep calling it pthread_t isntead of casting to anything.
147 --- pr/include/private/pprthred.h.orig 2022-05-25 21:34:56 UTC
148 +++ pr/include/private/pprthred.h
153 +#include <pthread.h>
157 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
158 ** Get the id of the named thread. Each thread is assigned a unique id
159 ** when it is created or attached.
161 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
162 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
165 ** Set the procedure that is called when a thread is dumped. The procedure
166 --- pr/src/pthreads/ptthread.c.orig 2022-05-25 21:34:56 UTC
167 +++ pr/src/pthreads/ptthread.c
168 @@ -1183,9 +1183,9 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
172 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
173 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
175 - return (PRUint32)thred->id; /* and I don't know what they will do with it */
176 + return thred->id; /* and I don't know what they will do with it */
182 [FILE:489:patches/patch-config_nspr.pc.in]
183 --- config/nspr.pc.in.orig 2022-05-25 21:34:56 UTC
184 +++ config/nspr.pc.in
185 @@ -6,5 +6,5 @@ includedir=@includedir@
187 Description: The Netscape Portable Runtime
188 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
189 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
190 -Cflags: -I@includedir@
191 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
192 +Cflags: -I${includedir}
195 [FILE:2078:patches/patch-configure]
196 --- configure.orig 2022-05-25 21:34:56 UTC
198 @@ -6563,6 +6563,21 @@ tools are selected during the Xcode/Deve
203 + if test -z "$USE_NSPR_THREADS"; then
206 + $as_echo "#define XP_UNIX 1" >>confdefs.h
207 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
208 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
209 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
210 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
212 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
213 + MDCPUCFG_H=_dragonfly.cfg
214 + PR_MD_CSRCS=freebsd.c
218 if test -z "$USE_NSPR_THREADS"; then
220 @@ -7232,7 +7247,6 @@ $as_echo "$as_me: WARNING: Unknown versi
222 MDCPUCFG_H=_solaris.cfg
223 PR_MD_CSRCS=solaris.c
225 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
226 RESOLVE_LINK_SYMBOLS=1
227 case "${OS_RELEASE}" in
228 @@ -7240,7 +7254,6 @@ $as_echo "$as_me: WARNING: Unknown versi
231 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
235 if test -n "$GNU_CC"; then
236 @@ -7936,7 +7949,7 @@ $as_echo_n "checking whether ${CC-cc} ac
237 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
238 ac_cv_have_dash_pthread=yes
241 + freebsd*|dragonfly*)
242 # Freebsd doesn't use -pthread for compiles, it uses them for linking
245 @@ -7974,7 +7987,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
250 + *-freebsd*|*-dragonfly*)
251 $as_echo "#define _REENTRANT 1" >>confdefs.h
253 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
254 @@ -8064,7 +8077,7 @@ case "$target" in
259 +*-freebsd*|*-dragonfly*)
260 if test -n "$USE_NSPR_THREADS"; then
261 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
265 [FILE:29818:patches/patch-libtests]
266 --- lib/tests/arena.c.orig 2022-05-25 21:34:56 UTC
267 +++ lib/tests/arena.c
268 @@ -36,6 +36,7 @@ void DumpAll( void )
274 ** Test Arena allocation.
276 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
279 } /* end ArenaGrow() */
284 --- lib/tests/base64t.c.orig 2022-05-25 21:34:56 UTC
285 +++ lib/tests/base64t.c
286 @@ -2362,7 +2362,6 @@ PRBool test_008(void)
287 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
289 PRUint32 plen = PL_strlen(array[i].plaintext);
290 - PRUint32 clen = ((plen + 2)/3)*4;
292 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
294 @@ -3122,9 +3121,6 @@ PRBool test_024(void)
296 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
298 - PRUint32 plen = PL_strlen(array[i].plaintext);
299 - PRUint32 clen = ((plen + 2)/3)*4;
301 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
303 if( (char *)0 == rv )
304 @@ -3258,8 +3254,6 @@ PRBool test_027(void)
306 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
308 - PRUint32 clen = PL_strlen(array[i].cyphertext);
310 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
312 if( (char *)0 == rv )
313 --- lib/tests/string.c.orig 2022-05-25 21:34:56 UTC
314 +++ lib/tests/string.c
315 @@ -127,7 +127,7 @@ PRBool test_003(void)
316 rv = PL_strcpy(array[i].dest, array[i].str);
317 if( array[i].rv != rv )
319 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
320 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
321 array[i].str ? array[i].str : "(null)", rv);
324 @@ -240,8 +240,8 @@ PRBool test_004(void)
325 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
326 if( array[i].rv != rv )
328 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
329 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
330 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
331 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
335 @@ -367,8 +367,8 @@ PRBool test_005(void)
336 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
337 if( array[i].rv != rv )
339 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
340 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
341 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
342 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
346 @@ -421,7 +421,7 @@ PRBool test_006(void)
348 if( (char *)0 == rv )
350 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
351 + printf("FAIL %d: %p -> 0\n", i, array[i]);
355 @@ -507,8 +507,8 @@ PRBool test_007(void)
357 if( (char *)0 == rv )
359 - printf("FAIL %d: %s,%lu -> 0\n", i,
360 - array[i].str ? array[i].str : "(null)", array[i].len);
361 + printf("FAIL %d: %s,%u -> 0\n", i,
362 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
366 @@ -700,10 +700,10 @@ PRBool test_009(void)
368 if( (char *)0 != rv )
370 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
371 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
372 array[i].first ? array[i].first : "(null)",
373 array[i].second ? array[i].second : "(null)",
374 - array[i].length, rv);
375 + (unsigned)array[i].length, rv);
379 @@ -711,10 +711,10 @@ PRBool test_009(void)
381 if( (char *)0 == rv )
383 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
384 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
385 array[i].first ? array[i].first : "(null)",
386 array[i].second ? array[i].second : "(null)",
387 - array[i].length, array[i].result);
388 + (unsigned)array[i].length, array[i].result);
392 @@ -726,10 +726,10 @@ PRBool test_009(void)
396 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
397 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
398 array[i].first ? array[i].first : "(null)",
399 array[i].second ? array[i].second : "(null)",
400 - array[i].length, rv, array[i].result);
401 + (unsigned)array[i].length, rv, array[i].result);
405 @@ -741,10 +741,10 @@ PRBool test_009(void)
409 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
410 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
411 array[i].first ? array[i].first : "(null)",
412 array[i].second ? array[i].second : "(null)",
414 + (unsigned)array[i].length);
418 @@ -752,10 +752,10 @@ PRBool test_009(void)
422 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
423 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
424 array[i].first ? array[i].first : "(null)",
425 array[i].second ? array[i].second : "(null)",
427 + (unsigned)array[i].length);
431 @@ -832,10 +832,10 @@ PRBool test_010(void)
433 if( (char *)0 != rv )
435 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
436 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
437 array[i].first ? array[i].first : "(null)",
438 array[i].second ? array[i].second : "(null)",
439 - array[i].length, rv);
440 + (unsigned)array[i].length, rv);
444 @@ -843,10 +843,10 @@ PRBool test_010(void)
446 if( (char *)0 == rv )
448 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
449 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
450 array[i].first ? array[i].first : "(null)",
451 array[i].second ? array[i].second : "(null)",
452 - array[i].length, array[i].result);
453 + (unsigned)array[i].length, array[i].result);
457 @@ -858,10 +858,10 @@ PRBool test_010(void)
461 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
462 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
463 array[i].first ? array[i].first : "(null)",
464 array[i].second ? array[i].second : "(null)",
465 - array[i].length, rv, array[i].result);
466 + (unsigned)array[i].length, rv, array[i].result);
470 @@ -1104,10 +1104,10 @@ PRBool test_012(void)
474 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
475 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
476 array[i].one ? array[i].one : "(null)",
477 array[i].two ? array[i].two : "(null)",
478 - array[i].max, rv, array[i].sign);
479 + (int)array[i].max, rv, array[i].sign);
483 @@ -1338,10 +1338,10 @@ PRBool test_014(void)
487 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
488 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
489 array[i].one ? array[i].one : "(null)",
490 array[i].two ? array[i].two : "(null)",
491 - array[i].max, rv, array[i].sign);
492 + (int)array[i].max, rv, array[i].sign);
496 @@ -1411,15 +1411,15 @@ PRBool test_015(void)
498 if( (char *)0 == rv )
500 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
501 - array[i].chr, array[i].off);
502 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
503 + array[i].chr, (unsigned)array[i].off);
507 if( &array[i].str[ array[i].off ] != rv )
509 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
510 - array[i].chr, rv, array[i].str, array[i].off);
511 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
512 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
516 @@ -1491,15 +1491,15 @@ PRBool test_016(void)
518 if( (char *)0 == rv )
520 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
521 - array[i].chr, array[i].off);
522 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
523 + array[i].chr, (unsigned)array[i].off);
527 if( &array[i].str[ array[i].off ] != rv )
529 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
530 - array[i].chr, rv, array[i].str, array[i].off);
531 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
532 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
536 @@ -1566,8 +1566,8 @@ PRBool test_017(void)
538 if( (char *)0 != rv )
540 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
541 - array[i].chr, array[i].max, rv);
542 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
543 + array[i].chr, (unsigned)array[i].max, rv);
547 @@ -1575,15 +1575,15 @@ PRBool test_017(void)
549 if( (char *)0 == rv )
551 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
552 - array[i].chr, array[i].max, array[i].off);
553 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
554 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
558 if( &array[i].str[ array[i].off ] != rv )
560 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
561 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
562 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
563 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
567 @@ -1650,8 +1650,8 @@ PRBool test_018(void)
569 if( (char *)0 != rv )
571 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
572 - array[i].chr, array[i].max, rv);
573 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
574 + array[i].chr, (unsigned)array[i].max, rv);
578 @@ -1659,15 +1659,15 @@ PRBool test_018(void)
580 if( (char *)0 == rv )
582 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
583 - array[i].chr, array[i].max, array[i].off);
584 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
585 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
589 - if( &array[i].str[ array[i].off ] != rv )
590 + if( &array[i].str[ array[i].off ] != rv)
592 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
593 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
594 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
595 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
599 @@ -1746,19 +1746,19 @@ PRBool test_019(void)
601 if( (char *)0 == rv )
603 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
604 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
605 array[i].str ? array[i].str : "(null)",
606 array[i].chrs ? array[i].chrs : "(null)",
608 + (unsigned)array[i].off);
612 if( &array[i].str[ array[i].off ] != rv )
614 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
615 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
616 array[i].str ? array[i].str : "(null)",
617 array[i].chrs ? array[i].chrs : "(null)",
618 - rv, array[i].str, array[i].off);
619 + rv, array[i].str, (unsigned)array[i].off);
623 @@ -1837,19 +1837,19 @@ PRBool test_020(void)
625 if( (char *)0 == rv )
627 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
628 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
629 array[i].str ? array[i].str : "(null)",
630 array[i].chrs ? array[i].chrs : "(null)",
632 + (unsigned)array[i].off);
636 if( &array[i].str[ array[i].off ] != rv )
638 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
639 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
640 array[i].str ? array[i].str : "(null)",
641 array[i].chrs ? array[i].chrs : "(null)",
642 - rv, array[i].str, array[i].off);
643 + rv, array[i].str, (unsigned)array[i].off);
647 @@ -1923,10 +1923,10 @@ PRBool test_021(void)
649 if( (char *)0 != rv )
651 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
652 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
653 array[i].str ? array[i].str : "(null)",
654 array[i].chrs ? array[i].chrs : "(null)",
656 + (unsigned)array[i].max, rv);
660 @@ -1934,19 +1934,19 @@ PRBool test_021(void)
662 if( (char *)0 == rv )
664 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
665 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
666 array[i].str ? array[i].str : "(null)",
667 array[i].chrs ? array[i].chrs : "(null)",
668 - array[i].max, array[i].off);
669 + (unsigned)array[i].max, array[i].off);
673 if( &array[i].str[ array[i].off ] != rv )
675 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
676 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
677 array[i].str ? array[i].str : "(null)",
678 array[i].chrs ? array[i].chrs : "(null)",
679 - array[i].max, rv, array[i].str, array[i].off);
680 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
684 @@ -2029,10 +2029,10 @@ PRBool test_022(void)
686 if( (char *)0 != rv )
688 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
689 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
690 array[i].str ? array[i].str : "(null)",
691 array[i].chrs ? array[i].chrs : "(null)",
693 + (unsigned)array[i].max, rv);
697 @@ -2040,19 +2040,19 @@ PRBool test_022(void)
699 if( (char *)0 == rv )
701 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
702 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
703 array[i].str ? array[i].str : "(null)",
704 array[i].chrs ? array[i].chrs : "(null)",
705 - array[i].max, array[i].off);
706 + (unsigned)array[i].max, array[i].off);
710 if( &array[i].str[ array[i].off ] != rv )
712 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
713 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
714 array[i].str ? array[i].str : "(null)",
715 array[i].chrs ? array[i].chrs : "(null)",
716 - array[i].max, rv, array[i].str, array[i].off);
717 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
721 @@ -2148,19 +2148,19 @@ PRBool test_023(void)
723 if( (char *)0 == rv )
725 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
726 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
727 array[i].str ? array[i].str : "(null)",
728 array[i].sub ? array[i].sub : "(null)",
729 - array[i].str, array[i].off);
730 + array[i].str, (unsigned)array[i].off);
734 if( &array[i].str[ array[i].off ] != rv )
736 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
737 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
738 array[i].str ? array[i].str : "(null)",
739 array[i].sub ? array[i].sub : "(null)",
740 - rv, array[i].str, array[i].off);
741 + rv, array[i].str, (unsigned)array[i].off);
745 @@ -2256,19 +2256,19 @@ PRBool test_024(void)
747 if( (char *)0 == rv )
749 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
750 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
751 array[i].str ? array[i].str : "(null)",
752 array[i].sub ? array[i].sub : "(null)",
753 - array[i].str, array[i].off);
754 + array[i].str, (unsigned)array[i].off);
758 if( &array[i].str[ array[i].off ] != rv )
760 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
761 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
762 array[i].str ? array[i].str : "(null)",
763 array[i].sub ? array[i].sub : "(null)",
764 - rv, array[i].str, array[i].off);
765 + rv, array[i].str, (unsigned)array[i].off);
769 @@ -2375,10 +2375,10 @@ PRBool test_025(void)
771 if( (char *)0 != rv )
773 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
774 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
775 array[i].str ? array[i].str : "(null)",
776 array[i].sub ? array[i].sub : "(null)",
778 + (unsigned)array[i].max, rv);
782 @@ -2386,19 +2386,19 @@ PRBool test_025(void)
784 if( (char *)0 == rv )
786 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
787 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
788 array[i].str ? array[i].str : "(null)",
789 array[i].sub ? array[i].sub : "(null)",
790 - array[i].max, array[i].str, array[i].off);
791 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
795 if( &array[i].str[ array[i].off ] != rv )
797 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
798 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
799 array[i].str ? array[i].str : "(null)",
800 array[i].sub ? array[i].sub : "(null)",
801 - array[i].max, rv, array[i].str, array[i].off);
802 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
806 @@ -2507,10 +2507,10 @@ PRBool test_026(void)
808 if( (char *)0 != rv )
810 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
811 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
812 array[i].str ? array[i].str : "(null)",
813 array[i].sub ? array[i].sub : "(null)",
815 + (unsigned)array[i].max, rv);
819 @@ -2518,19 +2518,19 @@ PRBool test_026(void)
821 if( (char *)0 == rv )
823 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
824 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
825 array[i].str ? array[i].str : "(null)",
826 array[i].sub ? array[i].sub : "(null)",
827 - array[i].max, array[i].str, array[i].off);
828 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
832 if( &array[i].str[ array[i].off ] != rv )
834 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
835 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
836 array[i].str ? array[i].str : "(null)",
837 array[i].sub ? array[i].sub : "(null)",
838 - array[i].max, rv, array[i].str, array[i].off);
839 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
843 @@ -2626,19 +2626,19 @@ PRBool test_027(void)
845 if( (char *)0 == rv )
847 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
848 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
849 array[i].str ? array[i].str : "(null)",
850 array[i].sub ? array[i].sub : "(null)",
851 - array[i].str, array[i].off);
852 + array[i].str, (unsigned)array[i].off);
856 if( &array[i].str[ array[i].off ] != rv )
858 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
859 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
860 array[i].str ? array[i].str : "(null)",
861 array[i].sub ? array[i].sub : "(null)",
862 - rv, array[i].str, array[i].off);
863 + rv, array[i].str, (unsigned)array[i].off);
867 @@ -2734,19 +2734,19 @@ PRBool test_028(void)
869 if( (char *)0 == rv )
871 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
872 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
873 array[i].str ? array[i].str : "(null)",
874 array[i].sub ? array[i].sub : "(null)",
875 - array[i].str, array[i].off);
876 + array[i].str, (unsigned)array[i].off);
880 if( &array[i].str[ array[i].off ] != rv )
882 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
883 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
884 array[i].str ? array[i].str : "(null)",
885 array[i].sub ? array[i].sub : "(null)",
886 - rv, array[i].str, array[i].off);
887 + rv, array[i].str, (unsigned)array[i].off);
891 @@ -2853,10 +2853,10 @@ PRBool test_029(void)
893 if( (char *)0 != rv )
895 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
896 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
897 array[i].str ? array[i].str : "(null)",
898 array[i].sub ? array[i].sub : "(null)",
900 + (unsigned)array[i].max, rv);
904 @@ -2864,19 +2864,19 @@ PRBool test_029(void)
906 if( (char *)0 == rv )
908 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
909 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
910 array[i].str ? array[i].str : "(null)",
911 array[i].sub ? array[i].sub : "(null)",
912 - array[i].max, array[i].str, array[i].off);
913 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
917 if( &array[i].str[ array[i].off ] != rv )
919 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
920 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
921 array[i].str ? array[i].str : "(null)",
922 array[i].sub ? array[i].sub : "(null)",
923 - array[i].max, rv, array[i].str, array[i].off);
924 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
928 @@ -2985,10 +2985,10 @@ PRBool test_030(void)
930 if( (char *)0 != rv )
932 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
933 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
934 array[i].str ? array[i].str : "(null)",
935 array[i].sub ? array[i].sub : "(null)",
937 + (unsigned)array[i].max, rv);
941 @@ -2996,19 +2996,19 @@ PRBool test_030(void)
943 if( (char *)0 == rv )
945 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
946 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
947 array[i].str ? array[i].str : "(null)",
948 array[i].sub ? array[i].sub : "(null)",
949 - array[i].max, array[i].str, array[i].off);
950 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
954 if( &array[i].str[ array[i].off ] != rv )
956 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
957 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
958 array[i].str ? array[i].str : "(null)",
959 array[i].sub ? array[i].sub : "(null)",
960 - array[i].max, rv, array[i].str, array[i].off);
961 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
967 [FILE:6203:patches/patch-pr_include_md___dragonfly.cfg]
968 --- /dev/null 2022-09-16 19:41:29 UTC
969 +++ pr/include/md/_dragonfly.cfg
971 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
972 +/* This Source Code Form is subject to the terms of the Mozilla Public
973 + * License, v. 2.0. If a copy of the MPL was not distributed with this
974 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
976 +#ifndef nspr_cpucfg___
977 +#define nspr_cpucfg___
983 +#define PR_AF_INET6 28 /* same as AF_INET6 */
985 +#ifndef HAVE_LONG_LONG
986 +#define HAVE_LONG_LONG
989 +#if defined(__i386__)
991 +#define IS_LITTLE_ENDIAN 1
992 +#undef IS_BIG_ENDIAN
993 +#undef HAVE_ALIGNED_DOUBLES
994 +#undef HAVE_ALIGNED_LONGLONGS
996 +#define PR_BYTES_PER_BYTE 1
997 +#define PR_BYTES_PER_SHORT 2
998 +#define PR_BYTES_PER_INT 4
999 +#define PR_BYTES_PER_INT64 8
1000 +#define PR_BYTES_PER_LONG 4
1001 +#define PR_BYTES_PER_FLOAT 4
1002 +#define PR_BYTES_PER_DOUBLE 8
1003 +#define PR_BYTES_PER_WORD 4
1004 +#define PR_BYTES_PER_DWORD 8
1005 +#define PR_BYTES_PER_WORD_LOG2 2
1006 +#define PR_BYTES_PER_DWORD_LOG2 3
1008 +#define PR_BITS_PER_BYTE 8
1009 +#define PR_BITS_PER_SHORT 16
1010 +#define PR_BITS_PER_INT 32
1011 +#define PR_BITS_PER_INT64 64
1012 +#define PR_BITS_PER_LONG 32
1013 +#define PR_BITS_PER_FLOAT 32
1014 +#define PR_BITS_PER_DOUBLE 64
1015 +#define PR_BITS_PER_WORD 32
1017 +#define PR_BITS_PER_BYTE_LOG2 3
1018 +#define PR_BITS_PER_SHORT_LOG2 4
1019 +#define PR_BITS_PER_INT_LOG2 5
1020 +#define PR_BITS_PER_INT64_LOG2 6
1021 +#define PR_BITS_PER_LONG_LOG2 5
1022 +#define PR_BITS_PER_FLOAT_LOG2 5
1023 +#define PR_BITS_PER_DOUBLE_LOG2 6
1024 +#define PR_BITS_PER_WORD_LOG2 5
1026 +#define PR_ALIGN_OF_SHORT 2
1027 +#define PR_ALIGN_OF_INT 4
1028 +#define PR_ALIGN_OF_LONG 4
1029 +#define PR_ALIGN_OF_INT64 4
1030 +#define PR_ALIGN_OF_FLOAT 4
1031 +#define PR_ALIGN_OF_DOUBLE 4
1032 +#define PR_ALIGN_OF_POINTER 4
1034 +#elif defined(__alpha__)
1036 +#define IS_LITTLE_ENDIAN 1
1037 +#undef IS_BIG_ENDIAN
1038 +#define HAVE_ALIGNED_DOUBLES
1039 +#define HAVE_ALIGNED_LONGLONGS
1042 +#define PR_BYTES_PER_BYTE 1
1043 +#define PR_BYTES_PER_SHORT 2
1044 +#define PR_BYTES_PER_INT 4
1045 +#define PR_BYTES_PER_INT64 8
1046 +#define PR_BYTES_PER_LONG 8
1047 +#define PR_BYTES_PER_FLOAT 4
1048 +#define PR_BYTES_PER_DOUBLE 8
1049 +#define PR_BYTES_PER_WORD 8
1050 +#define PR_BYTES_PER_DWORD 8
1051 +#define PR_BYTES_PER_WORD_LOG2 3
1052 +#define PR_BYTES_PER_DWORD_LOG2 3
1054 +#define PR_BITS_PER_BYTE 8
1055 +#define PR_BITS_PER_SHORT 16
1056 +#define PR_BITS_PER_INT 32
1057 +#define PR_BITS_PER_INT64 64
1058 +#define PR_BITS_PER_LONG 64
1059 +#define PR_BITS_PER_FLOAT 32
1060 +#define PR_BITS_PER_DOUBLE 64
1061 +#define PR_BITS_PER_WORD 64
1063 +#define PR_BITS_PER_BYTE_LOG2 3
1064 +#define PR_BITS_PER_SHORT_LOG2 4
1065 +#define PR_BITS_PER_INT_LOG2 5
1066 +#define PR_BITS_PER_INT64_LOG2 6
1067 +#define PR_BITS_PER_LONG_LOG2 6
1068 +#define PR_BITS_PER_FLOAT_LOG2 5
1069 +#define PR_BITS_PER_DOUBLE_LOG2 6
1070 +#define PR_BITS_PER_WORD_LOG2 6
1072 +#define PR_ALIGN_OF_SHORT 2
1073 +#define PR_ALIGN_OF_INT 4
1074 +#define PR_ALIGN_OF_LONG 8
1075 +#define PR_ALIGN_OF_INT64 8
1076 +#define PR_ALIGN_OF_FLOAT 4
1077 +#define PR_ALIGN_OF_DOUBLE 8
1078 +#define PR_ALIGN_OF_POINTER 8
1080 +#elif defined(__amd64__)
1082 +#define IS_LITTLE_ENDIAN 1
1083 +#undef IS_BIG_ENDIAN
1084 +#define HAVE_ALIGNED_DOUBLES
1085 +#define HAVE_ALIGNED_LONGLONGS
1088 +#define PR_BYTES_PER_BYTE 1
1089 +#define PR_BYTES_PER_SHORT 2
1090 +#define PR_BYTES_PER_INT 4
1091 +#define PR_BYTES_PER_INT64 8
1092 +#define PR_BYTES_PER_LONG 8
1093 +#define PR_BYTES_PER_FLOAT 4
1094 +#define PR_BYTES_PER_DOUBLE 8
1095 +#define PR_BYTES_PER_WORD 8
1096 +#define PR_BYTES_PER_DWORD 8
1097 +#define PR_BYTES_PER_WORD_LOG2 3
1098 +#define PR_BYTES_PER_DWORD_LOG2 3
1100 +#define PR_BITS_PER_BYTE 8
1101 +#define PR_BITS_PER_SHORT 16
1102 +#define PR_BITS_PER_INT 32
1103 +#define PR_BITS_PER_INT64 64
1104 +#define PR_BITS_PER_LONG 64
1105 +#define PR_BITS_PER_FLOAT 32
1106 +#define PR_BITS_PER_DOUBLE 64
1107 +#define PR_BITS_PER_WORD 64
1109 +#define PR_BITS_PER_BYTE_LOG2 3
1110 +#define PR_BITS_PER_SHORT_LOG2 4
1111 +#define PR_BITS_PER_INT_LOG2 5
1112 +#define PR_BITS_PER_INT64_LOG2 6
1113 +#define PR_BITS_PER_LONG_LOG2 6
1114 +#define PR_BITS_PER_FLOAT_LOG2 5
1115 +#define PR_BITS_PER_DOUBLE_LOG2 6
1116 +#define PR_BITS_PER_WORD_LOG2 6
1118 +#define PR_ALIGN_OF_SHORT 2
1119 +#define PR_ALIGN_OF_INT 4
1120 +#define PR_ALIGN_OF_LONG 8
1121 +#define PR_ALIGN_OF_INT64 8
1122 +#define PR_ALIGN_OF_FLOAT 4
1123 +#define PR_ALIGN_OF_DOUBLE 8
1124 +#define PR_ALIGN_OF_POINTER 8
1125 +#define PR_ALIGN_OF_WORD 8
1129 +#error "Unknown CPU architecture"
1133 +#ifndef NO_NSPR_10_SUPPORT
1135 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
1136 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
1137 +#define BYTES_PER_INT PR_BYTES_PER_INT
1138 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
1139 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
1140 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
1141 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
1142 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
1143 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
1145 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
1146 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
1147 +#define BITS_PER_INT PR_BITS_PER_INT
1148 +#define BITS_PER_INT64 PR_BITS_PER_INT64
1149 +#define BITS_PER_LONG PR_BITS_PER_LONG
1150 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
1151 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
1152 +#define BITS_PER_WORD PR_BITS_PER_WORD
1154 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
1155 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
1156 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
1157 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
1158 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
1159 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
1160 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
1161 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
1163 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
1164 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
1165 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
1166 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
1167 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
1168 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
1169 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
1170 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
1172 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
1173 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
1174 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
1176 +#endif /* NO_NSPR_10_SUPPORT */
1178 +#endif /* nspr_cpucfg___ */
1181 [FILE:6201:patches/patch-pr_include_md___dragonfly.h]
1182 --- /dev/null 2022-09-16 19:41:29 UTC
1183 +++ pr/include/md/_dragonfly.h
1185 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
1186 +/* This Source Code Form is subject to the terms of the Mozilla Public
1187 + * License, v. 2.0. If a copy of the MPL was not distributed with this
1188 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1190 +#ifndef nspr_dragonfly_defs_h___
1191 +#define nspr_dragonfly_defs_h___
1193 +#include "prthread.h"
1196 +#if __FreeBSD__ >= 2
1197 +#include <osreldate.h> /* for __FreeBSD_version */
1199 +#include <sys/syscall.h>
1202 +#define PR_LINKER_ARCH "dragonfly"
1203 +#define _PR_SI_SYSNAME "DRAGONFLY"
1204 +#if defined(__i386__)
1205 +#define _PR_SI_ARCHITECTURE "x86"
1206 +#elif defined(__amd64__)
1207 +#define _PR_SI_ARCHITECTURE "amd64"
1209 +#error "Unknown CPU architecture"
1212 +#define PR_DLL_SUFFIX ".so"
1214 +#define _PR_VMBASE 0x30000000
1215 +#define _PR_STACK_VMBASE 0x50000000
1216 +#define _MD_DEFAULT_STACK_SIZE 65536L
1217 +#define _MD_MMAP_FLAGS MAP_PRIVATE
1219 +#undef HAVE_STACK_GROWING_UP
1222 +#define _PR_HAVE_SOCKADDR_LEN
1223 +#define _PR_STAT_HAS_ST_ATIMESPEC
1224 +#define _PR_HAVE_LARGE_OFF_T
1226 +#define _PR_HAVE_GETPROTO_R
1227 +#define _PR_HAVE_5_ARG_GETPROTO_R
1228 +#define _PR_HAVE_GETHOST_R
1229 +#define _PR_HAVE_GETHOST_R_INT
1231 +#define _PR_POLL_AVAILABLE
1233 +#define _PR_HAVE_SYSV_SEMAPHORES
1234 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
1237 +#define _PR_HAVE_INET_NTOP
1238 +#define _PR_HAVE_GETHOSTBYNAME2
1239 +#define _PR_HAVE_GETADDRINFO
1240 +#define _PR_INET6_PROBE
1241 +#define _PR_IPV6_V6ONLY_PROBE
1245 +#ifndef _PR_PTHREADS
1246 +#include <setjmp.h>
1248 +#define PR_CONTEXT_TYPE sigjmp_buf
1250 +#define CONTEXT(_th) ((_th)->md.context)
1252 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
1253 +#define PR_NUM_GCREGS _JBLEN
1256 +** Initialize a thread context to run "_main()" when started
1258 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
1260 + *status = PR_TRUE; \
1261 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
1264 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
1267 +#define _MD_SWITCH_CONTEXT(_thread) \
1268 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
1269 + (_thread)->md.errcode = errno; \
1274 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
1276 +#define _MD_RESTORE_CONTEXT(_thread) \
1278 + errno = (_thread)->md.errcode; \
1279 + _MD_SET_CURRENT_THREAD(_thread); \
1280 + siglongjmp(CONTEXT(_thread), 1); \
1283 +/* Machine-dependent (MD) data structures */
1286 + PR_CONTEXT_TYPE context;
1291 +struct _MDThreadStack {
1299 +struct _MDSemaphore {
1307 +struct _MDSegment {
1312 + * md-specific cpu structure field
1314 +#define _PR_MD_MAX_OSFD FD_SETSIZE
1316 +struct _MDCPU_Unix {
1318 + PRUint32 ioq_timeout;
1319 + PRInt32 ioq_max_osfd;
1320 + PRInt32 ioq_osfd_cnt;
1321 +#ifndef _PR_USE_POLL
1322 + fd_set fd_read_set, fd_write_set, fd_exception_set;
1323 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
1324 + fd_exception_cnt[_PR_MD_MAX_OSFD];
1326 + struct pollfd *ioq_pollfds;
1327 + int ioq_pollfds_size;
1328 +#endif /* _PR_USE_POLL */
1331 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
1332 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
1333 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
1334 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
1335 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
1336 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
1337 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
1338 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
1339 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
1340 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
1341 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
1342 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
1343 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
1345 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
1348 + struct _MDCPU_Unix md_unix;
1351 +#define _MD_INIT_LOCKS()
1352 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
1353 +#define _MD_FREE_LOCK(lock)
1354 +#define _MD_LOCK(lock)
1355 +#define _MD_UNLOCK(lock)
1356 +#define _MD_INIT_IO()
1357 +#define _MD_IOQ_LOCK()
1358 +#define _MD_IOQ_UNLOCK()
1360 +extern PRStatus _MD_InitializeThread(PRThread *thread);
1362 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
1363 +#define _MD_INIT_THREAD _MD_InitializeThread
1364 +#define _MD_EXIT_THREAD(thread)
1365 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
1366 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
1367 +#define _MD_CLEAN_THREAD(_thread)
1369 +extern PRStatus _MD_CREATE_THREAD(
1371 + void (*start) (void *),
1372 + PRThreadPriority priority,
1373 + PRThreadScope scope,
1374 + PRThreadState state,
1375 + PRUint32 stackSize);
1376 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
1377 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
1378 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
1379 +extern void _MD_YIELD(void);
1381 +#endif /* ! _PR_PTHREADS */
1383 +extern void _MD_EarlyInit(void);
1385 +#define _MD_EARLY_INIT _MD_EarlyInit
1386 +#define _MD_FINAL_INIT _PR_UnixInit
1387 +#define _MD_INTERVAL_USE_GTOD
1390 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
1391 + * unwrapped version.
1393 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
1395 +#if defined(_PR_POLL_AVAILABLE)
1397 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
1400 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
1401 + want to be including that.. */
1402 +#ifndef INADDR_LOOPBACK
1403 +#define INADDR_LOOPBACK (u_long)0x7F000001
1407 +#include <sys/uio.h>
1409 +#endif /* nspr_freebsd_defs_h___ */
1412 [FILE:1099:patches/patch-pr_include_md___freebsd.h]
1413 --- pr/include/md/_freebsd.h.orig 2022-05-25 21:34:56 UTC
1414 +++ pr/include/md/_freebsd.h
1416 #define _PR_HAVE_LARGE_OFF_T
1418 #if defined(_PR_PTHREADS)
1419 -#if __FreeBSD_version >= 400008
1420 +#if defined(__DragonFly__) || __FreeBSD_version >= 602000
1421 +#define _PR_HAVE_GETPROTO_R
1422 +#define _PR_HAVE_5_ARG_GETPROTO_R
1424 +#if __FreeBSD_version >= 700016
1425 +#define _PR_HAVE_GETHOST_R
1426 +#define _PR_HAVE_GETHOST_R_INT
1428 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
1430 * libc_r before this version of FreeBSD doesn't have poll().
1431 * Although libc has poll(), it is not thread-safe so we can't
1433 #define _PR_POLL_AVAILABLE
1436 -#if __FreeBSD_version >= 300000
1437 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
1438 #define _PR_POLL_AVAILABLE
1439 #define _PR_USE_POLL
1442 #define _PR_HAVE_SYSV_SEMAPHORES
1443 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
1445 -#if __FreeBSD_version >= 400014
1446 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
1448 #define _PR_HAVE_INET_NTOP
1449 #define _PR_HAVE_GETHOSTBYNAME2
1452 [FILE:1235:patches/patch-pr_include_md___pth.h]
1453 --- pr/include/md/_pth.h.orig 2022-05-25 21:34:56 UTC
1454 +++ pr/include/md/_pth.h
1457 #if defined(AIX) || defined(SOLARIS) \
1458 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1459 + || defined(__DragonFly__) \
1460 || defined(HPUX) || defined(FREEBSD) \
1461 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
1462 || defined(NTO) || defined(DARWIN) \
1464 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
1465 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
1466 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1467 + || defined(__DragonFly__) \
1469 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
1470 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
1471 @@ -175,6 +177,7 @@ extern int (*_PT_aix_yield_fcn)();
1472 #define _PT_PTHREAD_YIELD() (*_PT_aix_yield_fcn)()
1473 #elif defined(HPUX) || defined(SOLARIS) \
1474 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1475 + || defined(__DragonFly__) \
1476 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1477 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1478 || defined(UNIXWARE) || defined(RISCOS)
1481 [FILE:279:patches/patch-pr_include_md_prosdep.h]
1482 --- pr/include/md/prosdep.h.orig 2022-05-25 21:34:56 UTC
1483 +++ pr/include/md/prosdep.h
1484 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
1485 #elif defined(OPENBSD)
1486 #include "md/_openbsd.h"
1488 +#elif defined(__DragonFly__)
1489 +#include "md/_dragonfly.h"
1492 #include "md/_bsdi.h"
1496 [FILE:403:patches/patch-pr_src_md_unix_uxrng.c]
1497 --- pr/src/md/unix/uxrng.c.orig 2022-05-25 21:34:56 UTC
1498 +++ pr/src/md/unix/uxrng.c
1499 @@ -64,6 +64,7 @@ GetHighResClock(void *buf, size_t maxbyt
1501 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
1502 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
1503 + || defined(__DragonFly__) \
1504 || defined(__GNU__))
1505 #include <sys/types.h>
1506 #include <sys/stat.h>
1509 [FILE:699:patches/patch-pr_src_misc_prnetdb.c]
1510 --- pr/src/misc/prnetdb.c.orig 2022-05-25 21:34:56 UTC
1511 +++ pr/src/misc/prnetdb.c
1512 @@ -73,11 +73,6 @@ PRLock *_pr_dnsLock = NULL;
1513 #define _PR_HAVE_GETPROTO_R_INT
1516 -#if __FreeBSD_version >= 602000
1517 -#define _PR_HAVE_GETPROTO_R
1518 -#define _PR_HAVE_5_ARG_GETPROTO_R
1521 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
1522 #if (defined(__GLIBC__) && __GLIBC__ >= 2)
1523 #define _PR_HAVE_GETPROTO_R
1524 @@ -302,7 +297,7 @@ _pr_QueryNetIfs(void)
1527 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
1528 - || defined(NETBSD) || defined(OPENBSD)
1529 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
1532 * Use the BSD getifaddrs function.
1535 [FILE:1246:patches/patch-pr_src_pthreads_ptio.c]
1536 --- pr/src/pthreads/ptio.c.orig 2022-05-25 21:34:56 UTC
1537 +++ pr/src/pthreads/ptio.c
1538 @@ -191,6 +191,7 @@ static PRBool _pr_ipv6_v6only_on_by_defa
1539 || defined(HPUX10_30) || defined(HPUX11) \
1540 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1541 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
1542 + || defined(__DragonFly__) \
1543 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
1544 || defined(UNIXWARE) || defined(RISCOS)
1545 #define _PRSelectFdSetArg_t fd_set *
1546 @@ -3523,6 +3524,7 @@ static PRIOMethods _pr_socketpollfd_meth
1547 #if defined(HPUX) || defined(SOLARIS) \
1548 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
1549 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
1550 + || defined(__DragonFly__) \
1551 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
1552 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS)
1553 #define _PR_FCNTL_FLAGS O_NONBLOCK
1554 @@ -5309,6 +5311,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
1556 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
1558 + start = 0; /* Not needed, but shuts down a warning */
1560 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
1561 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
1564 [FILE:836:patches/patch-pr_src_pthreads_ptsynch.c]
1565 --- pr/src/pthreads/ptsynch.c.orig 2022-05-25 21:34:56 UTC
1566 +++ pr/src/pthreads/ptsynch.c
1567 @@ -25,7 +25,7 @@ static pthread_condattr_t _pt_cvar_attr;
1568 extern PTDebug pt_debug; /* this is shared between several modules */
1569 #endif /* defined(DEBUG) */
1571 -#if defined(FREEBSD)
1572 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
1574 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
1575 * Newer versions return EBUSY. We still need to support both.
1576 @@ -952,6 +952,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
1578 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
1579 || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
1580 + || defined(__DragonFly__) \
1581 || defined(OPENBSD) || defined(BSDI) \
1583 /* union semun is defined by including <sys/sem.h> */
1586 [FILE:83892:patches/patch-tests]
1587 --- lib/tests/Makefile.in.orig 2022-05-25 21:34:56 UTC
1588 +++ lib/tests/Makefile.in
1589 @@ -159,7 +159,7 @@ else
1590 ifeq ($(OS_ARCH),OS2)
1591 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1593 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1594 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1598 --- pr/tests/cleanup.c.orig 2022-05-25 21:34:56 UTC
1599 +++ pr/tests/cleanup.c
1602 static void PR_CALLBACK Thread(void *sleep)
1604 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1605 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1606 printf("Thread exiting\n");
1609 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1610 PRThreadScope type = PR_LOCAL_THREAD;
1611 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1612 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1613 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1614 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1615 + intptr_t child_sleep = 10;
1618 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1619 @@ -82,7 +83,7 @@ int main(int argc, char **argv)
1620 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1621 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1622 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1623 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1624 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1625 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1626 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1628 --- pr/tests/cltsrv.c.orig 2022-05-25 21:34:56 UTC
1629 +++ pr/tests/cltsrv.c
1630 @@ -949,7 +949,7 @@ int main(int argc, char** argv)
1634 - CSClient_t *client;
1635 + CSClient_t *client = NULL;
1636 PRStatus rv, joinStatus;
1637 CSServer_t *server = NULL;
1639 --- pr/tests/cvar.c.orig 2022-05-25 21:34:56 UTC
1641 @@ -138,15 +138,15 @@ static int alive;
1642 static void PR_CALLBACK CXReader(void *arg)
1644 CircBuf *cbp = (CircBuf *)arg;
1650 for (i = 0; i < n; i++) {
1651 data = GetCBData(cbp);
1652 - if ((int)data != i)
1653 + if ((intptr_t)data != i)
1655 - printf("data mismatch at for i = %d usec\n", i);
1656 + printf("data mismatch at for i = %ld usec\n", (long)i);
1660 @@ -159,7 +159,7 @@ static void PR_CALLBACK CXReader(void *a
1661 static void PR_CALLBACK CXWriter(void *arg)
1663 CircBuf *cbp = (CircBuf *)arg;
1668 for (i = 0; i < n; i++) {
1669 --- pr/tests/cvar2.c.orig 2022-05-25 21:34:56 UTC
1670 +++ pr/tests/cvar2.c
1671 @@ -96,7 +96,7 @@ PrivateCondVarThread(void *_info)
1672 for (index=0; index<info->loops; index++) {
1673 PR_Lock(info->lock);
1674 if (*info->tcount == 0) {
1675 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1676 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1677 PR_GetCurrentThread(), info->cvar));
1678 PR_WaitCondVar(info->cvar, info->timeout);
1680 @@ -109,8 +109,8 @@ PrivateCondVarThread(void *_info)
1681 PR_Lock(info->exitlock);
1682 (*info->exitcount)++;
1683 PR_NotifyCondVar(info->exitcvar);
1684 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1685 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1686 + DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1687 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1688 PR_Unlock(info->exitlock);
1691 @@ -159,7 +159,7 @@ CreateTestThread(threadinfo *info,
1693 CondVarTestSUU(void *_arg)
1695 - PRInt32 arg = (PRInt32)_arg;
1696 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1697 PRInt32 index, loops;
1700 @@ -191,7 +191,7 @@ CondVarTestSUU(void *_arg)
1704 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1705 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1708 for (loops = 0; loops < count; loops++) {
1709 @@ -201,7 +201,7 @@ CondVarTestSUU(void *_arg)
1710 (*list[index].tcount)++;
1711 PR_NotifyCondVar(list[index].cvar);
1712 PR_Unlock(list[index].lock);
1713 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1714 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1715 PR_GetCurrentThread(), list[index].cvar));
1718 @@ -231,7 +231,7 @@ CondVarTestSUU(void *_arg)
1720 CondVarTestSUK(void *_arg)
1722 - PRInt32 arg = (PRInt32)_arg;
1723 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1724 PRInt32 index, loops;
1727 @@ -307,7 +307,7 @@ CondVarTestSUK(void *_arg)
1729 CondVarTestPUU(void *_arg)
1731 - PRInt32 arg = (PRInt32)_arg;
1732 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1733 PRInt32 index, loops;
1736 @@ -342,7 +342,7 @@ CondVarTestPUU(void *_arg)
1740 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1741 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1745 @@ -360,8 +360,8 @@ CondVarTestPUU(void *_arg)
1747 /* Wait for threads to finish */
1748 while(exitcount < arg) {
1749 - DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1750 - PR_GetCurrentThread(), exitcvar, exitcount));
1751 + DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1752 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1753 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1755 PR_ASSERT(exitcount >= arg);
1756 @@ -371,7 +371,7 @@ CondVarTestPUU(void *_arg)
1758 /* Join all the threads */
1759 for(index=0; index<(arg); index++) {
1760 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1761 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1762 PR_JoinThread(list[index].thread);
1763 if (list[index].internal) {
1764 PR_Lock(list[index].lock);
1765 @@ -393,7 +393,7 @@ CondVarTestPUU(void *_arg)
1767 CondVarTestPUK(void *_arg)
1769 - PRInt32 arg = (PRInt32)_arg;
1770 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1771 PRInt32 index, loops;
1774 @@ -475,7 +475,7 @@ CondVarTestPUK(void *_arg)
1776 CondVarTest(void *_arg)
1778 - PRInt32 arg = (PRInt32)_arg;
1779 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1780 PRInt32 index, loops;
1783 @@ -609,7 +609,7 @@ CondVarTest(void *_arg)
1785 CondVarTimeoutTest(void *_arg)
1787 - PRInt32 arg = (PRInt32)_arg;
1788 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1789 PRInt32 index, loops;
1792 @@ -721,7 +721,7 @@ CondVarTimeoutTest(void *_arg)
1794 CondVarMixedTest(void *_arg)
1796 - PRInt32 arg = (PRInt32)_arg;
1797 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1798 PRInt32 index, loops;
1801 @@ -811,7 +811,7 @@ CondVarMixedTest(void *_arg)
1802 for(index=0; index<(arg*4); index+=3) {
1804 PR_Lock(list[index].lock);
1805 - *list[index].tcount++;
1806 + list[index].tcount++;
1807 PR_NotifyCondVar(list[index].cvar);
1808 PR_Unlock(list[index].lock);
1810 @@ -883,7 +883,7 @@ static void Measure(void (*func)(void *)
1813 start = PR_IntervalNow();
1814 - (*func)((void *)arg);
1815 + (*func)((void *)(intptr_t)arg);
1816 stop = PR_IntervalNow();
1818 d = (double)PR_IntervalToMicroseconds(stop - start);
1819 @@ -948,7 +948,7 @@ This test is run with %d, %d, %d, and %d
1820 PR_SetConcurrency(2);
1822 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1823 - printf("\n%ld Thread tests\n", threads);
1824 + printf("\n%d Thread tests\n", (int)threads);
1825 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1826 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1827 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1828 --- pr/tests/foreign.c.orig 2022-05-25 21:34:56 UTC
1829 +++ pr/tests/foreign.c
1830 @@ -175,7 +175,7 @@ static void OneShot(void *arg)
1833 PRFileDesc *pair[2];
1834 - PRIntn test = (PRIntn)arg;
1835 + intptr_t test = (intptr_t)arg;
1837 for (test = 0; test < 12; ++test) {
1839 @@ -272,7 +272,7 @@ static void OneShot(void *arg)
1840 int main(int argc, char **argv)
1843 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1844 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1846 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1848 --- pr/tests/forktest.c.orig 2022-05-25 21:34:56 UTC
1849 +++ pr/tests/forktest.c
1850 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1853 PRFileDesc *sock = NULL;
1854 - PRInt32 tmp = (PRInt32)arg;
1855 + intptr_t tmp = (intptr_t)arg;
1858 * Make sure the PR_Accept call will block
1859 @@ -143,7 +143,7 @@ DoIO(void)
1862 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1863 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1864 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1865 PR_JOINABLE_THREAD, 0);
1866 if (clientThread == NULL) {
1867 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1868 @@ -151,6 +151,9 @@ DoIO(void)
1872 + printf("Wait one second before accept\n");
1874 + PR_Sleep(PR_SecondsToInterval(1));
1875 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1877 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1878 --- pr/tests/getai.c.orig 2022-05-25 21:34:56 UTC
1879 +++ pr/tests/getai.c
1880 @@ -13,8 +13,15 @@ int main(int argc, char **argv)
1886 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1891 + host = "www.FreeBSD.org";
1893 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1895 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1896 PR_GetError(), PR_GetOSError());
1897 --- pr/tests/instrumt.c.orig 2022-05-25 21:34:56 UTC
1898 +++ pr/tests/instrumt.c
1905 #include <prclist.h>
1908 #define COUNT_LIMIT (10 * ( 1024))
1910 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1915 @@ -78,10 +78,10 @@ static void Help(void)
1917 static void ListCounters(void)
1919 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1920 PR_DEFINE_COUNTER( qh );
1921 PR_DEFINE_COUNTER( rh );
1922 const char *qn, *rn, *dn;
1923 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1926 PR_INIT_COUNTER_HANDLE( qh, NULL );
1927 @@ -92,7 +92,7 @@ static void ListCounters(void)
1928 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1929 while ( rh != NULL )
1931 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1932 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1933 PR_GET_COUNTER(tCtr, rh);
1934 PR_LOG( lm, msgLevel,
1935 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1936 @@ -101,15 +101,15 @@ static void ListCounters(void)
1938 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1942 } /* end ListCounters() */
1944 static void ListTraces(void)
1946 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1947 PR_DEFINE_TRACE( qh );
1948 PR_DEFINE_TRACE( rh );
1949 const char *qn, *rn, *dn;
1950 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1952 PR_INIT_TRACE_HANDLE( qh, NULL );
1953 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1954 @@ -119,7 +119,7 @@ static void ListTraces(void)
1955 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1956 while ( rh != NULL )
1958 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1959 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1960 PR_LOG( lm, msgLevel,
1961 ( "QName: %s RName: %s Desc: %s",
1963 @@ -127,7 +127,7 @@ static void ListTraces(void)
1965 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1969 } /* end ListCounters() */
1972 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1974 static void TraceTest( void )
1979 PR_DEFINE_TRACE( th );
1981 --- pr/tests/io_timeout.c.orig 2022-05-25 21:34:56 UTC
1982 +++ pr/tests/io_timeout.c
1984 /* Used to get the command line option */
1985 #include "plgetopt.h"
1989 +#include <string.h>
1992 #define NUM_THREADS 1
1993 -#define BASE_PORT 8000
1994 +#define BASE_PORT 38011
1995 #define DEFAULT_ACCEPT_TIMEOUT 2
1997 typedef struct threadInfo {
1998 @@ -38,7 +40,7 @@ typedef struct threadInfo {
2001 PRIntn failed_already = 0;
2002 -PRIntn debug_mode = 0;
2003 +PRIntn debug_mode = 1;
2005 #define LOCAL_SCOPE_STRING "LOCAL scope"
2006 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
2007 @@ -54,7 +56,7 @@ thread_main(void *_info)
2008 PRFileDesc *clientSock;
2010 PRThreadScope tscope;
2012 + const char *scope_str;
2016 @@ -74,6 +76,7 @@ thread_main(void *_info)
2019 PR_NOT_REACHED("Invalid thread scope");
2023 printf("thread id %d, scope %s\n", info->id, scope_str);
2024 @@ -92,8 +95,12 @@ thread_main(void *_info)
2025 listenAddr.inet.ip = PR_htonl(PR_INADDR_ANY);
2026 rv = PR_Bind(listenSock, &listenAddr);
2027 if (rv == PR_FAILURE) {
2029 - printf("unable to bind\n");
2031 + printf("unable to bind to %d: %s\n",
2032 + BASE_PORT + info->id, strerror(PR_GetOSError()));
2033 + if (PR_GetOSError() == EADDRINUSE) {
2034 + printf("can not proceed with this test\n");
2039 @@ -117,8 +124,9 @@ thread_main(void *_info)
2040 if (clientSock == NULL) {
2041 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
2043 - printf("PR_Accept() timeout worked!\n");
2044 - printf("TEST PASSED! PR_Accept() returned error %d\n",
2045 + printf("PR_Accept() timeout worked!\n"
2046 + "TEST PASSED! PR_Accept() returned error "
2047 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
2048 PR_IO_TIMEOUT_ERROR);
2051 --- pr/tests/layer.c.orig 2022-05-25 21:34:56 UTC
2052 +++ pr/tests/layer.c
2053 @@ -57,7 +57,10 @@ static PRUint16 default_port = 12273 POR
2054 static PRFileDesc *PushLayer(PRFileDesc *stack)
2056 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
2057 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
2058 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
2059 + PRStatus rv = /* we only need rv for PR_ASSERT() */
2061 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
2062 if (verbosity > quiet) {
2063 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
2065 --- pr/tests/lazyinit.c.orig 2022-05-25 21:34:56 UTC
2066 +++ pr/tests/lazyinit.c
2067 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
2071 - PRCondVar *cv = NULL;
2072 PRThread *thread = NULL;
2073 PRIntervalTime interval = 0;
2074 PRFileDesc *file, *udp, *tcp, *pair[2];
2075 --- pr/tests/lltest.c.orig 2022-05-25 21:34:56 UTC
2076 +++ pr/tests/lltest.c
2077 @@ -651,6 +651,7 @@ TestConversion( void )
2082 static void ShiftCompileOnly()
2085 @@ -667,6 +668,7 @@ static void ShiftCompileOnly()
2086 LL_ISHL(ia, 49, 32);
2088 } /* ShiftCompileOnly */
2093 @@ -751,7 +753,6 @@ TestArithmetic( void )
2094 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
2095 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
2096 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
2097 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
2098 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
2099 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
2100 PRInt64 result, result2;
2101 --- pr/tests/mbcs.c.orig 2022-05-25 21:34:56 UTC
2103 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
2105 ** Traverse directory
2107 -static void TraverseDirectory( unsigned char *dir )
2108 +static void TraverseDirectory(const char *dir)
2111 PRDirEntry *dirEntry;
2118 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
2121 if ( PR_FILE_FILE == info.type ) {
2122 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
2123 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
2124 fd = PR_Open( file, PR_RDONLY, 0 );
2126 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
2127 - PR_GetError(), PR_GetOSError());
2128 + (long)PR_GetError(), (long)PR_GetOSError());
2130 rc = PR_Close( fd );
2131 if ( PR_FAILURE == rc ) {
2132 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
2133 - PR_GetError(), PR_GetOSError());
2134 + (long)PR_GetError(), (long)PR_GetOSError());
2136 } else if ( PR_FILE_DIRECTORY == info.type ) {
2137 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
2138 --- pr/tests/nbconn.c.orig 2022-05-25 21:34:56 UTC
2139 +++ pr/tests/nbconn.c
2140 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
2142 PRSocketOptionData optData;
2143 const char *hostname = NULL;
2144 - PRIntn default_case, n, bytes_read, bytes_sent;
2145 - PRInt32 failed_already = 0;
2146 + PRIntn default_case, n;
2150 @@ -169,7 +168,7 @@ int main(int argc, char **argv)
2153 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
2154 - PR_GetError(), PR_GetOSError());
2155 + (long)PR_GetError(), (long)PR_GetOSError());
2159 @@ -240,7 +239,7 @@ connection_success_test()
2160 PRThread *thr = NULL;
2162 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
2163 - PRIntn default_case, n, bytes_read, bytes_sent;
2164 + PRIntn n, bytes_read, bytes_sent;
2165 PRIntn failed_already = 0;
2168 @@ -317,7 +316,7 @@ connection_success_test()
2172 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
2173 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
2175 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
2176 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
2177 @@ -396,7 +395,7 @@ connection_success_test()
2178 DPRINTF(("Data integrity verified\n"));
2180 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
2181 - PR_GetError(), PR_GetOSError());
2182 + (long)PR_GetError(), (long)PR_GetOSError());
2186 @@ -505,7 +504,6 @@ connection_failure_test()
2189 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
2191 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
2194 --- pr/tests/nblayer.c.orig 2022-05-25 21:34:56 UTC
2195 +++ pr/tests/nblayer.c
2196 @@ -360,7 +360,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
2197 static PRInt16 PR_CALLBACK MyPoll(
2198 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
2200 - PRInt16 my_flags, new_flags;
2201 + PRInt16 my_flags = -1, new_flags;
2202 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
2203 if (0 != (PR_POLL_READ & in_flags))
2205 @@ -405,7 +405,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
2206 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
2209 - PRFileDesc *newfd, *layer = fd;
2210 + PRFileDesc *newfd;
2211 PRFileDesc *newstack;
2212 PRFilePrivate *newsecret;
2214 @@ -507,6 +507,8 @@ static PRInt32 PR_CALLBACK MyRecv(
2215 mine->rcvinprogress = 0;
2216 return mine->rcvreq; /* << -- that's it! */
2218 + PR_ASSERT(!"How did I get this mine->rcvstate?");
2223 @@ -575,6 +577,8 @@ static PRInt32 PR_CALLBACK MySend(
2224 mine->xmtinprogress = 0;
2225 return mine->xmtreq; /* <<-- That's the one! */
2227 + PR_ASSERT(!"How did I get this mine->xmtstate?");
2232 --- pr/tests/nonblock.c.orig 2022-05-25 21:34:56 UTC
2233 +++ pr/tests/nonblock.c
2235 static void PR_CALLBACK
2236 clientThreadFunc(void *arg)
2238 - PRUintn port = (PRUintn)arg;
2239 + intptr_t port = (intptr_t)arg;
2242 char buf[CHUNK_SIZE];
2243 @@ -145,7 +145,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2246 clientThread = PR_CreateThread(PR_USER_THREAD,
2247 - clientThreadFunc, (void *) listenPort,
2248 + clientThreadFunc, (void *) (intptr_t)listenPort,
2249 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2250 PR_UNJOINABLE_THREAD, 0);
2251 if (clientThread == NULL) {
2252 @@ -189,7 +189,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2253 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
2254 PL_PrintError("First Receive:\n");
2255 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
2256 - retVal, PR_GetError());
2257 + (long)retVal, (long)PR_GetError());
2260 printf("read: EWOULDBLOCK, good\n");
2261 @@ -199,7 +199,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
2262 if (retVal != CHUNK_SIZE) {
2263 PL_PrintError("Second Receive:\n");
2264 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
2265 - retVal, PR_GetError());
2266 + (long)retVal, (long)PR_GetError());
2269 printf("read: %d bytes, good\n", retVal);
2270 --- pr/tests/obsints.c.orig 2022-05-25 21:34:56 UTC
2271 +++ pr/tests/obsints.c
2272 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
2273 #else /* NO_NSPR_10_SUPPORT */
2275 #include "prtypes.h" /* which includes protypes.h */
2276 +#if !defined(__GNUC__)
2280 int main(int argc, char **argv)
2282 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
2283 * Compilation fails if any of these integer types are not
2284 * defined by protypes.h.
2298 + uintn uin __unused;
2301 + uint8 ui8 __unused;
2302 + int16 i16 __unused;
2303 + uint16 ui16 __unused;
2304 + int32 i32 __unused;
2305 + uint32 ui32 __unused;
2306 + int64 i64 __unused;
2307 + uint64 ui64 __unused;
2311 --- pr/tests/parsetm.c.orig 2022-05-25 21:34:56 UTC
2312 +++ pr/tests/parsetm.c
2313 @@ -32,8 +32,8 @@ static void PrintExplodedTime(const PREx
2315 /* Print day of the week, month, day, hour, minute, and second */
2316 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
2317 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
2318 - et->tm_hour, et->tm_min, et->tm_sec);
2319 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
2320 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
2322 /* Print time zone */
2323 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
2324 @@ -50,7 +50,7 @@ static void PrintExplodedTime(const PREx
2325 hourOffset = totalOffset / 3600;
2326 minOffset = (totalOffset % 3600) / 60;
2328 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
2329 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
2333 --- pr/tests/peek.c.orig 2022-05-25 21:34:56 UTC
2335 @@ -137,7 +137,7 @@ static void ClientNB(void *arg)
2338 PRSocketOptionData opt;
2339 - PRUint16 port = (PRUint16) arg;
2340 + PRUint16 port = (intptr_t) arg;
2342 char buf[BUFFER_SIZE];
2344 @@ -301,7 +301,7 @@ RunTest(PRThreadScope scope, PRFileDesc
2347 client = PR_CreateThread(
2348 - PR_USER_THREAD, ClientNB, (void *) port,
2349 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
2350 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2351 if (NULL == client) {
2352 fprintf(stderr, "PR_CreateThread failed\n");
2353 --- pr/tests/perf.c.orig 2022-05-25 21:34:56 UTC
2355 @@ -142,7 +142,7 @@ static void PR_CALLBACK CXReader(void *a
2357 for (i = 0; i < n; i++) {
2359 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
2360 + DPRINTF(("CXReader: thread = %p waiting\n",
2361 PR_GetCurrentThread()));
2362 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
2364 @@ -155,7 +155,7 @@ static void PR_CALLBACK CXReader(void *a
2367 PR_ExitMonitor(mon2);
2368 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2369 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
2372 static void PR_CALLBACK CXWriter(void *arg)
2373 @@ -166,7 +166,7 @@ static void PR_CALLBACK CXWriter(void *a
2375 for (i = 0; i < n; i++) {
2377 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
2378 + DPRINTF(("CXWriter: thread = %p waiting\n",
2379 PR_GetCurrentThread()));
2380 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
2382 @@ -179,7 +179,7 @@ static void PR_CALLBACK CXWriter(void *a
2385 PR_ExitMonitor(mon2);
2386 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2387 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
2390 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
2391 @@ -199,7 +199,7 @@ static void ContextSwitch(PRThreadScope
2393 fprintf(stderr, "ContextSwitch: cannot create thread\n");
2395 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
2396 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
2397 (scope1 == PR_GLOBAL_THREAD ?
2398 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2400 @@ -213,7 +213,7 @@ static void ContextSwitch(PRThreadScope
2402 fprintf(stderr, "ContextSwitch: cannot create thread\n");
2404 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
2405 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
2406 (scope2 == PR_GLOBAL_THREAD ?
2407 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2409 @@ -255,10 +255,10 @@ static void PR_CALLBACK SemaThread(void
2412 for (i = 0; i < n; i++) {
2413 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
2414 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
2415 PR_GetCurrentThread(), sem[0]));
2417 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
2418 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
2419 PR_GetCurrentThread(), sem[1]));
2422 @@ -267,7 +267,7 @@ static void PR_CALLBACK SemaThread(void
2425 PR_ExitMonitor(mon2);
2426 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
2427 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
2430 static PRSemaphore *sem_set1[2];
2431 @@ -295,7 +295,7 @@ static void SemaContextSwitch(PRThreadSc
2433 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
2435 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
2436 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
2437 (scope1 == PR_GLOBAL_THREAD ?
2438 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2440 @@ -310,7 +310,7 @@ static void SemaContextSwitch(PRThreadSc
2442 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
2444 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
2445 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
2446 (scope2 == PR_GLOBAL_THREAD ?
2447 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
2449 --- pr/tests/pipepong.c.orig 2022-05-25 21:34:56 UTC
2450 +++ pr/tests/pipepong.c
2451 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
2452 nBytes = fread(buf, 1, 5, stdin);
2453 fprintf(stderr, "pong process: received \"%s\"\n", buf);
2455 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
2456 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
2460 --- pr/tests/poll_nm.c.orig 2022-05-25 21:34:56 UTC
2461 +++ pr/tests/poll_nm.c
2462 @@ -47,7 +47,7 @@ PRIntn debug_mode;
2463 static void PR_CALLBACK
2464 clientThreadFunc(void *arg)
2466 - PRUintn port = (PRUintn) arg;
2467 + PRUintn port = (intptr_t) arg;
2471 @@ -200,7 +200,7 @@ int main(int argc, char **argv)
2474 clientThread = PR_CreateThread(PR_USER_THREAD,
2475 - clientThreadFunc, (void *) listenPort1,
2476 + clientThreadFunc, (void *)(intptr_t)listenPort1,
2477 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2478 PR_UNJOINABLE_THREAD, 0);
2479 if (clientThread == NULL) {
2480 @@ -210,7 +210,7 @@ int main(int argc, char **argv)
2483 clientThread = PR_CreateThread(PR_USER_THREAD,
2484 - clientThreadFunc, (void *) listenPort2,
2485 + clientThreadFunc, (void *)(intptr_t)listenPort2,
2486 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2487 PR_UNJOINABLE_THREAD, 0);
2488 if (clientThread == NULL) {
2489 --- pr/tests/prfz.c.orig 2022-05-25 21:34:56 UTC
2495 -#include <sys/types.h>
2496 +#include <stdint.h>
2500 --- pr/tests/provider.c.orig 2022-05-25 21:34:56 UTC
2501 +++ pr/tests/provider.c
2502 @@ -1078,7 +1078,7 @@ int main(int argc, char **argv)
2506 - CSClient_t *client;
2507 + CSClient_t *client = NULL;
2508 PRStatus rv, joinStatus;
2509 CSServer_t *server = NULL;
2511 --- pr/tests/prpoll.c.orig 2022-05-25 21:34:56 UTC
2512 +++ pr/tests/prpoll.c
2513 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
2515 clientThreadFunc(void *arg)
2517 - PRUint16 port = (PRUint16) arg;
2518 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2522 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
2525 struct sockaddr_in saddr;
2527 + socklen_t saddr_len;
2528 PRUint16 listenPort3;
2529 PRFileDesc *socket_poll_fd;
2531 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
2534 clientThread = PR_CreateThread(PR_USER_THREAD,
2535 - clientThreadFunc, (void *) listenPort1,
2536 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2537 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2538 PR_UNJOINABLE_THREAD, 0);
2539 if (clientThread == NULL) {
2540 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2543 clientThread = PR_CreateThread(PR_USER_THREAD,
2544 - clientThreadFunc, (void *) listenPort2,
2545 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2546 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2547 PR_UNJOINABLE_THREAD, 0);
2548 if (clientThread == NULL) {
2549 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2552 clientThread = PR_CreateThread(PR_USER_THREAD,
2553 - clientThreadFunc, (void *) listenPort3,
2554 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
2555 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2556 PR_UNJOINABLE_THREAD, 0);
2557 if (clientThread == NULL) {
2558 --- pr/tests/randseed.c.orig 2022-05-25 21:34:56 UTC
2559 +++ pr/tests/randseed.c
2560 @@ -48,7 +48,6 @@ static void Help( void )
2561 static void PrintRand( void *buf, PRIntn size )
2566 printf("%4.4d--\n", size );
2568 --- pr/tests/ranfile.c.orig 2022-05-25 21:34:56 UTC
2569 +++ pr/tests/ranfile.c
2570 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2571 PRStatus rv = PR_SUCCESS;
2572 Hammer_t *cd = (Hammer_t*)arg;
2574 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2575 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2578 printf("Starting work on %s\n", filename);
2579 @@ -405,8 +405,8 @@ int main(int argc, char **argv)
2580 durationTot += duration;
2582 else if (debug_mode) printf(
2583 - "%s: test failed %s after %ld seconds\n",
2584 - programName, where[hammer[poll].problem], duration);
2585 + "%s: test failed %s after %d seconds\n",
2586 + programName, where[hammer[poll].problem], (int)duration);
2590 @@ -414,7 +414,7 @@ int main(int argc, char **argv)
2593 if (debug_mode) printf(
2594 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2595 + "%s: [%d [%d] %d] writes/sec average\n",
2596 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2598 PR_DestroyCondVar(cv);
2599 --- pr/tests/runtests.sh.orig 2022-05-25 21:34:56 UTC
2600 +++ pr/tests/runtests.sh
2601 @@ -226,7 +226,7 @@ OBJDIR=`basename $PWD`
2602 printf "\nNSPR Test Results - $OBJDIR\n\n"
2603 printf "BEGIN\t\t\t`date`\n"
2604 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2605 -printf "Test\t\t\tResult\n\n"
2606 +printf " Test\t\t\tResult\n\n"
2607 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2610 @@ -244,10 +244,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2614 - printf "$prog (`date +%T`)"
2615 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2617 - ./$prog >> ${LOGFILE} 2>&1 &
2619 + ./$prog >> $prog.output 2>&1 &
2622 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2623 @@ -262,9 +260,9 @@ else
2624 printf "\t\t\tPassed\n";
2626 printf "\t\t\tFAILED\n";
2627 + sed "s,^, $prog: ," < $prog.output
2630 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2634 --- pr/tests/sel_spd.c.orig 2022-05-25 21:34:56 UTC
2635 +++ pr/tests/sel_spd.c
2640 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2641 +# include <unistd.h> /* getopt(3) */
2644 #if defined(XP_UNIX)
2647 #define PORT_BASE 19000 PORT_INC_DO PORT_INC_3264
2649 typedef struct timer_slot_t {
2650 - unsigned long d_connect;
2651 - unsigned long d_cl_data;
2652 - unsigned long d_sv_data;
2653 - unsigned long d_close;
2654 - unsigned long d_total;
2655 - unsigned long requests;
2656 + unsigned int d_connect;
2657 + unsigned int d_cl_data;
2658 + unsigned int d_sv_data;
2659 + unsigned int d_close;
2660 + unsigned int d_total;
2661 + unsigned int requests;
2664 -static long _iterations = 5;
2665 -static long _client_data = 8192;
2666 +static int _iterations = 5;
2667 +static int _client_data = 8192;
2669 -static long _server_data = (128*1024);
2670 -static long _threads_max = 10, _threads = 10;
2671 +static int _server_data = (128*1024);
2672 +static int _threads_max = 10, _threads = 10;
2674 static int verbose=0;
2675 static PRMonitor *exit_cv;
2676 @@ -102,7 +105,7 @@ _server_thread(void *arg_id)
2678 void _client_thread(void *);
2679 int *id = (int *)arg_id;
2681 + PRFileDesc *sock = NULL;
2682 PRSocketOptionData sockopt;
2684 PRFileDesc * newsock;
2685 @@ -480,12 +483,12 @@ void
2686 tally_results(int verbose)
2689 - unsigned long tot_connect = 0;
2690 - unsigned long tot_cl_data = 0;
2691 - unsigned long tot_sv_data = 0;
2692 - unsigned long tot_close = 0;
2693 - unsigned long tot_all = 0;
2694 - unsigned long tot_requests = 0;
2695 + unsigned int tot_connect = 0;
2696 + unsigned int tot_cl_data = 0;
2697 + unsigned int tot_sv_data = 0;
2698 + unsigned int tot_close = 0;
2699 + unsigned int tot_all = 0;
2700 + unsigned int tot_requests = 0;
2702 fprintf(stdout, "Server results:\n\n");
2703 for (index=0; index<_threads_max*2; index+=2) {
2704 --- pr/tests/selct_nm.c.orig 2022-05-25 21:34:56 UTC
2705 +++ pr/tests/selct_nm.c
2706 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2708 clientThreadFunc(void *arg)
2710 - PRUintn port = (PRUintn) arg;
2711 + PRUintn port = (PRUintn)(uintptr_t)arg;
2715 @@ -169,7 +169,7 @@ int main(int argc, char **argv)
2718 clientThread = PR_CreateThread(PR_USER_THREAD,
2719 - clientThreadFunc, (void *) listenPort1,
2720 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2721 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2722 PR_UNJOINABLE_THREAD, 0);
2723 if (clientThread == NULL) {
2724 @@ -179,7 +179,7 @@ int main(int argc, char **argv)
2727 clientThread = PR_CreateThread(PR_USER_THREAD,
2728 - clientThreadFunc, (void *) listenPort2,
2729 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2730 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2731 PR_UNJOINABLE_THREAD, 0);
2732 if (clientThread == NULL) {
2733 --- pr/tests/select2.c.orig 2022-05-25 21:34:56 UTC
2734 +++ pr/tests/select2.c
2735 @@ -53,6 +53,7 @@ PRInt32 count;
2737 ***********************************************************************/
2739 +static int exitcode = 2;
2741 static void Test_Result (int result)
2743 @@ -60,9 +61,13 @@ static void Test_Result (int result)
2747 + if (exitcode == 2) {
2756 printf ("NOSTATUS\n");
2757 @@ -382,4 +387,5 @@ int main(int argc, char **argv)
2763 --- pr/tests/semaerr.c.orig 2022-05-25 21:34:56 UTC
2764 +++ pr/tests/semaerr.c
2765 @@ -72,7 +72,7 @@ int main(int argc, char **argv)
2768 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2769 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2770 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2771 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2774 --- pr/tests/semaerr1.c.orig 2022-05-25 21:34:56 UTC
2775 +++ pr/tests/semaerr1.c
2776 @@ -83,7 +83,7 @@ int main(int argc, char **argv)
2779 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2780 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2781 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2785 --- pr/tests/sendzlf.c.orig 2022-05-25 21:34:56 UTC
2786 +++ pr/tests/sendzlf.c
2787 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2791 - PRUint16 port = (PRUint16) arg;
2792 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2796 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2799 clientThread = PR_CreateThread(PR_USER_THREAD,
2800 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2801 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2802 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2803 if (NULL == clientThread) {
2804 fprintf(stderr, "PR_CreateThread failed\n");
2805 --- pr/tests/server_test.c.orig 2022-05-25 21:34:56 UTC
2806 +++ pr/tests/server_test.c
2807 @@ -61,7 +61,7 @@ PRCondVar *ServerStateCV;
2809 #define DPRINTF printf
2812 +#define DPRINTF(...)
2816 @@ -582,6 +582,7 @@ static void do_workUU(void)
2821 static void do_workUK(void)
2823 ServerScope = PR_LOCAL_THREAD;
2824 @@ -602,6 +603,7 @@ static void do_workKK(void)
2825 ClientScope = PR_GLOBAL_THREAD;
2831 static void Measure(void (*func)(void), const char *msg)
2832 --- pr/tests/servr_kk.c.orig 2022-05-25 21:34:56 UTC
2833 +++ pr/tests/servr_kk.c
2834 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2836 #define DPRINTF printf
2839 +#define DPRINTF(...)
2842 PRIntn failed_already=0;
2843 @@ -539,6 +539,7 @@ void do_work()
2844 PR_JoinThread(ServerThread);
2848 static void do_workUU(void)
2850 ServerScope = PR_LOCAL_THREAD;
2851 @@ -559,6 +560,7 @@ static void do_workKU(void)
2852 ClientScope = PR_LOCAL_THREAD;
2857 static void do_workKK(void)
2859 --- pr/tests/servr_ku.c.orig 2022-05-25 21:34:56 UTC
2860 +++ pr/tests/servr_ku.c
2861 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2863 #define DPRINTF printf
2866 +#define DPRINTF(...)
2869 PRIntn failed_already=0;
2870 --- pr/tests/servr_uk.c.orig 2022-05-25 21:34:56 UTC
2871 +++ pr/tests/servr_uk.c
2872 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2874 #define DPRINTF printf
2877 +#define DPRINTF(...)
2880 PRIntn failed_already=0;
2881 --- pr/tests/servr_uu.c.orig 2022-05-25 21:34:56 UTC
2882 +++ pr/tests/servr_uu.c
2883 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2885 #define DPRINTF printf
2888 +#define DPRINTF(...)
2891 PRIntn failed_already=0;
2892 --- pr/tests/short_thread.c.orig 2022-05-25 21:34:56 UTC
2893 +++ pr/tests/short_thread.c
2894 @@ -45,7 +45,7 @@ int main (int argc, char **argv)
2895 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2898 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2899 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2900 PR_GetError(), PR_GetOSError());
2903 --- pr/tests/socket.c.orig 2022-05-25 21:34:56 UTC
2904 +++ pr/tests/socket.c
2905 @@ -173,7 +173,9 @@ readn(PRFileDesc *sockfd, char *buf, int
2912 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2914 if (test_cancelio) {
2915 @@ -181,12 +183,14 @@ readn(PRFileDesc *sockfd, char *buf, int
2918 for (rem=len; rem; offset += bytes, rem -= bytes) {
2919 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2920 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2921 PR_GetCurrentThread(), rem));
2925 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2927 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2928 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2929 PR_GetCurrentThread(), bytes));
2932 @@ -218,11 +222,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2935 for (rem=len; rem; offset += bytes, rem -= bytes) {
2936 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2937 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2938 PR_GetCurrentThread(), rem));
2939 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2940 PR_INTERVAL_NO_TIMEOUT);
2941 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2942 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2943 PR_GetCurrentThread(), bytes));
2946 @@ -272,7 +276,7 @@ Serve_Client(void *arg)
2947 if (PR_Shutdown(sockfd, PR_SHUTDOWN_RCV) < 0) {
2948 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2950 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2951 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2952 (*((int *) in_buf->data))));
2953 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2954 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2955 @@ -414,7 +418,7 @@ TCP_Server(void *arg)
2959 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2960 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2961 netaddr.inet.ip, netaddr.inet.port));
2962 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2963 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2964 @@ -466,7 +470,7 @@ TCP_Server(void *arg)
2968 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2969 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2973 @@ -482,7 +486,7 @@ exit:
2974 --(*sp->exit_counter);
2975 PR_Notify(sp->exit_mon);
2976 PR_ExitMonitor(sp->exit_mon);
2977 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2978 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2982 @@ -541,7 +545,7 @@ UDP_Server(void *arg)
2986 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2987 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2988 netaddr.inet.ip, netaddr.inet.port));
2990 * We can't use the IP address returned by PR_GetSockName in
2991 @@ -579,13 +583,13 @@ UDP_Server(void *arg)
2993 memset(&netaddr, 0, sizeof(netaddr));
2994 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
2995 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2996 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2997 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
3000 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
3001 PR_INTERVAL_NO_TIMEOUT);
3002 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
3003 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
3004 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
3007 @@ -608,7 +612,7 @@ UDP_Server(void *arg)
3008 --(*sp->exit_counter);
3009 PR_Notify(sp->exit_mon);
3010 PR_ExitMonitor(sp->exit_mon);
3011 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
3012 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
3016 @@ -652,7 +656,7 @@ TCP_Client(void *arg)
3018 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3019 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3020 - PR_GetError(), PR_GetOSError());
3021 + (long)PR_GetError(), (long)PR_GetOSError());
3025 @@ -660,7 +664,7 @@ TCP_Client(void *arg)
3027 * fill in random data
3029 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3030 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3034 @@ -674,7 +678,7 @@ TCP_Client(void *arg)
3038 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
3039 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
3040 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
3041 if (readn(sockfd, in_buf->data, bytes) < bytes) {
3042 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
3043 @@ -711,7 +715,7 @@ TCP_Client(void *arg)
3044 --(*cp->exit_counter);
3045 PR_Notify(cp->exit_mon);
3046 PR_ExitMonitor(cp->exit_mon);
3047 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
3048 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
3052 @@ -775,7 +779,7 @@ UDP_Client(void *arg)
3056 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3057 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3058 netaddr.inet.ip, netaddr.inet.port));
3060 netaddr = cp->server_addr;
3061 @@ -792,9 +796,9 @@ UDP_Client(void *arg)
3063 * fill in random data
3065 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
3066 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
3067 PR_GetCurrentThread(), out_buf->data, bytes));
3068 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
3069 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
3073 @@ -807,7 +811,7 @@ UDP_Client(void *arg)
3077 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
3078 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
3079 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
3080 if (cp->udp_connect)
3081 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
3082 @@ -818,7 +822,7 @@ UDP_Client(void *arg)
3086 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
3087 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
3088 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
3090 * verify the data read
3091 @@ -843,7 +847,7 @@ UDP_Client(void *arg)
3092 PR_Notify(cp->exit_mon);
3093 PR_ExitMonitor(cp->exit_mon);
3095 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
3096 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
3100 @@ -910,7 +914,7 @@ TCP_Socket_Client_Server_Test(void)
3104 - DPRINTF(("Created TCP server = 0x%lx\n", t));
3105 + DPRINTF(("Created TCP server = %p\n", t));
3109 @@ -944,7 +948,7 @@ TCP_Socket_Client_Server_Test(void)
3113 - DPRINTF(("Created TCP client = 0x%lx\n", t));
3114 + DPRINTF(("Created TCP client = %p\n", t));
3117 /* Wait for server and client threads to exit */
3118 @@ -954,9 +958,9 @@ TCP_Socket_Client_Server_Test(void)
3120 PR_ExitMonitor(mon2);
3121 printf("%30s","TCP_Socket_Client_Server_Test:");
3122 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3123 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3124 num_tcp_clients, num_tcp_connections_per_client);
3125 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3126 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3127 num_tcp_mesgs_per_connection, tcp_mesg_size);
3130 @@ -1081,8 +1085,8 @@ UDP_Socket_Client_Server_Test(void)
3132 PR_ExitMonitor(mon2);
3133 printf("%30s","UDP_Socket_Client_Server_Test: ");
3134 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
3135 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
3136 + printf(" 1 Server %2d Clients\n", num_udp_clients);
3137 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
3138 num_udp_datagrams_per_client, udp_datagram_size);
3141 @@ -1438,7 +1442,7 @@ TransmitFile_Client(void *arg)
3142 --(*cp->exit_counter);
3143 PR_Notify(cp->exit_mon);
3144 PR_ExitMonitor(cp->exit_mon);
3145 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
3146 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
3150 @@ -1481,7 +1485,7 @@ Serve_TransmitFile_Client(void *arg)
3151 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
3153 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
3154 - PR_GetError(), PR_GetOSError());
3155 + (long)PR_GetError(), (long)PR_GetOSError());
3158 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
3159 @@ -1489,7 +1493,7 @@ Serve_TransmitFile_Client(void *arg)
3160 if (bytes != LARGE_FILE_SIZE) {
3162 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
3163 - PR_GetError(), PR_GetOSError());
3164 + (long)PR_GetError(), (long)PR_GetOSError());
3168 @@ -1517,7 +1521,7 @@ Serve_TransmitFile_Client(void *arg)
3171 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3172 - PR_GetError(), PR_GetOSError());
3173 + (long)PR_GetError(), (long)PR_GetOSError());
3177 @@ -1541,7 +1545,7 @@ Serve_TransmitFile_Client(void *arg)
3180 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3181 - PR_GetError(), PR_GetOSError());
3182 + (long)PR_GetError(), (long)PR_GetOSError());
3186 @@ -1563,7 +1567,7 @@ Serve_TransmitFile_Client(void *arg)
3189 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3190 - PR_GetError(), PR_GetOSError());
3191 + (long)PR_GetError(), (long)PR_GetOSError());
3195 @@ -1585,7 +1589,7 @@ Serve_TransmitFile_Client(void *arg)
3198 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3199 - PR_GetError(), PR_GetOSError());
3200 + (long)PR_GetError(), (long)PR_GetOSError());
3204 @@ -1607,7 +1611,7 @@ Serve_TransmitFile_Client(void *arg)
3207 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3208 - PR_GetError(), PR_GetOSError());
3209 + (long)PR_GetError(), (long)PR_GetOSError());
3213 @@ -1629,7 +1633,7 @@ Serve_TransmitFile_Client(void *arg)
3216 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3217 - PR_GetError(), PR_GetOSError());
3218 + (long)PR_GetError(), (long)PR_GetOSError());
3222 @@ -1651,7 +1655,7 @@ Serve_TransmitFile_Client(void *arg)
3225 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3226 - PR_GetError(), PR_GetOSError());
3227 + (long)PR_GetError(), (long)PR_GetOSError());
3231 @@ -1675,7 +1679,7 @@ Serve_TransmitFile_Client(void *arg)
3234 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
3235 - PR_GetError(), PR_GetOSError());
3236 + (long)PR_GetError(), (long)PR_GetOSError());
3240 @@ -1752,7 +1756,7 @@ TransmitFile_Server(void *arg)
3244 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3245 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3246 netaddr.inet.ip, netaddr.inet.port));
3247 tcp_server_addr.inet.family = netaddr.inet.family;
3248 tcp_server_addr.inet.port = netaddr.inet.port;
3249 @@ -1818,7 +1822,7 @@ TransmitFile_Server(void *arg)
3253 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
3254 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
3258 @@ -1846,7 +1850,7 @@ exit:
3259 --(*sp->exit_counter);
3260 PR_Notify(sp->exit_mon);
3261 PR_ExitMonitor(sp->exit_mon);
3262 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
3263 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
3267 @@ -1986,7 +1990,7 @@ Socket_Misc_Test(void)
3269 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
3271 - PR_GetError(), PR_GetOSError());
3272 + (long)PR_GetError(), (long)PR_GetOSError());
3276 @@ -2076,7 +2080,7 @@ Socket_Misc_Test(void)
3280 - DPRINTF(("Created TCP server = 0x%x\n", t));
3281 + DPRINTF(("Created TCP server = %p\n", t));
3285 @@ -2113,7 +2117,7 @@ Socket_Misc_Test(void)
3289 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
3290 + DPRINTF(("Created TransmitFile client = %p\n", t));
3293 /* Wait for server and client threads to exit */
3294 @@ -2144,7 +2148,7 @@ done:
3296 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
3297 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
3298 - TEST_DIR, PR_GetError(), PR_GetOSError());
3299 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
3303 --- pr/tests/sprintf.c.orig 2022-05-25 21:34:56 UTC
3304 +++ pr/tests/sprintf.c
3305 @@ -133,7 +133,7 @@ static void test_l(char *pattern, char *
3306 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
3308 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
3309 - pattern, l, s, buf, sbuf);
3310 + pattern, (long)l, s, buf, sbuf);
3311 PR_smprintf_free(s);
3314 --- pr/tests/stack.c.orig 2022-05-25 21:34:56 UTC
3315 +++ pr/tests/stack.c
3316 @@ -53,7 +53,7 @@ PRFileDesc *errhandle;
3318 int main(int argc, char **argv)
3320 - PRInt32 rv, cnt, sum;
3323 PRStack *list1, *list2;
3325 @@ -211,7 +211,7 @@ int main(int argc, char **argv)
3326 static void stackop(void *thread_arg)
3328 PRInt32 val, cnt, index, loops;
3329 - DataRecord *Items, *Item;
3330 + DataRecord *Items;
3331 PRStack *list1, *list2;
3333 stack_data *arg = (stack_data *) thread_arg;
3334 --- pr/tests/suspend.c.orig 2022-05-25 21:34:56 UTC
3335 +++ pr/tests/suspend.c
3336 @@ -21,14 +21,14 @@ void PR_CALLBACK
3337 Level_2_Thread(void *arg)
3339 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
3340 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3341 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
3346 Level_1_Thread(void *arg)
3348 - PRUint32 tmp = (PRUint32)arg;
3349 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
3350 PRThreadScope scope = (PRThreadScope) tmp;
3353 @@ -43,7 +43,7 @@ Level_1_Thread(void *arg)
3355 printf("Could not create thread!\n");
3357 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
3358 + printf("Level_1_Thread[%p] created %15s thread %p\n",
3359 PR_GetCurrentThread(),
3360 (scope == PR_GLOBAL_THREAD) ?
3361 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3362 @@ -54,7 +54,7 @@ Level_1_Thread(void *arg)
3365 PR_ExitMonitor(mon);
3366 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3367 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
3370 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
3371 @@ -63,14 +63,15 @@ static PRStatus PR_CALLBACK print_thread
3375 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
3376 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
3377 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
3378 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
3379 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
3381 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3382 - registers[0],registers[1],registers[2],registers[3]);
3383 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
3384 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3385 + (unsigned long)registers[0], (unsigned long)registers[1],
3386 + (unsigned long)registers[2], (unsigned long)registers[3]);
3387 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
3391 @@ -98,7 +99,7 @@ static void Level_0_Thread(PRThreadScope
3392 printf("Could not create thread!\n");
3395 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
3396 + printf("Level_0_Thread[%p] created %15s thread %p\n",
3397 PR_GetCurrentThread(),
3398 (scope1 == PR_GLOBAL_THREAD) ?
3399 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3400 @@ -110,9 +111,10 @@ static void Level_0_Thread(PRThreadScope
3401 PR_EnumerateThreads(print_thread, NULL);
3402 registers = PR_GetGCRegisters(me, 1, (int *)&words);
3404 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3405 - registers[0],registers[1],registers[2],registers[3]);
3406 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
3407 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3408 + (unsigned long)registers[0], (unsigned long)registers[1],
3409 + (unsigned long)registers[2], (unsigned long)registers[3]);
3410 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
3413 /* Wait for all threads to exit */
3414 --- pr/tests/switch.c.orig 2022-05-25 21:34:56 UTC
3415 +++ pr/tests/switch.c
3416 @@ -83,7 +83,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
3418 PRBool help = PR_FALSE;
3419 PRUintn concurrency = 1;
3420 - Shared *shared, *link;
3421 + Shared *shared = NULL, *link;
3422 PRIntervalTime timein, timeout;
3423 PRThreadScope thread_scope = PR_LOCAL_THREAD;
3424 PRUintn thread_count, inner_count, loop_count, average;
3425 --- pr/tests/testfile.c.orig 2022-05-25 21:34:56 UTC
3426 +++ pr/tests/testfile.c
3427 @@ -37,6 +37,9 @@ static int _debug_on = 0;
3431 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
3432 +# include <unistd.h> /* getopt(3) */
3435 #define DPRINTF(arg) if (_debug_on) printf arg
3437 @@ -90,7 +93,7 @@ static PRInt32 PR_CALLBACK DirTest(void
3438 PRInt32 dirtest_failed = 0;
3440 PRThread* create_new_thread(PRThreadType type,
3441 - void (*start)(void *arg),
3442 + void *(*start)(void *arg),
3444 PRThreadPriority priority,
3445 PRThreadScope scope,
3446 @@ -155,7 +158,7 @@ PRThread* create_new_thread(PRThreadType
3447 return((PRThread *) thandle);
3450 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3451 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
3454 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3455 @@ -316,8 +319,8 @@ static PRInt32 Misc_File_Tests(char *pat
3457 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3459 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3460 - file_info1.creationTime);
3461 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3462 + (long long)file_info1.creationTime);
3466 @@ -342,8 +345,8 @@ static PRInt32 Misc_File_Tests(char *pat
3468 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3470 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3471 - file_info1.modifyTime);
3472 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3473 + (long long)file_info1.modifyTime);
3477 @@ -469,7 +472,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3478 memset(fparamp->buf, i, len);
3480 t = create_new_thread(PR_USER_THREAD,
3481 - File_Write, (void *)fparamp,
3482 + (void *(*)(void *))File_Write, (void *)fparamp,
3485 PR_UNJOINABLE_THREAD,
3486 @@ -504,7 +507,7 @@ static PRInt32 PR_CALLBACK FileTest(void
3489 t = create_new_thread(PR_USER_THREAD,
3490 - File_Read, (void *)fparamp,
3491 + (void *(*)(void *))File_Read, (void *)fparamp,
3494 PR_UNJOINABLE_THREAD,
3495 @@ -573,7 +576,7 @@ static PRInt32 RunDirTest(void)
3498 t = create_new_thread(PR_USER_THREAD,
3500 + (void *(*)(void *))DirTest, &thrarg,
3503 PR_UNJOINABLE_THREAD,
3504 @@ -897,8 +900,6 @@ int main(int argc, char **argv)
3506 #if defined(XP_UNIX) || defined(XP_OS2)
3508 - extern char *optarg;
3509 - extern int optind;
3511 #if defined(XP_UNIX) || defined(XP_OS2)
3512 while ((opt = getopt(argc, argv, "d")) != EOF) {
3513 --- pr/tests/threads.c.orig 2022-05-25 21:34:56 UTC
3514 +++ pr/tests/threads.c
3515 @@ -27,7 +27,7 @@ void
3517 DumbThread(void *arg)
3519 - PRInt32 tmp = (PRInt32)arg;
3520 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3521 PRThreadScope scope = (PRThreadScope)tmp;
3524 @@ -173,10 +173,10 @@ int main(int argc, char **argv)
3529 -** Tests lots of thread creations. \n\
3530 -** Create %ld native threads %ld times. \n\
3531 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3532 + printf("** Tests lots of thread creations.\n"
3533 + "** Create %d native threads %d times.\n"
3534 + "** Create %d user threads %d times.\n", iterations, count,
3535 + iterations, count);
3538 for (index=0; index<iterations; index++) {
3539 --- pr/tests/thrpool_client.c.orig 2022-05-25 21:34:56 UTC
3540 +++ pr/tests/thrpool_client.c
3541 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3542 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3544 for (rem=len; rem; offset += bytes, rem -= bytes) {
3545 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3546 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3547 PR_GetCurrentThread(), rem));
3548 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3550 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3551 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3552 PR_GetCurrentThread(), bytes));
3555 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3558 for (rem=len; rem; offset += bytes, rem -= bytes) {
3559 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3560 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3561 PR_GetCurrentThread(), rem));
3562 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3563 PR_INTERVAL_NO_TIMEOUT);
3564 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3565 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3566 PR_GetCurrentThread(), bytes));
3569 @@ -165,7 +165,7 @@ TCP_Client(void *arg)
3571 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3572 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0) {
3573 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3574 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3575 PR_GetError(), PR_GetOSError());
3578 @@ -174,7 +174,7 @@ TCP_Client(void *arg)
3580 * fill in random data
3582 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3583 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3587 @@ -282,7 +282,7 @@ TCP_Socket_Client_Server_Test(void)
3588 PR_EnterMonitor(mon2);
3590 PR_ExitMonitor(mon2);
3591 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3592 + DPRINTF(("Created TCP client = %p\n", thr));
3594 /* Wait for client jobs to exit */
3595 PR_EnterMonitor(mon2);
3596 @@ -292,9 +292,9 @@ TCP_Socket_Client_Server_Test(void)
3598 PR_ExitMonitor(mon2);
3599 printf("%30s","TCP_Socket_Client_Server_Test:");
3600 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3601 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3602 num_tcp_clients, num_tcp_connections_per_client);
3603 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3604 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3605 num_tcp_mesgs_per_connection, tcp_mesg_size);
3608 --- pr/tests/thrpool_server.c.orig 2022-05-25 21:34:56 UTC
3609 +++ pr/tests/thrpool_server.c
3610 @@ -330,7 +330,7 @@ TCP_Server(void *arg)
3614 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3615 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3616 netaddr.inet.ip, netaddr.inet.port));
3618 sp = PR_NEW(Server_Param);
3619 @@ -342,7 +342,7 @@ TCP_Server(void *arg)
3620 sp->iod.socket = sockfd;
3621 sp->iod.timeout = PR_SecondsToInterval(60);
3622 sp->datalen = tcp_mesg_size;
3623 - sp->exit_mon = sc_mon;
3624 + sp->exit_mon = NULL;
3625 sp->job_counterp = &job_counter;
3626 sp->conn_counter = 0;
3628 @@ -465,7 +465,7 @@ TCP_Server_Accept(void *arg)
3631 PR_ASSERT(NULL != jobp);
3632 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3633 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3636 * single-threaded update; no lock needed
3637 @@ -482,7 +482,7 @@ TCP_Server_Accept(void *arg)
3638 print_stats, sp, PR_FALSE);
3640 PR_ASSERT(NULL != jobp);
3641 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3642 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3645 PR_EnterMonitor(sp->exit_mon);
3646 @@ -499,9 +499,9 @@ exit:
3648 PR_DestroyMonitor(sp->exit_mon);
3649 printf("%30s","TCP_Socket_Client_Server_Test:");
3650 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3651 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3652 num_tcp_clients, num_tcp_connections_per_client);
3653 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3654 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3655 num_tcp_mesgs_per_connection, tcp_mesg_size);
3657 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3658 --- pr/tests/thruput.c.orig 2022-05-25 21:34:56 UTC
3659 +++ pr/tests/thruput.c
3660 @@ -82,7 +82,7 @@ static void PR_CALLBACK Clientel(void *a
3664 - PRInt32 bytes, sampled;
3665 + PRInt32 bytes, sampled = -1;
3666 PRIntervalTime now, interval;
3667 PRBool do_display = PR_FALSE;
3668 Shared *shared = (Shared*)arg;
3669 @@ -196,7 +196,7 @@ static void Client(const char *server_na
3671 static void PR_CALLBACK Servette(void *arg)
3673 - PRInt32 bytes, sampled;
3674 + PRInt32 bytes, sampled = -1;
3675 PRIntervalTime now, interval;
3676 PRBool do_display = PR_FALSE;
3677 PRFileDesc *client = (PRFileDesc*)arg;
3678 @@ -408,6 +408,7 @@ int main(int argc, char **argv)
3686 --- pr/tests/timemac.c.orig 2022-05-25 21:34:56 UTC
3687 +++ pr/tests/timemac.c
3688 @@ -25,7 +25,7 @@ static void printExplodedTime(const PREx
3691 /* Print day of the week, month, day, hour, minute, and second */
3692 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3693 + printf( "%s %s %d %02d:%02d:%02d ",
3694 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3695 et->tm_hour, et->tm_min, et->tm_sec);
3697 @@ -41,7 +41,7 @@ static void printExplodedTime(const PREx
3699 hourOffset = totalOffset / 3600;
3700 minOffset = (totalOffset % 3600) / 60;
3701 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3702 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3706 @@ -98,7 +98,7 @@ int main(int argc, char** argv)
3707 printf("Current local time is ");
3708 printExplodedTime(&et);
3710 - printf("GMT offset is %ld, DST offset is %ld\n",
3711 + printf("GMT offset is %d, DST offset is %d\n",
3712 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3713 t2 = PR_ImplodeTime(&et);
3714 if (LL_NE(t1, t2)) {
3715 --- pr/tests/timetest.c.orig 2022-05-25 21:34:56 UTC
3716 +++ pr/tests/timetest.c
3717 @@ -37,7 +37,7 @@ static void PrintExplodedTime(const PREx
3720 /* Print day of the week, month, day, hour, minute, and second */
3721 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3722 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3723 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3724 et->tm_hour, et->tm_min, et->tm_sec);
3726 @@ -56,7 +56,7 @@ static void PrintExplodedTime(const PREx
3727 hourOffset = totalOffset / 3600;
3728 minOffset = (totalOffset % 3600) / 60;
3730 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3731 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3735 @@ -262,7 +262,7 @@ int main(int argc, char** argv)
3739 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3740 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3741 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3742 t2 = PR_ImplodeTime(&et);
3743 if (LL_NE(t1, t2)) {
3744 --- pr/tests/y2k.c.orig 2022-05-25 21:34:56 UTC
3746 @@ -44,7 +44,7 @@ static void PrintExplodedTime(const PREx
3749 /* Print day of the week, month, day, hour, minute, and second */
3750 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3751 + printf("%s %s %2d %02d:%02d:%02d ",
3752 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3753 et->tm_hour, et->tm_min, et->tm_sec);
3755 @@ -63,7 +63,7 @@ static void PrintExplodedTime(const PREx
3757 hourOffset = totalOffset / 3600;
3758 minOffset = (totalOffset % 3600) / 60;
3759 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3760 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3762 #ifdef PRINT_DETAILS
3763 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3764 --- pr/tests/y2ktmo.c.orig 2022-05-25 21:34:56 UTC
3765 +++ pr/tests/y2ktmo.c
3766 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3768 static void SleepThread(void *arg)
3770 - PRIntervalTime timeout = (PRIntervalTime) arg;
3771 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3772 PRIntervalTime elapsed;
3773 #if defined(XP_UNIX) || defined(WIN32)
3774 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3775 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3777 static void AcceptThread(void *arg)
3779 - PRIntervalTime timeout = (PRIntervalTime) arg;
3780 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3781 PRIntervalTime elapsed;
3782 #if defined(XP_UNIX) || defined(WIN32)
3783 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3784 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3786 static void PollThread(void *arg)
3788 - PRIntervalTime timeout = (PRIntervalTime) arg;
3789 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3790 PRIntervalTime elapsed;
3791 #if defined(XP_UNIX) || defined(WIN32)
3792 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3793 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3795 static void WaitCondVarThread(void *arg)
3797 - PRIntervalTime timeout = (PRIntervalTime) arg;
3798 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3799 PRIntervalTime elapsed;
3800 #if defined(XP_UNIX) || defined(WIN32)
3801 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3802 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3804 static void WaitMonitorThread(void *arg)
3806 - PRIntervalTime timeout = (PRIntervalTime) arg;
3807 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3808 PRIntervalTime elapsed;
3809 #if defined(XP_UNIX) || defined(WIN32)
3810 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3811 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3813 static void WaitCMonitorThread(void *arg)
3815 - PRIntervalTime timeout = (PRIntervalTime) arg;
3816 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3817 PRIntervalTime elapsed;
3818 #if defined(XP_UNIX) || defined(WIN32)
3819 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3820 @@ -532,7 +532,7 @@ int main(int argc, char **argv)
3821 for (i = 0; i < num_thread_scopes; i++) {
3822 for (j = 0; j < num_thread_funcs; j++) {
3823 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3824 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3825 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3826 threadScopes[i], PR_JOINABLE_THREAD, 0);
3827 if (threads[idx] == NULL) {
3828 fprintf(stderr, "PR_CreateThread failed\n");
3829 --- pr/tests/zerolen.c.orig 2022-05-25 21:34:56 UTC
3830 +++ pr/tests/zerolen.c
3831 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3835 - PRUint16 port = (PRUint16) arg;
3836 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3840 @@ -124,7 +124,7 @@ int main()
3841 * First test PR_Writev.
3843 clientThread = PR_CreateThread(PR_USER_THREAD,
3844 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3845 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3846 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3847 if (NULL == clientThread) {
3848 fprintf(stderr, "PR_CreateThread failed\n");
3849 @@ -165,7 +165,7 @@ int main()
3850 * Then test PR_Write.
3852 clientThread = PR_CreateThread(PR_USER_THREAD,
3853 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3854 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3855 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3856 if (NULL == clientThread) {
3857 fprintf(stderr, "PR_CreateThread failed\n");
3858 @@ -204,7 +204,7 @@ int main()
3859 * Finally test PR_Send.
3861 clientThread = PR_CreateThread(PR_USER_THREAD,
3862 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3863 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3864 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3865 if (NULL == clientThread) {
3866 fprintf(stderr, "PR_CreateThread failed\n");
3869 [FILE:1546:patches/patch-warnings]
3870 --- pr/include/prcountr.h.orig 2022-05-25 21:34:56 UTC
3871 +++ pr/include/prcountr.h
3872 @@ -394,7 +394,7 @@ PR_SubtractFromCounter(
3873 #define PR_GET_COUNTER(counter,handle)\
3874 (counter) = PR_GetCounter((handle))
3876 -#define PR_GET_COUNTER(counter,handle) 0
3877 +#define PR_GET_COUNTER(counter,handle)
3881 @@ -468,7 +468,7 @@ PR_SetCounter(
3882 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3883 (next) = PR_FindNextCounterQname((handle))
3885 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3886 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3889 NSPR_API(PRCounterHandle)
3890 --- pr/src/misc/pralarm.c.orig 2022-05-25 21:34:56 UTC
3891 +++ pr/src/misc/pralarm.c
3892 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier
3894 while (why != abort)
3896 - PRIntervalTime pause;
3897 + PRIntervalTime pause = 0;
3899 PR_Lock(alarm->lock);
3901 --- pr/src/misc/prdtoa.c.orig 2022-05-25 21:34:56 UTC
3902 +++ pr/src/misc/prdtoa.c
3903 @@ -2885,9 +2885,9 @@ double dd; int mode, ndigits, *decpt, *s
3904 to hold the suppressed trailing zeros.
3907 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3908 - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3909 - spec_case, try_quick;
3910 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3911 + j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3912 + spec_case, try_quick;
3914 #ifndef Sudden_Underflow