Bug 1119469: update NSPR to NSPR_4_10_8_BETA2 r=ted

Uplifts bugs 1106600, 1105144, 1072454, 1107063, 756047, 782113, 1060292, 573192 and 1060401
This commit is contained in:
Landry Breuil 2015-01-09 09:58:22 +01:00
parent ef69860b7b
commit 95c9c173d6
26 changed files with 221 additions and 127 deletions

View File

@ -1 +1 @@
NSPR_4_10_7_RTM NSPR_4_10_8_BETA2

View File

@ -10,4 +10,3 @@
*/ */
#error "Do not include this header file." #error "Do not include this header file."

View File

@ -83,15 +83,19 @@ ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET))) ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET)))
LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
else else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
endif endif
ifdef MSC_VER
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
else
IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
endif
else else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)

4
nsprpub/configure vendored
View File

@ -2489,7 +2489,7 @@ test -n "$target_alias" &&
MOD_MAJOR_VERSION=4 MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10 MOD_MINOR_VERSION=10
MOD_PATCH_VERSION=7 MOD_PATCH_VERSION=8
NSPR_MODNAME=nspr20 NSPR_MODNAME=nspr20
_HAVE_PTHREADS= _HAVE_PTHREADS=
USE_PTHREADS= USE_PTHREADS=
@ -7382,7 +7382,7 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
if test -z "$USE_NSPR_THREADS"; then if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1 USE_PTHREADS=1
fi fi
DSO_LDOPTS='-shared -fPIC' DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
;; ;;

View File

@ -16,7 +16,7 @@ dnl = Defaults
dnl ======================================================== dnl ========================================================
MOD_MAJOR_VERSION=4 MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10 MOD_MINOR_VERSION=10
MOD_PATCH_VERSION=7 MOD_PATCH_VERSION=8
NSPR_MODNAME=nspr20 NSPR_MODNAME=nspr20
_HAVE_PTHREADS= _HAVE_PTHREADS=
USE_PTHREADS= USE_PTHREADS=
@ -2178,7 +2178,7 @@ tools are selected during the Xcode/Developer Tools installation.])
if test -z "$USE_NSPR_THREADS"; then if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1 USE_PTHREADS=1
fi fi
DSO_LDOPTS='-shared -fPIC' DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
;; ;;

View File

@ -251,6 +251,147 @@
#define PR_ALIGN_OF_POINTER 8 #define PR_ALIGN_OF_POINTER 8
#define PR_ALIGN_OF_WORD 8 #define PR_ALIGN_OF_WORD 8
#elif defined(__powerpc64__)
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1
#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(__powerpc__)
#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 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
#elif defined(__arm__)
#if defined(__ARMEB__) || defined(__ARM_BIG_ENDIAN__)
#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 #else
#error "Unknown CPU architecture" #error "Unknown CPU architecture"

View File

@ -25,6 +25,12 @@
#define _PR_SI_ARCHITECTURE "ia64" #define _PR_SI_ARCHITECTURE "ia64"
#elif defined(__amd64__) #elif defined(__amd64__)
#define _PR_SI_ARCHITECTURE "amd64" #define _PR_SI_ARCHITECTURE "amd64"
#elif defined(__powerpc64__)
#define _PR_SI_ARCHITECTURE "powerpc64"
#elif defined(__powerpc__)
#define _PR_SI_ARCHITECTURE "powerpc"
#elif defined(__arm__)
#define _PR_SI_ARCHITECTURE "arm"
#else #else
#error "Unknown CPU architecture" #error "Unknown CPU architecture"
#endif #endif

View File

