Hello community, here is the log from the commit of package mozilla-nspr for openSUSE:Factory checked in at 2015-10-22 12:56:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mozilla-nspr (Old) and /work/SRC/openSUSE:Factory/.mozilla-nspr.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mozilla-nspr" Changes: -------- --- /work/SRC/openSUSE:Factory/mozilla-nspr/mozilla-nspr.changes 2015-02-06 22:36:10.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.mozilla-nspr.new/mozilla-nspr.changes 2015-10-22 12:56:35.000000000 +0200 @@ -1,0 +2,18 @@ +Fri Aug 21 14:00:21 UTC 2015 - [email protected] + +- update to version 4.10.9 + * bmo#1021167: Leak of |poll_list| on failure in _MW_PollInternal + * bmo#1030692: Make compiling nspr on windows possible again. + * bmo#1088790: dosprint() doesn't support %zu and other size formats + * bmo#1130787: prtime.h does not compile with MSVC's /Za (ISO C/C++ + conformance) option + * bmo#1153610: MIPS64: Add support for n64 ABI + * bmo#1156029: Teach clang-analyzer about PR_ASSERT + * bmo#1160125: MSVC version detection is broken CC is set to a wrapper + (like sccache) + * bmo#1163346: Add NSPR support for FreeBSD mips/mips64 + * bmo#1169185: Add support for OpenRISC (or1k) + * bmo:1174749: Remove configure block for iOS that uses MACOS_SDK_DIR + * bmo#1174781: PR_GetInheritedFD can use uninitialized variables + +------------------------------------------------------------------- Old: ---- nspr-4.10.8.tar.gz New: ---- nspr-4.10.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mozilla-nspr.spec ++++++ --- /var/tmp/diff_new_pack.tX7yhR/_old 2015-10-22 12:56:36.000000000 +0200 +++ /var/tmp/diff_new_pack.tX7yhR/_new 2015-10-22 12:56:36.000000000 +0200 @@ -18,7 +18,7 @@ Name: mozilla-nspr -Version: 4.10.8 +Version: 4.10.9 Release: 0 Summary: Netscape Portable Runtime License: MPL-2.0 ++++++ nspr-4.10.8.tar.gz -> nspr-4.10.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/.hg_archival.txt new/nspr-4.10.9/nspr/.hg_archival.txt --- old/nspr-4.10.8/nspr/.hg_archival.txt 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/.hg_archival.txt 2015-08-19 17:32:22.000000000 +0200 @@ -1,4 +1,4 @@ repo: a4b34919bf34db2ee22acbbc305693c8980b6dc6 -node: ad3ebb90bc9968055faadffb37233ad4cb956f85 +node: 2c9a94fefea664f8a84442fc959b37db119e2e25 branch: default -tag: NSPR_4_10_8_RTM +tag: NSPR_4_10_9_RTM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/config/rules.mk new/nspr-4.10.9/nspr/config/rules.mk --- old/nspr-4.10.8/nspr/config/rules.mk 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/config/rules.mk 2015-08-19 17:32:22.000000000 +0200 @@ -81,18 +81,19 @@ # other platforms do not. # ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET))) -LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb -else -LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) -SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) -SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb -endif - ifdef MSC_VER +LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) else +LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) +IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) +endif +else +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) +SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb +LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) endif @@ -363,7 +364,7 @@ ifdef MOZ_PROFILE_GENERATE # Clean up profiling data during PROFILE_GENERATE phase export:: -ifeq ($(OS_ARCH)_$(NS_USE_GCC), WINNT_) +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) $(foreach pgd,$(wildcard *.pgd),pgomgr -clear $(pgd);) else ifdef NS_USE_GCC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/configure new/nspr-4.10.9/nspr/configure --- old/nspr-4.10.8/nspr/configure 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/configure 2015-08-19 17:32:22.000000000 +0200 @@ -2489,7 +2489,7 @@ MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=10 -MOD_PATCH_VERSION=8 +MOD_PATCH_VERSION=9 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= @@ -2666,19 +2666,6 @@ if test -n "$gonkdir" ; then - if test -z "$HOST_CPPFLAGS" ; then - HOST_CPPFLAGS=" " - fi - if test -z "$HOST_CFLAGS" ; then - HOST_CFLAGS=" " - fi - if test -z "$HOST_CXXFLAGS" ; then - HOST_CXXFLAGS=" " - fi - if test -z "$HOST_LDFLAGS" ; then - HOST_LDFLAGS=" " - fi - $as_echo "#define ANDROID 1" >>confdefs.h else @@ -2763,19 +2750,6 @@ CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS" LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS" - if test -z "$HOST_CPPFLAGS" ; then - HOST_CPPFLAGS=" " - fi - if test -z "$HOST_CFLAGS" ; then - HOST_CFLAGS=" " - fi - if test -z "$HOST_CXXFLAGS" ; then - HOST_CXXFLAGS=" " - fi - if test -z "$HOST_LDFLAGS" ; then - HOST_LDFLAGS=" " - fi - $as_echo "#define ANDROID 1" >>confdefs.h ;; @@ -3152,12 +3126,6 @@ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS" CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS" ;; - *:arm*-apple-darwin*) - _SAVE_CFLAGS=$CFLAGS - _SAVE_CXXFLAGS=$CXXFLAGS - CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS" - CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS" - ;; esac for ac_prog in $CC "${target_alias}-gcc" "${target}-gcc" @@ -4621,12 +4589,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOST_CC" >&5 $as_echo "$HOST_CC" >&6; } - if test -z "$HOST_CFLAGS"; then - HOST_CFLAGS="$CFLAGS" - fi - if test -z "$HOST_LDFLAGS"; then - HOST_LDFLAGS="$LDFLAGS" - fi CC="$HOST_CC" CFLAGS="$HOST_CFLAGS" @@ -6584,6 +6546,7 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default" if test "x$ac_cv_header_crt_externs_h" = xyes; then : + $as_echo "#define HAVE_CRT_EXTERNS_H 1" >>confdefs.h fi @@ -7124,7 +7087,11 @@ _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p' - CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + if test -z "$CC_VERSION"; then + as_fn_error $? "Could not determine MSC version." "$LINENO" 5 + fi + _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'` _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'` _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'` @@ -7316,6 +7283,8 @@ $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h + if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/configure.in new/nspr-4.10.9/nspr/configure.in --- old/nspr-4.10.8/nspr/configure.in 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/configure.in 2015-08-19 17:32:22.000000000 +0200 @@ -16,7 +16,7 @@ dnl ======================================================== MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=10 -MOD_PATCH_VERSION=8 +MOD_PATCH_VERSION=9 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= @@ -160,20 +160,6 @@ if test -n "$gonkdir" ; then dnl Most things are directly configured by env vars when building for gonk - dnl prevent cross compile section from using these flags as host flags - if test -z "$HOST_CPPFLAGS" ; then - HOST_CPPFLAGS=" " - fi - if test -z "$HOST_CFLAGS" ; then - HOST_CFLAGS=" " - fi - if test -z "$HOST_CXXFLAGS" ; then - HOST_CXXFLAGS=" " - fi - if test -z "$HOST_LDFLAGS" ; then - HOST_LDFLAGS=" " - fi - AC_DEFINE(ANDROID) else case "$target" in @@ -257,20 +243,6 @@ CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS" LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS" - dnl prevent cross compile section from using these flags as host flags - if test -z "$HOST_CPPFLAGS" ; then - HOST_CPPFLAGS=" " - fi - if test -z "$HOST_CFLAGS" ; then - HOST_CFLAGS=" " - fi - if test -z "$HOST_CXXFLAGS" ; then - HOST_CXXFLAGS=" " - fi - if test -z "$HOST_LDFLAGS" ; then - HOST_LDFLAGS=" " - fi - AC_DEFINE(ANDROID) ;; esac @@ -596,15 +568,6 @@ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS" CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS" ;; - *:arm*-apple-darwin*) - dnl The arm compiler doesn't appear to know about its root by default, - dnl so explicitly pass it one here. Later on we'll put this in CFLAGS - dnl anyway. - _SAVE_CFLAGS=$CFLAGS - _SAVE_CXXFLAGS=$CXXFLAGS - CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS" - CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS" - ;; esac AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo) @@ -653,12 +616,6 @@ AC_MSG_ERROR([no acceptable cc found in \$PATH]) fi AC_MSG_RESULT([$HOST_CC]) - if test -z "$HOST_CFLAGS"; then - HOST_CFLAGS="$CFLAGS" - fi - if test -z "$HOST_LDFLAGS"; then - HOST_LDFLAGS="$LDFLAGS" - fi CC="$HOST_CC" CFLAGS="$HOST_CFLAGS" @@ -1412,7 +1369,7 @@ if test "`echo $CC | grep -c '\-arch '`" = "0"; then CC="$CC -arch $CPU_ARCH" fi - AC_CHECK_HEADER(crt_externs.h) + AC_CHECK_HEADER(crt_externs.h, AC_DEFINE(HAVE_CRT_EXTERNS_H)) DSO_CFLAGS=-fPIC DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names' _OPTIMIZE_FLAGS=-O2 @@ -1936,7 +1893,11 @@ changequote(,) _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p' changequote([,]) - CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + if test -z "$CC_VERSION"; then + AC_MSG_ERROR([Could not determine MSC version.]) + fi + _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'` _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'` _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'` @@ -2120,6 +2081,7 @@ AC_DEFINE(XP_UNIX) AC_DEFINE(NETBSD) AC_DEFINE(HAVE_BSD_FLOCK) + AC_DEFINE(HAVE_SOCKLEN_T) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/md/_freebsd.cfg new/nspr-4.10.9/nspr/pr/include/md/_freebsd.cfg --- old/nspr-4.10.8/nspr/pr/include/md/_freebsd.cfg 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/md/_freebsd.cfg 2015-08-19 17:32:22.000000000 +0200 @@ -392,6 +392,108 @@ #define PR_BYTES_PER_WORD_LOG2 2 #define PR_BYTES_PER_DWORD_LOG2 3 +#elif defined(__mips64__) + +#if defined(__MIPSEB__) || defined(_MIPSEB) +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#else +#undef IS_BIG_ENDIAN +#define IS_LITTLE_ENDIAN 1 +#endif + +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 +#define PR_ALIGN_OF_WORD 8 + +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#elif defined(__mips__) + +#if defined(__MIPSEB__) || defined(_MIPSEB) +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#else +#undef IS_BIG_ENDIAN +#define IS_LITTLE_ENDIAN 1 +#endif + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 4 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 4 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 32 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 32 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 5 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 5 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 4 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 4 +#define PR_ALIGN_OF_WORD 4 + +#define PR_BYTES_PER_WORD_LOG2 2 +#define PR_BYTES_PER_DWORD_LOG2 3 + #else #error "Unknown CPU architecture" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/md/_freebsd.h new/nspr-4.10.9/nspr/pr/include/md/_freebsd.h --- old/nspr-4.10.8/nspr/pr/include/md/_freebsd.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/md/_freebsd.h 2015-08-19 17:32:22.000000000 +0200 @@ -31,6 +31,10 @@ #define _PR_SI_ARCHITECTURE "powerpc" #elif defined(__arm__) #define _PR_SI_ARCHITECTURE "arm" +#elif defined(__mips64__) +#define _PR_SI_ARCHITECTURE "mips64" +#elif defined(__mips__) +#define _PR_SI_ARCHITECTURE "mips" #else #error "Unknown CPU architecture" #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/md/_linux.cfg new/nspr-4.10.9/nspr/pr/include/md/_linux.cfg --- old/nspr-4.10.8/nspr/pr/include/md/_linux.cfg 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/md/_linux.cfg 2015-08-19 17:32:22.000000000 +0200 @@ -508,6 +508,52 @@ #error "Unknown MIPS endianness." #endif +#ifdef _ABI64 + +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 +#define PR_ALIGN_OF_WORD 8 + +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#else /* _ABI64 */ + #define PR_BYTES_PER_BYTE 1 #define PR_BYTES_PER_SHORT 2 #define PR_BYTES_PER_INT 4 @@ -548,6 +594,8 @@ #define PR_BYTES_PER_WORD_LOG2 2 #define PR_BYTES_PER_DWORD_LOG2 3 +#endif /* _ABI64 */ + #elif defined(__arm__) #ifdef __ARMEB__ @@ -883,6 +931,51 @@ #undef IS_LITTLE_ENDIAN #define IS_BIG_ENDIAN 1 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 4 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 4 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 32 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 32 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 5 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 5 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 4 +#define PR_ALIGN_OF_INT64 4 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 4 +#define PR_ALIGN_OF_POINTER 4 +#define PR_ALIGN_OF_WORD 4 + +#define PR_BYTES_PER_WORD_LOG2 2 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#elif defined(__or1k__) + +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 #define PR_BYTES_PER_BYTE 1 #define PR_BYTES_PER_SHORT 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/md/_linux.h new/nspr-4.10.9/nspr/pr/include/md/_linux.h --- old/nspr-4.10.8/nspr/pr/include/md/_linux.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/md/_linux.h 2015-08-19 17:32:22.000000000 +0200 @@ -55,6 +55,8 @@ #define _PR_SI_ARCHITECTURE "avr32" #elif defined(__m32r__) #define _PR_SI_ARCHITECTURE "m32r" +#elif defined(__or1k__) +#define _PR_SI_ARCHITECTURE "or1k" #else #error "Unknown CPU architecture" #endif @@ -123,6 +125,18 @@ #define _MD_ATOMIC_SET _PR_x86_64_AtomicSet #endif +#if defined(__or1k__) +#if defined(__GNUC__) +/* Use GCC built-in functions */ +#define _PR_HAVE_ATOMIC_OPS +#define _MD_INIT_ATOMIC() +#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1) +#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1) +#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i) +#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv) +#endif +#endif + #if defined(__powerpc__) && !defined(__powerpc64__) #define _PR_HAVE_ATOMIC_OPS #define _MD_INIT_ATOMIC() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/prenv.h new/nspr-4.10.9/nspr/pr/include/prenv.h --- old/nspr-4.10.8/nspr/pr/include/prenv.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/prenv.h 2015-08-19 17:32:22.000000000 +0200 @@ -113,6 +113,36 @@ */ NSPR_API(PRStatus) PR_SetEnv(const char *string); +/* +** PR_DuplicateEnvironment() -- Obtain a copy of the environment. +** +** Description: +** PR_DuplicateEnvironment() copies the environment so that it can be +** modified without changing the current process's environment, and +** then passed to interfaces such as POSIX execve(). In particular, +** this avoids needing to allocate memory or take locks in the child +** after a fork(); neither of these is allowed by POSIX after a +** multithreaded process calls fork(), and PR_SetEnv does both. +** +** Inputs: +** none +** +** Returns: +** A pointer to a null-terminated array of null-terminated strings, +** like the traditional global variable "environ". The array and +** the strings are allocated with PR_Malloc(), and it is the +** caller's responsibility to free them. +** +** In case of memory allocation failure, or if the operating system +** doesn't support reading the entire environment through the global +** variable "environ" or similar, returns NULL instead. +** +** Restrictions: +** Similarly to PR_GetEnv(), this function may not interoperate as +** expected with the operating system's native environment accessors. +*/ +NSPR_API(char **) PR_DuplicateEnvironment(void); + PR_END_EXTERN_C #endif /* prenv_h___ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/prinit.h new/nspr-4.10.9/nspr/pr/include/prinit.h --- old/nspr-4.10.8/nspr/pr/include/prinit.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/prinit.h 2015-08-19 17:32:22.000000000 +0200 @@ -31,10 +31,10 @@ ** The format of the version string is ** "<major version>.<minor version>[.<patch level>] [<Beta>]" */ -#define PR_VERSION "4.10.8" +#define PR_VERSION "4.10.9" #define PR_VMAJOR 4 #define PR_VMINOR 10 -#define PR_VPATCH 8 +#define PR_VPATCH 9 #define PR_BETA PR_FALSE /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/prlog.h new/nspr-4.10.9/nspr/pr/include/prlog.h --- old/nspr-4.10.8/nspr/pr/include/prlog.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/prlog.h 2015-08-19 17:32:22.000000000 +0200 @@ -157,7 +157,8 @@ */ NSPR_API(void) PR_LogFlush(void); -NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln); +NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln) + PR_PRETEND_NORETURN; #if defined(DEBUG) || defined(FORCE_PR_LOG) #define PR_LOGGING 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/prtime.h new/nspr-4.10.9/nspr/pr/include/prtime.h --- old/nspr-4.10.8/nspr/pr/include/prtime.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/prtime.h 2015-08-19 17:32:22.000000000 +0200 @@ -248,14 +248,14 @@ /* Format a time value into a buffer. Same semantics as strftime() */ NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt, - const PRExplodedTime *tm); + const PRExplodedTime *time); -/* Format a time value into a buffer. Time is always in US English format, regardless - * of locale setting. +/* Format a time value into a buffer. Time is always in US English format, + * regardless of locale setting. */ NSPR_API(PRUint32) -PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize, - const char* format, const PRExplodedTime* tm ); +PR_FormatTimeUSEnglish(char *buf, PRUint32 bufSize, + const char *format, const PRExplodedTime *time); PR_END_EXTERN_C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/include/prtypes.h new/nspr-4.10.9/nspr/pr/include/prtypes.h --- old/nspr-4.10.8/nspr/pr/include/prtypes.h 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/include/prtypes.h 2015-08-19 17:32:22.000000000 +0200 @@ -510,6 +510,31 @@ typedef unsigned long PRUword; #endif +/* + * PR_PRETEND_NORETURN, specified at the end of a function declaration, + * indicates that for the purposes of static analysis, this function does not + * return. (The function definition does not need to be annotated.) + * + * void PR_Assert(const char *s, const char *file, PRIntn ln) + * PR_PRETEND_NORETURN; + * + * Some static analyzers, like scan-build from clang, can use this information + * to eliminate false positives. From the upstream documentation of + * scan-build: + * This attribute is useful for annotating assertion handlers that actually + * can return, but for the purpose of using the analyzer we want to pretend + * that such functions do not return. + */ +#ifdef __clang_analyzer__ +#if __has_extension(attribute_analyzer_noreturn) +#define PR_PRETEND_NORETURN __attribute__((analyzer_noreturn)) +#endif +#endif + +#ifndef PR_PRETEND_NORETURN +#define PR_PRETEND_NORETURN /* no support */ +#endif + #if defined(NO_NSPR_10_SUPPORT) #else /********* ???????????????? FIX ME ??????????????????????????? *****/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/Makefile.in new/nspr-4.10.9/nspr/pr/src/Makefile.in --- old/nspr-4.10.8/nspr/pr/src/Makefile.in 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/Makefile.in 2015-08-19 17:32:22.000000000 +0200 @@ -165,9 +165,9 @@ ifeq ($(OS_ARCH),WINNT) ifdef NS_USE_GCC -OS_LIBS = -ladvapi32 -lws2_32 -lwinmm +OS_LIBS = -ladvapi32 -lws2_32 -lmswsock -lwinmm else -OS_LIBS = advapi32.lib ws2_32.lib winmm.lib +OS_LIBS = advapi32.lib ws2_32.lib mswsock.lib winmm.lib endif endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/io/prfdcach.c new/nspr-4.10.9/nspr/pr/src/io/prfdcach.c --- old/nspr-4.10.8/nspr/pr/src/io/prfdcach.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/io/prfdcach.c 2015-08-19 17:32:22.000000000 +0200 @@ -213,7 +213,6 @@ void _PR_CleanupFdCache(void) { PRFileDesc *fd, *next; - PRStackElem *pop; for (fd = _pr_fd_cache.head; fd != NULL; fd = next) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/io/prmwait.c new/nspr-4.10.9/nspr/pr/src/io/prmwait.c --- old/nspr-4.10.8/nspr/pr/src/io/prmwait.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/io/prmwait.c 2015-08-19 17:32:22.000000000 +0200 @@ -475,6 +475,7 @@ PR_Lock(group->ml); if (_prmw_running != group->state) { + PR_DELETE(poll_list); PR_SetError(PR_INVALID_STATE_ERROR, 0); goto aborted; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/io/prprf.c new/nspr-4.10.9/nspr/pr/src/io/prprf.c --- old/nspr-4.10.8/nspr/pr/src/io/prprf.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/io/prprf.c 2015-08-19 17:32:22.000000000 +0200 @@ -66,7 +66,11 @@ #define NAS_DEFAULT_NUM 20 /* default number of NumberedArgument array */ - +/* +** For numeric types, the signed versions must have even values, +** and their corresponding unsigned versions must have the subsequent +** odd value. +*/ #define TYPE_INT16 0 #define TYPE_UINT16 1 #define TYPE_INTN 2 @@ -376,8 +380,8 @@ /* ** BuildArgArray stands for Numbered Argument list Sprintf -** for example, -** fmp = "%4$i, %2$d, %3s, %1d"; +** for example, +** fmt = "%4$i, %2$d, %3s, %1d"; ** the number must start from 1, and no gap among them */ @@ -515,6 +519,15 @@ nas[cn].type = TYPE_INT64; c = *p++; } + } else if (c == 'z') { + if (sizeof(size_t) == sizeof(PRInt32)) { + nas[ cn ].type = TYPE_INT32; + } else if (sizeof(size_t) == sizeof(PRInt64)) { + nas[ cn ].type = TYPE_INT64; + } else { + nas[ cn ].type = TYPE_UNKNOWN; + } + c = *p++; } /* format */ @@ -809,6 +822,13 @@ type = TYPE_INT64; c = *fmt++; } + } else if (c == 'z') { + if (sizeof(size_t) == sizeof(PRInt32)) { + type = TYPE_INT32; + } else if (sizeof(size_t) == sizeof(PRInt64)) { + type = TYPE_INT64; + } + c = *fmt++; } /* format */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/misc/prenv.c new/nspr-4.10.9/nspr/pr/src/misc/prenv.c --- old/nspr-4.10.8/nspr/pr/src/misc/prenv.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/misc/prenv.c 2015-08-19 17:32:22.000000000 +0200 @@ -5,6 +5,17 @@ #include <string.h> #include "primpl.h" +#include "prmem.h" + +#if defined(XP_UNIX) +#if defined(DARWIN) +#if defined(HAVE_CRT_EXTERNS_H) +#include <crt_externs.h> +#endif /* HAVE_CRT_EXTERNS_H */ +#else /* DARWIN */ +PR_IMPORT_DATA(char **) environ; +#endif /* DARWIN */ +#endif /* XP_UNIX */ /* Lock used to lock the environment */ #if defined(_PR_NO_PREEMPT) @@ -58,10 +69,59 @@ if (!_pr_initialized) _PR_ImplicitInitialization(); - if ( !strchr(string, '=')) return(PR_FAILURE); + if (!strchr(string, '=')) return(PR_FAILURE); _PR_LOCK_ENV(); - result = _PR_MD_PUT_ENV(string); + result = _PR_MD_PUT_ENV((char*)string); _PR_UNLOCK_ENV(); - return (result)? PR_FAILURE : PR_SUCCESS; + return result ? PR_FAILURE : PR_SUCCESS; } + +#if defined(XP_UNIX) && (!defined(DARWIN) || defined(HAVE_CRT_EXTERNS_H)) +PR_IMPLEMENT(char **) PR_DuplicateEnvironment(void) +{ + char **the_environ, **result, **end, **src, **dst; + + _PR_LOCK_ENV(); +#ifdef DARWIN + the_environ = *(_NSGetEnviron()); +#else + the_environ = environ; +#endif + + for (end = the_environ; *end != NULL; end++) + /* empty loop body */; + + result = (char **)PR_Malloc(sizeof(char *) * (end - the_environ + 1)); + if (result != NULL) { + for (src = the_environ, dst = result; src != end; src++, dst++) { + size_t len; + + len = strlen(*src) + 1; + *dst = PR_Malloc(len); + if (*dst == NULL) { + /* Allocation failed. Must clean up the half-copied env. */ + char **to_delete; + + for (to_delete = result; to_delete != dst; to_delete++) { + PR_Free(*to_delete); + } + PR_Free(result); + result = NULL; + goto out; + } + memcpy(*dst, *src, len); + } + *dst = NULL; + } + out: + _PR_UNLOCK_ENV(); + return result; +} +#else +/* This platform doesn't support raw access to the environ block. */ +PR_IMPLEMENT(char **) PR_DuplicateEnvironment(void) +{ + return NULL; +} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/misc/prinit.c new/nspr-4.10.9/nspr/pr/src/misc/prinit.c --- old/nspr-4.10.8/nspr/pr/src/misc/prinit.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/misc/prinit.c 2015-08-19 17:32:22.000000000 +0200 @@ -642,7 +642,10 @@ while (1) { if ((ptr[len] == ':') && (strncmp(ptr, name, len) == 0)) { ptr += len + 1; - PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd); + if (PR_sscanf(ptr, "%d:0x%" PR_SCNxOSFD, &fileType, &osfd) != 2) { + PR_SetError(PR_UNKNOWN_ERROR, 0); + return NULL; + } switch ((PRDescType)fileType) { case PR_DESC_FILE: fd = PR_ImportFile(osfd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/misc/prtime.c new/nspr-4.10.9/nspr/pr/src/misc/prtime.c --- old/nspr-4.10.8/nspr/pr/src/misc/prtime.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/misc/prtime.c 2015-08-19 17:32:22.000000000 +0200 @@ -1672,23 +1672,24 @@ */ PR_IMPLEMENT(PRUint32) -PR_FormatTime(char *buf, int buflen, const char *fmt, const PRExplodedTime *tm) +PR_FormatTime(char *buf, int buflen, const char *fmt, + const PRExplodedTime *time) { size_t rv; struct tm a; struct tm *ap; - if (tm) { + if (time) { ap = &a; - a.tm_sec = tm->tm_sec; - a.tm_min = tm->tm_min; - a.tm_hour = tm->tm_hour; - a.tm_mday = tm->tm_mday; - a.tm_mon = tm->tm_month; - a.tm_wday = tm->tm_wday; - a.tm_year = tm->tm_year - 1900; - a.tm_yday = tm->tm_yday; - a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0; + a.tm_sec = time->tm_sec; + a.tm_min = time->tm_min; + a.tm_hour = time->tm_hour; + a.tm_mday = time->tm_mday; + a.tm_mon = time->tm_month; + a.tm_wday = time->tm_wday; + a.tm_year = time->tm_year - 1900; + a.tm_yday = time->tm_yday; + a.tm_isdst = time->tm_params.tp_dst_offset ? 1 : 0; /* * On some platforms, for example SunOS 4, struct tm has two @@ -1699,8 +1700,8 @@ || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \ || defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID) a.tm_zone = NULL; - a.tm_gmtoff = tm->tm_params.tp_gmt_offset + - tm->tm_params.tp_dst_offset; + a.tm_gmtoff = time->tm_params.tp_gmt_offset + + time->tm_params.tp_dst_offset; #endif } else { ap = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/pthreads/ptsynch.c new/nspr-4.10.9/nspr/pr/src/pthreads/ptsynch.c --- old/nspr-4.10.8/nspr/pr/src/pthreads/ptsynch.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/pthreads/ptsynch.c 2015-08-19 17:32:22.000000000 +0200 @@ -322,13 +322,21 @@ PR_ASSERT(lock != NULL); if (cv != NULL) { - int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr); + int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr); PR_ASSERT(0 == rv); - cv->lock = lock; - cv->notify_pending = 0; + if (0 == rv) + { + cv->lock = lock; + cv->notify_pending = 0; #if defined(DEBUG) - pt_debug.cvars_created += 1; + pt_debug.cvars_created += 1; #endif + } + else + { + PR_DELETE(cv); + cv = NULL; + } } return cv; } /* PR_NewCondVar */ @@ -337,10 +345,13 @@ { if (0 > PR_ATOMIC_DECREMENT(&cvar->notify_pending)) { - PRIntn rv = pthread_cond_destroy(&cvar->cv); PR_ASSERT(0 == rv); + PRIntn rv = pthread_cond_destroy(&cvar->cv); #if defined(DEBUG) + PR_ASSERT(0 == rv); memset(cvar, 0xaf, sizeof(PRCondVar)); pt_debug.cvars_destroyed += 1; +#else + (void)rv; #endif PR_Free(cvar); } @@ -1181,9 +1192,17 @@ if (cv != NULL) { int rv; - rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr); + rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr); PR_ASSERT(0 == rv); - cv->lock = _PR_NAKED_CV_LOCK; + if (0 == rv) + { + cv->lock = _PR_NAKED_CV_LOCK; + } + else + { + PR_DELETE(cv); + cv = NULL; + } } return cv; } /* PRP_NewNakedCondVar */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/src/pthreads/ptthread.c new/nspr-4.10.9/nspr/pr/src/pthreads/ptthread.c --- old/nspr-4.10.8/nspr/pr/src/pthreads/ptthread.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/src/pthreads/ptthread.c 2015-08-19 17:32:22.000000000 +0200 @@ -680,7 +680,7 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thred, PRThreadPriority newPri) { - PRIntn rv = -1; + PRIntn rv; PR_ASSERT(NULL != thred); @@ -736,6 +736,8 @@ errno)); } } +#else + (void)rv; /* rv is unused */ #endif thred->priority = newPri; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/Makefile.in new/nspr-4.10.9/nspr/pr/tests/Makefile.in --- old/nspr-4.10.8/nspr/pr/tests/Makefile.in 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/Makefile.in 2015-08-19 17:32:22.000000000 +0200 @@ -111,6 +111,7 @@ prftest.c \ prftest1.c \ prftest2.c \ + prfz.c \ primblok.c \ priotest.c \ provider.c \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/README.TXT new/nspr-4.10.9/nspr/pr/tests/README.TXT --- old/nspr-4.10.8/nspr/pr/tests/README.TXT 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/README.TXT 2015-08-19 17:32:22.000000000 +0200 @@ -227,6 +227,9 @@ prftest2.c Obsolete. Subsumed in prftest.c +prfz.c + Tests printf handling of (s)size_t formats + priotest.c Limited use. Tests NSPR thread dispatching priority. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/env.c new/nspr-4.10.9/nspr/pr/tests/env.c --- old/nspr-4.10.8/nspr/pr/tests/env.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/env.c 2015-08-19 17:32:22.000000000 +0200 @@ -9,6 +9,7 @@ ** */ #include "prenv.h" +#include "prmem.h" #include "plgetopt.h" #include <stdio.h> @@ -113,6 +114,83 @@ } /* ---------------------------------------------------------------------- */ + /* check that PR_DuplicateEnvironment() agrees with PR_GetEnv() */ + { +#if defined(XP_UNIX) && (!defined(DARWIN) || defined(HAVE_CRT_EXTERNS_H)) + static const PRBool expect_failure = PR_FALSE; +#else + static const PRBool expect_failure = PR_TRUE; +#endif + char **i, **dupenv = PR_DuplicateEnvironment(); + + + if ( NULL == dupenv ) { + if (expect_failure) { + if (verbose) printf("env: PR_DuplicateEnvironment failed, " + "as expected on this platform.\n"); + } else { + if (debug) printf("env: PR_DuplicateEnvironment() failed.\n"); + failedAlready = PR_TRUE; + } + } else { + unsigned found = 0; + + if (expect_failure) { + if (debug) printf("env: PR_DuplicateEnvironment() succeeded, " + "but failure is expected on this platform.\n"); + failedAlready = PR_TRUE; + } else { + if (verbose) printf("env: PR_DuplicateEnvironment() succeeded.\n"); + } + for (i = dupenv; *i; i++) { + char *equals = strchr(*i, '='); + + if ( equals == NULL ) { + if (debug) printf("env: PR_DuplicateEnvironment() returned a string" + " with no '=': %s\n", *i); + failedAlready = PR_TRUE; + } else { + /* We own this string, so we can temporarily alter it */ + /* *i is the null-terminated name; equals + 1 is the value */ + *equals = '\0'; + + if ( strcmp(*i, ENVNAME) == 0) { + found++; + if (verbose) printf("env: PR_DuplicateEnvironment() found " ENVNAME + " (%u so far).\n", found); + } + + /* Multiple values for the same name can't happen, according to POSIX. */ + value = PR_GetEnv(*i); + if ( value == NULL ) { + if (debug) printf("env: PR_DuplicateEnvironment() returned a name" + " which PR_GetEnv() failed to find: %s\n", *i); + failedAlready = PR_TRUE; + } else if ( strcmp(equals + 1, value) != 0) { + if (debug) printf("env: PR_DuplicateEnvironment() returned the wrong" + " value for %s: expected %s; found %s\n", + *i, value, equals + 1); + failedAlready = PR_TRUE; + } else { + if (verbose) printf("env: PR_DuplicateEnvironment() agreed with" + " PR_GetEnv() about %s\n", *i); + } + } + PR_Free(*i); + } + PR_Free(dupenv); + + if (found != 1) { + if (debug) printf("env: PR_DuplicateEnvironment() found %u entries for " ENVNAME + " (expected 1)\n", found); + failedAlready = PR_TRUE; + } else { + if (verbose) printf("env: PR_DuplicateEnvironment() found 1 entry for " ENVNAME "\n"); + } + } + } + +/* ---------------------------------------------------------------------- */ /* un-set the variable, using RAW name... should not work */ envBuf = NewBuffer( ENVBUFSIZE ); sprintf( envBuf, ENVNAME ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/prfz.c new/nspr-4.10.9/nspr/pr/tests/prfz.c --- old/nspr-4.10.8/nspr/pr/tests/prfz.c 1970-01-01 01:00:00.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/prfz.c 2015-08-19 17:32:22.000000000 +0200 @@ -0,0 +1,84 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This is a simple test of the PR_fprintf() function for size_t formats. + */ + +#include "prprf.h" +#include <sys/types.h> +#include <limits.h> +#include <string.h> + +int +main(int argc, char **argv) +{ + char buffer[128]; + + size_t unsigned_small = 266; +#ifdef XP_UNIX + ssize_t signed_small_p = 943; + ssize_t signed_small_n = -1; +#endif + size_t unsigned_max = SIZE_MAX; + size_t unsigned_min = 0; +#ifdef XP_UNIX + ssize_t signed_max = SSIZE_MAX; +#endif + + printf("Test: unsigned small '%%zu' : "); + PR_snprintf(buffer, sizeof(buffer), "%zu", unsigned_small); + if (strncmp(buffer, "266", sizeof(buffer)) != 0) { + printf("Failed, got '%s'\n", buffer); + return -1; + } + printf("OK\n"); + +#ifdef XP_UNIX + printf("Test: signed small positive '%%zd' : "); + PR_snprintf(buffer, sizeof(buffer), "%zd", signed_small_p); + if (strncmp(buffer, "943", sizeof(buffer)) != 0) { + printf("Failed, got '%s'\n", buffer); + return -1; + } + printf("OK\n"); + + printf("Test: signed small negative '%%zd' : "); + PR_snprintf(buffer, sizeof(buffer), "%zd", signed_small_n); + if (strncmp(buffer, "-1", sizeof(buffer)) != 0) { + printf("Failed, got '%s'\n", buffer); + return -1; + } + printf("OK\n"); +#endif + + printf("Test: 0 '%%zu' : "); + PR_snprintf(buffer, sizeof(buffer), "%zu", unsigned_min); + if (strncmp(buffer, "0", sizeof(buffer)) != 0) { + printf("Failed, got '%s'\n", buffer); + return -1; + } + printf("OK\n"); + + printf("Test: SIZE_MAX '%%zx' : "); + PR_snprintf(buffer, sizeof(buffer), "%zx", unsigned_max); + if (strspn(buffer, "f") != sizeof(size_t) * 2) { + printf("Failed, got '%s'\n", buffer); + return -1; + } + printf("OK\n"); + +#ifdef XP_UNIX + printf("Test: SSIZE_MAX '%%zx' : "); + PR_snprintf(buffer, sizeof(buffer), "%zx", signed_max); + if (*buffer != '7' || + strspn(buffer + 1, "f") != sizeof(ssize_t) * 2 - 1) { + printf("Failed, got '%s'\n", buffer); + return -1; + } + printf("OK\n"); +#endif + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/runtests.pl new/nspr-4.10.9/nspr/pr/tests/runtests.pl --- old/nspr-4.10.8/nspr/pr/tests/runtests.pl 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/runtests.pl 2015-08-19 17:32:22.000000000 +0200 @@ -310,6 +310,7 @@ "poll_to", "pollable", "prftest", +"prfz", "primblok", "provider", "prpollml", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/runtests.sh new/nspr-4.10.9/nspr/pr/tests/runtests.sh --- old/nspr-4.10.8/nspr/pr/tests/runtests.sh 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/runtests.sh 2015-08-19 17:32:22.000000000 +0200 @@ -140,6 +140,7 @@ poll_to pollable prftest +prfz primblok provider prpollml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.10.8/nspr/pr/tests/vercheck.c new/nspr-4.10.9/nspr/pr/tests/vercheck.c --- old/nspr-4.10.8/nspr/pr/tests/vercheck.c 2015-01-22 21:44:59.000000000 +0100 +++ new/nspr-4.10.9/nspr/pr/tests/vercheck.c 2015-08-19 17:32:22.000000000 +0200 @@ -23,7 +23,7 @@ * This release (4.10.7) is backward compatible with the * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x, * 4.8.x, 4.9.x, 4.10, 4.10.1, 4.10.2, 4.10.3, 4.10.4, - * 4.10.5, 4.10.6 and 4.10.7 releases. + * 4.10.5, 4.10.6, 4.10.7 and 4.10.8 releases. * It, of course, is compatible with itself. */ static char *compatible_version[] = { @@ -39,7 +39,7 @@ "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5", "4.9.6", "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4", - "4.10.5", "4.10.6", "4.10.7", + "4.10.5", "4.10.6", "4.10.7", "4.10.8", PR_VERSION }; @@ -55,7 +55,7 @@ "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.10.9", + "4.10.10", "4.11", "4.11.1", "10.0", "11.1", "12.14.20" };