@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is ** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]" ** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/ */
#define PR_VERSION "4.10.7" #define PR_VERSION "4.10.8 Beta"
#define PR_VMAJOR 4 #define PR_VMAJOR 4
#define PR_VMINOR 10 #define PR_VMINOR 10
#define PR_VPATCH 7 #define PR_VPATCH 8
#define PR_BETA PR_FALSE #define PR_BETA PR_TRUE
/* /*
** PRVersionCheck ** PRVersionCheck

View File

@ -35,7 +35,7 @@ RCNetAddr::RCNetAddr(RCNetAddr::HostValue host, PRUint16 port): RCBase()
{ {
case RCNetAddr::any: how = PR_IpAddrAny; break; case RCNetAddr::any: how = PR_IpAddrAny; break;
case RCNetAddr::loopback: how = PR_IpAddrLoopback; break; case RCNetAddr::loopback: how = PR_IpAddrLoopback; break;
default: PR_ASSERT(!"This can't happen -- and did!"); default: PR_NOT_REACHED("This can't happen -- and did!");
} }
(void)PR_InitializeNetAddr(how, port, &address); (void)PR_InitializeNetAddr(how, port, &address);
} /* RCNetAddr::RCNetAddr */ } /* RCNetAddr::RCNetAddr */

View File

@ -31,13 +31,11 @@ typedef struct _PR_Fd_Cache
{ {
PRLock *ml; PRLock *ml;
PRIntn count; PRIntn count;
PRStack *stack;
PRFileDesc *head, *tail; PRFileDesc *head, *tail;
PRIntn limit_low, limit_high; PRIntn limit_low, limit_high;
} _PR_Fd_Cache; } _PR_Fd_Cache;
static _PR_Fd_Cache _pr_fd_cache; static _PR_Fd_Cache _pr_fd_cache;
static PRFileDesc **stack2fd = &(((PRFileDesc*)NULL)->higher);
/* /*
@ -59,11 +57,7 @@ PRFileDesc *_PR_Getfd(void)
*/ */
if (0 == _pr_fd_cache.limit_high) if (0 == _pr_fd_cache.limit_high)
{ {
PRStackElem *pop; goto allocate;
PR_ASSERT(NULL != _pr_fd_cache.stack);
pop = PR_StackPop(_pr_fd_cache.stack);
if (NULL == pop) goto allocate;
fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
} }
else else
{ {
@ -128,18 +122,9 @@ void _PR_Putfd(PRFileDesc *fd)
fd->identity = PR_INVALID_IO_LAYER; fd->identity = PR_INVALID_IO_LAYER;
fd->secret->state = _PR_FILEDESC_FREED; fd->secret->state = _PR_FILEDESC_FREED;
if (0 == _pr_fd_cache.limit_high) if (0 != _pr_fd_cache.limit_high)
{ {
PR_StackPush(_pr_fd_cache.stack, (PRStackElem*)(&fd->higher)); if (_pr_fd_cache.count < _pr_fd_cache.limit_high)
}
else
{
if (_pr_fd_cache.count > _pr_fd_cache.limit_high)
{
PR_Free(fd->secret);
PR_Free(fd);
}
else
{ {
PR_Lock(_pr_fd_cache.ml); PR_Lock(_pr_fd_cache.ml);
if (NULL == _pr_fd_cache.tail) if (NULL == _pr_fd_cache.tail)
@ -157,8 +142,12 @@ void _PR_Putfd(PRFileDesc *fd)
fd->higher = NULL; /* always so */ fd->higher = NULL; /* always so */
_pr_fd_cache.count += 1; /* count the new entry */ _pr_fd_cache.count += 1; /* count the new entry */
PR_Unlock(_pr_fd_cache.ml); PR_Unlock(_pr_fd_cache.ml);
return;
} }
} }
PR_Free(fd->secret);
PR_Free(fd);
} /* _PR_Putfd */ } /* _PR_Putfd */
PR_IMPLEMENT(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high) PR_IMPLEMENT(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high)
@ -173,48 +162,8 @@ PR_IMPLEMENT(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high)
if (low > high) low = high; /* sanity check the params */ if (low > high) low = high; /* sanity check the params */
PR_Lock(_pr_fd_cache.ml); PR_Lock(_pr_fd_cache.ml);
if (0 == high) /* shutting down or staying down */
{
if (0 != _pr_fd_cache.limit_high) /* shutting down */
{
_pr_fd_cache.limit_high = 0; /* stop use */
/*
** Hold the lock throughout - nobody's going to want it
** other than another caller to this routine. Just don't
** let that happen.
**
** Put all the cached fds onto the new cache.
*/
while (NULL != _pr_fd_cache.head)
{
PRFileDesc *fd = _pr_fd_cache.head;
_pr_fd_cache.head = fd->higher;
PR_StackPush(_pr_fd_cache.stack, (PRStackElem*)(&fd->higher));
}
_pr_fd_cache.limit_low = 0;
_pr_fd_cache.tail = NULL;
_pr_fd_cache.count = 0;
}
}
else /* starting up or just adjusting parameters */
{
PRBool was_using_stack = (0 == _pr_fd_cache.limit_high);
_pr_fd_cache.limit_low = low;
_pr_fd_cache.limit_high = high; _pr_fd_cache.limit_high = high;
if (was_using_stack) /* was using stack - feed into cache */ _pr_fd_cache.limit_low = low;
{
PRStackElem *pop;
while (NULL != (pop = PR_StackPop(_pr_fd_cache.stack)))
{
PRFileDesc *fd = (PRFileDesc*)
((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
if (NULL == _pr_fd_cache.tail) _pr_fd_cache.tail = fd;
fd->higher = _pr_fd_cache.head;
_pr_fd_cache.head = fd;
_pr_fd_cache.count += 1;
}
}
}
PR_Unlock(_pr_fd_cache.ml); PR_Unlock(_pr_fd_cache.ml);
return PR_SUCCESS; return PR_SUCCESS;
} /* PR_SetFDCacheSize */ } /* PR_SetFDCacheSize */
@ -258,8 +207,6 @@ void _PR_InitFdCache(void)
_pr_fd_cache.ml = PR_NewLock(); _pr_fd_cache.ml = PR_NewLock();
PR_ASSERT(NULL != _pr_fd_cache.ml); PR_ASSERT(NULL != _pr_fd_cache.ml);
_pr_fd_cache.stack = PR_CreateStack("FD");
PR_ASSERT(NULL != _pr_fd_cache.stack);
} /* _PR_InitFdCache */ } /* _PR_InitFdCache */
@ -279,14 +226,6 @@ void _PR_CleanupFdCache(void)
_pr_fd_cache.count = 0; _pr_fd_cache.count = 0;
PR_DestroyLock(_pr_fd_cache.ml); PR_DestroyLock(_pr_fd_cache.ml);
_pr_fd_cache.ml = NULL; _pr_fd_cache.ml = NULL;
while ((pop = PR_StackPop(_pr_fd_cache.stack)) != NULL)
{
fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
PR_DELETE(fd->secret);
PR_DELETE(fd);
}
PR_DestroyStack(_pr_fd_cache.stack);
_pr_fd_cache.stack = NULL;
} /* _PR_CleanupFdCache */ } /* _PR_CleanupFdCache */
/* prfdcach.c */ /* prfdcach.c */

View File

@ -51,14 +51,14 @@ PRIOMethods _pr_faulty_methods = {
PRIntn _PR_InvalidInt(void) PRIntn _PR_InvalidInt(void)
{ {
PR_ASSERT(!"I/O method is invalid"); PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0); PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return -1; return -1;
} /* _PR_InvalidInt */ } /* _PR_InvalidInt */
PRInt16 _PR_InvalidInt16(void) PRInt16 _PR_InvalidInt16(void)
{ {
PR_ASSERT(!"I/O method is invalid"); PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0); PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return -1; return -1;
} /* _PR_InvalidInt */ } /* _PR_InvalidInt */
@ -67,7 +67,7 @@ PRInt64 _PR_InvalidInt64(void)
{ {
PRInt64 rv; PRInt64 rv;
LL_I2L(rv, -1); LL_I2L(rv, -1);
PR_ASSERT(!"I/O method is invalid"); PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0); PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return rv; return rv;
} /* _PR_InvalidInt */ } /* _PR_InvalidInt */
@ -78,7 +78,7 @@ PRInt64 _PR_InvalidInt64(void)
PRStatus _PR_InvalidStatus(void) PRStatus _PR_InvalidStatus(void)
{ {
PR_ASSERT(!"I/O method is invalid"); PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0); PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return PR_FAILURE; return PR_FAILURE;
} /* _PR_InvalidDesc */ } /* _PR_InvalidDesc */
@ -89,7 +89,7 @@ PRStatus _PR_InvalidStatus(void)
PRFileDesc *_PR_InvalidDesc(void) PRFileDesc *_PR_InvalidDesc(void)
{ {
PR_ASSERT(!"I/O method is invalid"); PR_NOT_REACHED("I/O method is invalid");
PR_SetError(PR_INVALID_METHOD_ERROR, 0); PR_SetError(PR_INVALID_METHOD_ERROR, 0);
return NULL; return NULL;
} /* _PR_InvalidDesc */ } /* _PR_InvalidDesc */

View File

@ -537,6 +537,9 @@ PR_IMPLEMENT(void) PR_LogFlush(void)
PR_IMPLEMENT(void) PR_Abort(void) PR_IMPLEMENT(void) PR_Abort(void)
{ {
PR_LogPrint("Aborting"); PR_LogPrint("Aborting");
#ifdef ANDROID
__android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting");
#endif
abort(); abort();
} }
@ -547,9 +550,11 @@ PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
fflush(stderr); fflush(stderr);
#ifdef WIN32 #ifdef WIN32
DebugBreak(); DebugBreak();
#endif #elif defined(XP_OS2)
#ifdef XP_OS2
asm("int $3"); asm("int $3");
#elif defined(ANDROID)
__android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n",
s, file, ln);
#endif #endif
abort(); abort();
} }

View File

@ -658,7 +658,7 @@ static void NT_TimeProc(void *arg)
if (closesocket(bottom->secret->md.osfd) == SOCKET_ERROR) if (closesocket(bottom->secret->md.osfd) == SOCKET_ERROR)
{ {
fprintf(stderr, "closesocket failed: %d\n", WSAGetLastError()); fprintf(stderr, "closesocket failed: %d\n", WSAGetLastError());
PR_ASSERT(!"What shall I do?"); PR_NOT_REACHED("What shall I do?");
} }
} }
return; return;

View File

@ -1036,7 +1036,7 @@ PR_UnloadLibrary(PRLibrary *lib)
* fail (the library is not on the _pr_loadmap list), * fail (the library is not on the _pr_loadmap list),
* but don't wipe out an error from dlclose/shl_unload. * but don't wipe out an error from dlclose/shl_unload.
*/ */
PR_ASSERT(!"_pr_loadmap and lib->refCount inconsistent"); PR_NOT_REACHED("_pr_loadmap and lib->refCount inconsistent");
if (result == 0) { if (result == 0) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
status = PR_FAILURE; status = PR_FAILURE;

View File

@ -272,7 +272,7 @@ PR_EXTERN(PRInt32)
_PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask ) _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask )
{ {
/* Can we do this on OS/2? Only on SMP versions? */ /* Can we do this on OS/2? Only on SMP versions? */
PR_ASSERT(!"Not implemented"); PR_NOT_REACHED("Not implemented");
return 0; return 0;
/* This is what windows does: /* This is what windows does:
@ -288,7 +288,7 @@ PR_EXTERN(PRInt32)
_PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask) _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask)
{ {
/* Can we do this on OS/2? Only on SMP versions? */ /* Can we do this on OS/2? Only on SMP versions? */
PR_ASSERT(!"Not implemented"); PR_NOT_REACHED("Not implemented");
return 0; return 0;
/* This is what windows does: /* This is what windows does:

View File

@ -19,7 +19,7 @@ PR_IMPLEMENT(PROrderedLock *)
const char *name const char *name
) )
{ {
PR_ASSERT(!"Not implemented"); /* Not implemented yet */ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return NULL; return NULL;
} /* end PR_CreateOrderedLock() */ } /* end PR_CreateOrderedLock() */
@ -30,7 +30,7 @@ PR_IMPLEMENT(void)
PROrderedLock *lock PROrderedLock *lock
) )
{ {
PR_ASSERT(!"Not implemented"); /* Not implemented yet */ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
} /* end PR_DestroyOrderedLock() */ } /* end PR_DestroyOrderedLock() */
@ -40,7 +40,7 @@ PR_IMPLEMENT(void)
PROrderedLock *lock PROrderedLock *lock
) )
{ {
PR_ASSERT(!"Not implemented"); /* Not implemented yet */ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
} /* end PR_LockOrderedLock() */ } /* end PR_LockOrderedLock() */
@ -50,7 +50,7 @@ PR_IMPLEMENT(PRStatus)
PROrderedLock *lock PROrderedLock *lock
) )
{ {
PR_ASSERT(!"Not implemented"); /* Not implemented yet */ PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE; return PR_FAILURE;
} /* end PR_UnlockOrderedLock() */ } /* end PR_UnlockOrderedLock() */

View File

@ -54,7 +54,7 @@ static struct _PT_Bookeeping
pthread_key_t key; /* thread private data key */ pthread_key_t key; /* thread private data key */
PRBool keyCreated; /* whether 'key' should be deleted */ PRBool keyCreated; /* whether 'key' should be deleted */
PRThread *first, *last; /* list of threads we know about */ PRThread *first, *last; /* list of threads we know about */
#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
PRInt32 minPrio, maxPrio; /* range of scheduling priorities */ PRInt32 minPrio, maxPrio; /* range of scheduling priorities */
#endif #endif
} pt_book = {0}; } pt_book = {0};
@ -63,7 +63,7 @@ static void _pt_thread_death(void *arg);
static void _pt_thread_death_internal(void *arg, PRBool callDestructors); static void _pt_thread_death_internal(void *arg, PRBool callDestructors);
static void init_pthread_gc_support(void); static void init_pthread_gc_support(void);
#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
static PRIntn pt_PriorityMap(PRThreadPriority pri) static PRIntn pt_PriorityMap(PRThreadPriority pri)
{ {
#ifdef NTO #ifdef NTO
@ -325,11 +325,11 @@ static PRThread* _PR_CreateThread(
if (EPERM != pt_schedpriv) if (EPERM != pt_schedpriv)
{ {
#if !defined(_PR_DCETHREADS) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if !defined(_PR_DCETHREADS) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
struct sched_param schedule; struct sched_param schedule;
#endif #endif
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED); rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED);
PR_ASSERT(0 == rv); PR_ASSERT(0 == rv);
#endif #endif
@ -339,7 +339,7 @@ static PRThread* _PR_CreateThread(
#if defined(_PR_DCETHREADS) #if defined(_PR_DCETHREADS)
rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority)); rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority));
PR_ASSERT(0 == rv); PR_ASSERT(0 == rv);
#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_getschedparam(&tattr, &schedule); rv = pthread_attr_getschedparam(&tattr, &schedule);
PR_ASSERT(0 == rv); PR_ASSERT(0 == rv);
schedule.sched_priority = pt_PriorityMap(priority); schedule.sched_priority = pt_PriorityMap(priority);
@ -396,7 +396,7 @@ static PRThread* _PR_CreateThread(
scope = PR_GLOBAL_THREAD; scope = PR_GLOBAL_THREAD;
if (PR_GLOBAL_BOUND_THREAD == scope) { if (PR_GLOBAL_BOUND_THREAD == scope) {
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM); rv = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
if (rv) { if (rv) {
/* /*
@ -471,7 +471,7 @@ static PRThread* _PR_CreateThread(
PR_LOG(_pr_thread_lm, PR_LOG_MIN, PR_LOG(_pr_thread_lm, PR_LOG_MIN,
("_PR_CreateThread: no thread scheduling privilege")); ("_PR_CreateThread: no thread scheduling privilege"));
/* Try creating the thread again without setting priority. */ /* Try creating the thread again without setting priority. */
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
rv = pthread_attr_setinheritsched(&tattr, PTHREAD_INHERIT_SCHED); rv = pthread_attr_setinheritsched(&tattr, PTHREAD_INHERIT_SCHED);
PR_ASSERT(0 == rv); PR_ASSERT(0 == rv);
#endif #endif
@ -692,7 +692,7 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thred, PRThreadPriority newPri
#if defined(_PR_DCETHREADS) #if defined(_PR_DCETHREADS)
rv = pthread_setprio(thred->id, pt_PriorityMap(newPri)); rv = pthread_setprio(thred->id, pt_PriorityMap(newPri));
/* pthread_setprio returns the old priority */ /* pthread_setprio returns the old priority */
#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
if (EPERM != pt_schedpriv) if (EPERM != pt_schedpriv)
{ {
int policy; int policy;
@ -921,7 +921,7 @@ void _PR_InitThreads(
pthread_init(); pthread_init();
#endif #endif
#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING) #if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
#if defined(FREEBSD) #if defined(FREEBSD)
{ {
pthread_attr_t attr; pthread_attr_t attr;

View File

@ -73,13 +73,13 @@ void _PR_InitThreads(PRThreadType type, PRThreadPriority priority,
#ifndef HAVE_CUSTOM_USER_THREADS #ifndef HAVE_CUSTOM_USER_THREADS
stack = PR_NEWZAP(PRThreadStack); stack = PR_NEWZAP(PRThreadStack);
#ifdef HAVE_STACK_GROWING_UP #ifdef HAVE_STACK_GROWING_UP
stack->stackTop = (char*) ((((long)&type) >> _pr_pageShift) stack->stackTop = (char*) ((((PRWord)&type) >> _pr_pageShift)
<< _pr_pageShift); << _pr_pageShift);
#else #else
#if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS) #if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS)
stack->stackTop = (char*) &thread; stack->stackTop = (char*) &thread;
#else #else
stack->stackTop = (char*) ((((long)&type + _pr_pageSize - 1) stack->stackTop = (char*) ((((PRWord)&type + _pr_pageSize - 1)
>> _pr_pageShift) << _pr_pageShift); >> _pr_pageShift) << _pr_pageShift);
#endif #endif
#endif #endif
@ -174,12 +174,12 @@ static void _PR_InitializeNativeStack(PRThreadStack *ts)
** Setup stackTop and stackBottom values. ** Setup stackTop and stackBottom values.
*/ */
#ifdef HAVE_STACK_GROWING_UP #ifdef HAVE_STACK_GROWING_UP
ts->allocBase = (char*) ((((long)&ts) >> _pr_pageShift) ts->allocBase = (char*) ((((PRWord)&ts) >> _pr_pageShift)
<< _pr_pageShift); << _pr_pageShift);
ts->stackBottom = ts->allocBase + ts->stackSize; ts->stackBottom = ts->allocBase + ts->stackSize;
ts->stackTop = ts->allocBase; ts->stackTop = ts->allocBase;
#else #else
ts->allocBase = (char*) ((((long)&ts + _pr_pageSize - 1) ts->allocBase = (char*) ((((PRWord)&ts + _pr_pageSize - 1)
>> _pr_pageShift) << _pr_pageShift); >> _pr_pageShift) << _pr_pageShift);
ts->stackTop = ts->allocBase; ts->stackTop = ts->allocBase;
ts->stackBottom = ts->allocBase - ts->stackSize; ts->stackBottom = ts->allocBase - ts->stackSize;

View File

@ -72,7 +72,7 @@ thread_main(void *_info)
scope_str = GLOBAL_BOUND_SCOPE_STRING; scope_str = GLOBAL_BOUND_SCOPE_STRING;
break; break;
default: default:
PR_ASSERT(!"Invalid thread scope"); PR_NOT_REACHED("Invalid thread scope");
break; break;
} }
printf("thread id %d, scope %s\n", info->id, scope_str); printf("thread id %d, scope %s\n", info->id, scope_str);

View File

@ -506,7 +506,7 @@ static void PR_CALLBACK ServerThread(void *arg)
{ {
if (PR_PENDING_INTERRUPT_ERROR == PR_GetError()) break; if (PR_PENDING_INTERRUPT_ERROR == PR_GetError()) break;
PL_PrintError("Accept failed"); PL_PrintError("Accept failed");
MW_ASSERT(!"Accept failed"); MW_ASSERT(PR_FALSE && "Accept failed");
} }
else else
{ {

View File

@ -104,7 +104,7 @@ static void PR_CALLBACK Client(void *arg)
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */ if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags))) || (0 == (polldesc.in_flags & polldesc.out_flags)))
{ PR_ASSERT(!"Whoa!"); break; } { PR_NOT_REACHED("Whoa!"); break; }
if (verbosity > quiet) if (verbosity > quiet)
PR_fprintf( PR_fprintf(
logFile, "Client connect 'in progress' [0x%x]\n", logFile, "Client connect 'in progress' [0x%x]\n",
@ -143,7 +143,7 @@ static void PR_CALLBACK Client(void *arg)
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */ if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags))) || (0 == (polldesc.in_flags & polldesc.out_flags)))
{ PR_ASSERT(!"Whoa!"); break; } { PR_NOT_REACHED("Whoa!"); break; }
} }
else break; else break;
} while (bytes_sent < sizeof(buffer)); } while (bytes_sent < sizeof(buffer));
@ -171,7 +171,7 @@ static void PR_CALLBACK Client(void *arg)
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */ if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags))) || (0 == (polldesc.in_flags & polldesc.out_flags)))
{ PR_ASSERT(!"Whoa!"); break; } { PR_NOT_REACHED("Whoa!"); break; }
} }
else break; else break;
} while (bytes_read < bytes_sent); } while (bytes_read < bytes_sent);
@ -213,7 +213,7 @@ static void PR_CALLBACK Server(void *arg)
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */ if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags))) || (0 == (polldesc.in_flags & polldesc.out_flags)))
{ PR_ASSERT(!"Whoa!"); break; } { PR_NOT_REACHED("Whoa!"); break; }
} }
} while (NULL == service); } while (NULL == service);
PR_ASSERT(NULL != service); PR_ASSERT(NULL != service);
@ -244,7 +244,7 @@ static void PR_CALLBACK Server(void *arg)
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */ if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags))) || (0 == (polldesc.in_flags & polldesc.out_flags)))
{ PR_ASSERT(!"Whoa!"); break; } { PR_NOT_REACHED("Whoa!"); break; }
} }
else break; else break;
} while (bytes_read < sizeof(buffer)); } while (bytes_read < sizeof(buffer));
@ -273,7 +273,7 @@ static void PR_CALLBACK Server(void *arg)
ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
if ((1 != ready) /* if not 1, then we're dead */ if ((1 != ready) /* if not 1, then we're dead */
|| (0 == (polldesc.in_flags & polldesc.out_flags))) || (0 == (polldesc.in_flags & polldesc.out_flags)))
{ PR_ASSERT(!"Whoa!"); break; } { PR_NOT_REACHED("Whoa!"); break; }
} }
else break; else break;
} while (bytes_sent < bytes_read); } while (bytes_sent < bytes_read);
@ -329,7 +329,7 @@ static PRInt16 PR_CALLBACK MyPoll(
default: break; default: break;
} }
} }
else PR_ASSERT(!"How'd I get here?"); else PR_NOT_REACHED("How'd I get here?");
new_flags = (fd->lower->methods->poll)(fd->lower, my_flags, out_flags); new_flags = (fd->lower->methods->poll)(fd->lower, my_flags, out_flags);
if (verbosity > chatty) if (verbosity > chatty)
PR_fprintf( PR_fprintf(

View File

@ -186,7 +186,7 @@ int main(int argc, char **argv)
PR_ProcessExit((failed) ? 1 : 0); PR_ProcessExit((failed) ? 1 : 0);
PR_ASSERT(!"You can't get here -- but you did!"); PR_NOT_REACHED("You can't get here -- but you did!");
return 1; /* or here */ return 1; /* or here */
} /* main */ } /* main */

View File

@ -22,7 +22,7 @@ static void rwtest(void *args)
PR_RWLock_Rlock(rwlock1); PR_RWLock_Rlock(rwlock1);
PR_RWLock_Unlock(rwlock1); PR_RWLock_Unlock(rwlock1);
// Test correct lock rank. /* Test correct lock rank. */
PR_RWLock_Rlock(rwlock1); PR_RWLock_Rlock(rwlock1);
PR_RWLock_Rlock(rwlock2); PR_RWLock_Rlock(rwlock2);
PR_RWLock_Unlock(rwlock2); PR_RWLock_Unlock(rwlock2);
@ -41,7 +41,7 @@ static void rwtest(void *args)
PR_RWLock_Unlock(rwlock1); PR_RWLock_Unlock(rwlock1);
#if 0 #if 0
// Test incorrect lock rank. /* Test incorrect lock rank. */
PR_RWLock_Rlock(rwlock2); PR_RWLock_Rlock(rwlock2);
PR_RWLock_Rlock(rwlock1); PR_RWLock_Rlock(rwlock1);
PR_RWLock_Unlock(rwlock1); PR_RWLock_Unlock(rwlock1);

View File

@ -328,7 +328,7 @@ PRInt32 native_thread = 0;
native_thread = 1; native_thread = 1;
break; break;
default: default:
PR_ASSERT(!"Invalid scope"); PR_NOT_REACHED("Invalid scope");
break; break;
} }
if (native_thread) { if (native_thread) {

View File

@ -120,7 +120,7 @@ PRInt32 native_thread = 0;
native_thread = 1; native_thread = 1;
break; break;
default: default:
PR_ASSERT(!"Invalid scope"); PR_NOT_REACHED("Invalid scope");
break; break;
} }
if (native_thread) { if (native_thread) {

View File

@ -23,7 +23,7 @@
* This release (4.10.7) is backward compatible with the * 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.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.8.x, 4.9.x, 4.10, 4.10.1, 4.10.2, 4.10.3, 4.10.4,
* 4.10.5, and 4.10.6 releases. * 4.10.5, 4.10.6 and 4.10.7 releases.
* It, of course, is compatible with itself. * It, of course, is compatible with itself.
*/ */
static char *compatible_version[] = { static char *compatible_version[] = {
@ -39,7 +39,7 @@ static char *compatible_version[] = {
"4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5", "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5",
"4.9.6", "4.9.6",
"4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4", "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4",
"4.10.5", "4.10.6", "4.10.5", "4.10.6", "4.10.7",
PR_VERSION PR_VERSION
}; };
@ -55,7 +55,7 @@ static char *incompatible_version[] = {
"3.0", "3.0.1", "3.0", "3.0.1",
"3.1", "3.1.1", "3.1.2", "3.1.3", "3.1", "3.1.1", "3.1.2", "3.1.3",
"3.5", "3.5.1", "3.5", "3.5.1",
"4.10.8", "4.10.9",
"4.11", "4.11.1", "4.11", "4.11.1",
"10.0", "11.1", "12.14.20" "10.0", "11.1", "12.14.20"
}; };