diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index 018e487b3f0..d14a719ab1f 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_10_7_RTM +NSPR_4_10_8_BETA2 diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index 6c66b37ca0f..e49e92677e3 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,4 +10,3 @@ */ #error "Do not include this header file." - diff --git a/nsprpub/config/rules.mk b/nsprpub/config/rules.mk index cc01759307f..cbbf5f3a067 100644 --- a/nsprpub/config/rules.mk +++ b/nsprpub/config/rules.mk @@ -83,15 +83,19 @@ ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH))) 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) -IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_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) -IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb 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 LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) diff --git a/nsprpub/configure b/nsprpub/configure index 40d342c0697..5ccdf23209c 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -2489,7 +2489,7 @@ test -n "$target_alias" && MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=10 -MOD_PATCH_VERSION=7 +MOD_PATCH_VERSION=8 NSPR_MODNAME=nspr20 _HAVE_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 USE_PTHREADS=1 fi - DSO_LDOPTS='-shared -fPIC' + DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)' MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' ;; diff --git a/nsprpub/configure.in b/nsprpub/configure.in index fba01aefef2..dac9b31cc5d 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -16,7 +16,7 @@ dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=10 -MOD_PATCH_VERSION=7 +MOD_PATCH_VERSION=8 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= @@ -2178,7 +2178,7 @@ tools are selected during the Xcode/Developer Tools installation.]) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 fi - DSO_LDOPTS='-shared -fPIC' + DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)' MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' ;; diff --git a/nsprpub/pr/include/md/_freebsd.cfg b/nsprpub/pr/include/md/_freebsd.cfg index c120460f688..aa81dace53d 100644 --- a/nsprpub/pr/include/md/_freebsd.cfg +++ b/nsprpub/pr/include/md/_freebsd.cfg @@ -251,6 +251,147 @@ #define PR_ALIGN_OF_POINTER 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 #error "Unknown CPU architecture" diff --git a/nsprpub/pr/include/md/_freebsd.h b/nsprpub/pr/include/md/_freebsd.h index 1ea7b607e0f..5550fa9db70 100644 --- a/nsprpub/pr/include/md/_freebsd.h +++ b/nsprpub/pr/include/md/_freebsd.h @@ -25,6 +25,12 @@ #define _PR_SI_ARCHITECTURE "ia64" #elif defined(__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 #error "Unknown CPU architecture" #endif diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index a2b13658d73..032398c79c6 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.10.7" +#define PR_VERSION "4.10.8 Beta" #define PR_VMAJOR 4 #define PR_VMINOR 10 -#define PR_VPATCH 7 -#define PR_BETA PR_FALSE +#define PR_VPATCH 8 +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/nsprpub/pr/src/cplus/rcnetdb.cpp b/nsprpub/pr/src/cplus/rcnetdb.cpp index f8bd0acd3db..042943bc4bf 100644 --- a/nsprpub/pr/src/cplus/rcnetdb.cpp +++ b/nsprpub/pr/src/cplus/rcnetdb.cpp @@ -35,7 +35,7 @@ RCNetAddr::RCNetAddr(RCNetAddr::HostValue host, PRUint16 port): RCBase() { case RCNetAddr::any: how = PR_IpAddrAny; 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); } /* RCNetAddr::RCNetAddr */ diff --git a/nsprpub/pr/src/io/prfdcach.c b/nsprpub/pr/src/io/prfdcach.c index 9ca84dc9609..16892bc90e0 100644 --- a/nsprpub/pr/src/io/prfdcach.c +++ b/nsprpub/pr/src/io/prfdcach.c @@ -31,13 +31,11 @@ typedef struct _PR_Fd_Cache { PRLock *ml; PRIntn count; - PRStack *stack; PRFileDesc *head, *tail; PRIntn limit_low, limit_high; } _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) { - PRStackElem *pop; - 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); + goto allocate; } else { @@ -128,18 +122,9 @@ void _PR_Putfd(PRFileDesc *fd) fd->identity = PR_INVALID_IO_LAYER; 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)); - } - else - { - if (_pr_fd_cache.count > _pr_fd_cache.limit_high) - { - PR_Free(fd->secret); - PR_Free(fd); - } - else + if (_pr_fd_cache.count < _pr_fd_cache.limit_high) { PR_Lock(_pr_fd_cache.ml); if (NULL == _pr_fd_cache.tail) @@ -157,8 +142,12 @@ void _PR_Putfd(PRFileDesc *fd) fd->higher = NULL; /* always so */ _pr_fd_cache.count += 1; /* count the new entry */ PR_Unlock(_pr_fd_cache.ml); + return; } } + + PR_Free(fd->secret); + PR_Free(fd); } /* _PR_Putfd */ 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 */ 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; - if (was_using_stack) /* was using stack - feed into cache */ - { - 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_fd_cache.limit_high = high; + _pr_fd_cache.limit_low = low; PR_Unlock(_pr_fd_cache.ml); return PR_SUCCESS; } /* PR_SetFDCacheSize */ @@ -258,8 +207,6 @@ void _PR_InitFdCache(void) _pr_fd_cache.ml = PR_NewLock(); PR_ASSERT(NULL != _pr_fd_cache.ml); - _pr_fd_cache.stack = PR_CreateStack("FD"); - PR_ASSERT(NULL != _pr_fd_cache.stack); } /* _PR_InitFdCache */ @@ -279,14 +226,6 @@ void _PR_CleanupFdCache(void) _pr_fd_cache.count = 0; PR_DestroyLock(_pr_fd_cache.ml); _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 */ /* prfdcach.c */ diff --git a/nsprpub/pr/src/io/priometh.c b/nsprpub/pr/src/io/priometh.c index f254328e987..4208767d545 100644 --- a/nsprpub/pr/src/io/priometh.c +++ b/nsprpub/pr/src/io/priometh.c @@ -51,14 +51,14 @@ PRIOMethods _pr_faulty_methods = { 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); return -1; } /* _PR_InvalidInt */ 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); return -1; } /* _PR_InvalidInt */ @@ -67,7 +67,7 @@ PRInt64 _PR_InvalidInt64(void) { PRInt64 rv; 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); return rv; } /* _PR_InvalidInt */ @@ -78,7 +78,7 @@ PRInt64 _PR_InvalidInt64(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); return PR_FAILURE; } /* _PR_InvalidDesc */ @@ -89,7 +89,7 @@ PRStatus _PR_InvalidStatus(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); return NULL; } /* _PR_InvalidDesc */ diff --git a/nsprpub/pr/src/io/prlog.c b/nsprpub/pr/src/io/prlog.c index eec95e8a75d..dae80282d9a 100644 --- a/nsprpub/pr/src/io/prlog.c +++ b/nsprpub/pr/src/io/prlog.c @@ -537,6 +537,9 @@ PR_IMPLEMENT(void) PR_LogFlush(void) PR_IMPLEMENT(void) PR_Abort(void) { PR_LogPrint("Aborting"); +#ifdef ANDROID + __android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting"); +#endif abort(); } @@ -547,9 +550,11 @@ PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln) fflush(stderr); #ifdef WIN32 DebugBreak(); -#endif -#ifdef XP_OS2 +#elif defined(XP_OS2) asm("int $3"); +#elif defined(ANDROID) + __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n", + s, file, ln); #endif abort(); } diff --git a/nsprpub/pr/src/io/prmwait.c b/nsprpub/pr/src/io/prmwait.c index 78813c468f3..5982a1cfa9d 100644 --- a/nsprpub/pr/src/io/prmwait.c +++ b/nsprpub/pr/src/io/prmwait.c @@ -658,7 +658,7 @@ static void NT_TimeProc(void *arg) if (closesocket(bottom->secret->md.osfd) == SOCKET_ERROR) { fprintf(stderr, "closesocket failed: %d\n", WSAGetLastError()); - PR_ASSERT(!"What shall I do?"); + PR_NOT_REACHED("What shall I do?"); } } return; diff --git a/nsprpub/pr/src/linking/prlink.c b/nsprpub/pr/src/linking/prlink.c index d9ad10a8de3..47154608a37 100644 --- a/nsprpub/pr/src/linking/prlink.c +++ b/nsprpub/pr/src/linking/prlink.c @@ -1036,7 +1036,7 @@ PR_UnloadLibrary(PRLibrary *lib) * fail (the library is not on the _pr_loadmap list), * 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) { PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); status = PR_FAILURE; diff --git a/nsprpub/pr/src/md/os2/os2thred.c b/nsprpub/pr/src/md/os2/os2thred.c index b918a741c06..edb9f5f0c58 100644 --- a/nsprpub/pr/src/md/os2/os2thred.c +++ b/nsprpub/pr/src/md/os2/os2thred.c @@ -272,7 +272,7 @@ PR_EXTERN(PRInt32) _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask ) { /* Can we do this on OS/2? Only on SMP versions? */ - PR_ASSERT(!"Not implemented"); + PR_NOT_REACHED("Not implemented"); return 0; /* This is what windows does: @@ -288,7 +288,7 @@ PR_EXTERN(PRInt32) _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask) { /* Can we do this on OS/2? Only on SMP versions? */ - PR_ASSERT(!"Not implemented"); + PR_NOT_REACHED("Not implemented"); return 0; /* This is what windows does: diff --git a/nsprpub/pr/src/misc/prolock.c b/nsprpub/pr/src/misc/prolock.c index 312e1f47f96..38b77878980 100644 --- a/nsprpub/pr/src/misc/prolock.c +++ b/nsprpub/pr/src/misc/prolock.c @@ -19,7 +19,7 @@ PR_IMPLEMENT(PROrderedLock *) 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); return NULL; } /* end PR_CreateOrderedLock() */ @@ -30,7 +30,7 @@ PR_IMPLEMENT(void) PROrderedLock *lock ) { - PR_ASSERT(!"Not implemented"); /* Not implemented yet */ + PR_NOT_REACHED("Not implemented"); /* Not implemented yet */ PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); } /* end PR_DestroyOrderedLock() */ @@ -40,7 +40,7 @@ PR_IMPLEMENT(void) PROrderedLock *lock ) { - PR_ASSERT(!"Not implemented"); /* Not implemented yet */ + PR_NOT_REACHED("Not implemented"); /* Not implemented yet */ PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); } /* end PR_LockOrderedLock() */ @@ -50,7 +50,7 @@ PR_IMPLEMENT(PRStatus) PROrderedLock *lock ) { - PR_ASSERT(!"Not implemented"); /* Not implemented yet */ + PR_NOT_REACHED("Not implemented"); /* Not implemented yet */ PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; } /* end PR_UnlockOrderedLock() */ diff --git a/nsprpub/pr/src/pthreads/ptthread.c b/nsprpub/pr/src/pthreads/ptthread.c index 4ab564a25db..16d06f6559b 100644 --- a/nsprpub/pr/src/pthreads/ptthread.c +++ b/nsprpub/pr/src/pthreads/ptthread.c @@ -54,7 +54,7 @@ static struct _PT_Bookeeping pthread_key_t key; /* thread private data key */ PRBool keyCreated; /* whether 'key' should be deleted */ 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 */ #endif } 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 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) { #ifdef NTO @@ -325,11 +325,11 @@ static PRThread* _PR_CreateThread( 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; #endif -#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) +#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0 rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED); PR_ASSERT(0 == rv); #endif @@ -339,7 +339,7 @@ static PRThread* _PR_CreateThread( #if defined(_PR_DCETHREADS) rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority)); PR_ASSERT(0 == rv); -#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING) +#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0 rv = pthread_attr_getschedparam(&tattr, &schedule); PR_ASSERT(0 == rv); schedule.sched_priority = pt_PriorityMap(priority); @@ -396,7 +396,7 @@ static PRThread* _PR_CreateThread( scope = PR_GLOBAL_THREAD; 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); if (rv) { /* @@ -471,7 +471,7 @@ static PRThread* _PR_CreateThread( PR_LOG(_pr_thread_lm, PR_LOG_MIN, ("_PR_CreateThread: no thread scheduling privilege")); /* 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); PR_ASSERT(0 == rv); #endif @@ -692,7 +692,7 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thred, PRThreadPriority newPri #if defined(_PR_DCETHREADS) rv = pthread_setprio(thred->id, pt_PriorityMap(newPri)); /* pthread_setprio returns the old priority */ -#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING) +#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0 if (EPERM != pt_schedpriv) { int policy; @@ -921,7 +921,7 @@ void _PR_InitThreads( pthread_init(); #endif -#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING) +#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0 #if defined(FREEBSD) { pthread_attr_t attr; diff --git a/nsprpub/pr/src/threads/combined/pruthr.c b/nsprpub/pr/src/threads/combined/pruthr.c index 825ed89ec67..4625ab2466e 100644 --- a/nsprpub/pr/src/threads/combined/pruthr.c +++ b/nsprpub/pr/src/threads/combined/pruthr.c @@ -73,13 +73,13 @@ void _PR_InitThreads(PRThreadType type, PRThreadPriority priority, #ifndef HAVE_CUSTOM_USER_THREADS stack = PR_NEWZAP(PRThreadStack); #ifdef HAVE_STACK_GROWING_UP - stack->stackTop = (char*) ((((long)&type) >> _pr_pageShift) + stack->stackTop = (char*) ((((PRWord)&type) >> _pr_pageShift) << _pr_pageShift); #else #if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS) stack->stackTop = (char*) &thread; #else - stack->stackTop = (char*) ((((long)&type + _pr_pageSize - 1) + stack->stackTop = (char*) ((((PRWord)&type + _pr_pageSize - 1) >> _pr_pageShift) << _pr_pageShift); #endif #endif @@ -174,12 +174,12 @@ static void _PR_InitializeNativeStack(PRThreadStack *ts) ** Setup stackTop and stackBottom values. */ #ifdef HAVE_STACK_GROWING_UP - ts->allocBase = (char*) ((((long)&ts) >> _pr_pageShift) + ts->allocBase = (char*) ((((PRWord)&ts) >> _pr_pageShift) << _pr_pageShift); ts->stackBottom = ts->allocBase + ts->stackSize; ts->stackTop = ts->allocBase; #else - ts->allocBase = (char*) ((((long)&ts + _pr_pageSize - 1) + ts->allocBase = (char*) ((((PRWord)&ts + _pr_pageSize - 1) >> _pr_pageShift) << _pr_pageShift); ts->stackTop = ts->allocBase; ts->stackBottom = ts->allocBase - ts->stackSize; diff --git a/nsprpub/pr/tests/io_timeout.c b/nsprpub/pr/tests/io_timeout.c index b83ff37471f..fa6399c11cc 100644 --- a/nsprpub/pr/tests/io_timeout.c +++ b/nsprpub/pr/tests/io_timeout.c @@ -72,7 +72,7 @@ thread_main(void *_info) scope_str = GLOBAL_BOUND_SCOPE_STRING; break; default: - PR_ASSERT(!"Invalid thread scope"); + PR_NOT_REACHED("Invalid thread scope"); break; } printf("thread id %d, scope %s\n", info->id, scope_str); diff --git a/nsprpub/pr/tests/multiwait.c b/nsprpub/pr/tests/multiwait.c index a24342a99c2..61b08df1574 100644 --- a/nsprpub/pr/tests/multiwait.c +++ b/nsprpub/pr/tests/multiwait.c @@ -506,7 +506,7 @@ static void PR_CALLBACK ServerThread(void *arg) { if (PR_PENDING_INTERRUPT_ERROR == PR_GetError()) break; PL_PrintError("Accept failed"); - MW_ASSERT(!"Accept failed"); + MW_ASSERT(PR_FALSE && "Accept failed"); } else { diff --git a/nsprpub/pr/tests/nblayer.c b/nsprpub/pr/tests/nblayer.c index 553db6b6dd6..0d9aec42169 100644 --- a/nsprpub/pr/tests/nblayer.c +++ b/nsprpub/pr/tests/nblayer.c @@ -104,7 +104,7 @@ static void PR_CALLBACK Client(void *arg) ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT); if ((1 != ready) /* if not 1, then we're dead */ || (0 == (polldesc.in_flags & polldesc.out_flags))) - { PR_ASSERT(!"Whoa!"); break; } + { PR_NOT_REACHED("Whoa!"); break; } if (verbosity > quiet) PR_fprintf( 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); if ((1 != ready) /* if not 1, then we're dead */ || (0 == (polldesc.in_flags & polldesc.out_flags))) - { PR_ASSERT(!"Whoa!"); break; } + { PR_NOT_REACHED("Whoa!"); break; } } else break; } 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); if ((1 != ready) /* if not 1, then we're dead */ || (0 == (polldesc.in_flags & polldesc.out_flags))) - { PR_ASSERT(!"Whoa!"); break; } + { PR_NOT_REACHED("Whoa!"); break; } } else break; } 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); if ((1 != ready) /* if not 1, then we're dead */ || (0 == (polldesc.in_flags & polldesc.out_flags))) - { PR_ASSERT(!"Whoa!"); break; } + { PR_NOT_REACHED("Whoa!"); break; } } } while (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); if ((1 != ready) /* if not 1, then we're dead */ || (0 == (polldesc.in_flags & polldesc.out_flags))) - { PR_ASSERT(!"Whoa!"); break; } + { PR_NOT_REACHED("Whoa!"); break; } } else break; } 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); if ((1 != ready) /* if not 1, then we're dead */ || (0 == (polldesc.in_flags & polldesc.out_flags))) - { PR_ASSERT(!"Whoa!"); break; } + { PR_NOT_REACHED("Whoa!"); break; } } else break; } while (bytes_sent < bytes_read); @@ -329,7 +329,7 @@ static PRInt16 PR_CALLBACK MyPoll( 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); if (verbosity > chatty) PR_fprintf( diff --git a/nsprpub/pr/tests/priotest.c b/nsprpub/pr/tests/priotest.c index ca7897e2446..577d55333e5 100644 --- a/nsprpub/pr/tests/priotest.c +++ b/nsprpub/pr/tests/priotest.c @@ -186,7 +186,7 @@ int main(int argc, char **argv) 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 */ } /* main */ diff --git a/nsprpub/pr/tests/rwlockrank.c b/nsprpub/pr/tests/rwlockrank.c index 8d128f324d6..5872fa17430 100644 --- a/nsprpub/pr/tests/rwlockrank.c +++ b/nsprpub/pr/tests/rwlockrank.c @@ -22,7 +22,7 @@ static void rwtest(void *args) PR_RWLock_Rlock(rwlock1); PR_RWLock_Unlock(rwlock1); - // Test correct lock rank. + /* Test correct lock rank. */ PR_RWLock_Rlock(rwlock1); PR_RWLock_Rlock(rwlock2); PR_RWLock_Unlock(rwlock2); @@ -41,7 +41,7 @@ static void rwtest(void *args) PR_RWLock_Unlock(rwlock1); #if 0 - // Test incorrect lock rank. + /* Test incorrect lock rank. */ PR_RWLock_Rlock(rwlock2); PR_RWLock_Rlock(rwlock1); PR_RWLock_Unlock(rwlock1); diff --git a/nsprpub/pr/tests/socket.c b/nsprpub/pr/tests/socket.c index 3544ba5ec4f..5ee2b78f381 100644 --- a/nsprpub/pr/tests/socket.c +++ b/nsprpub/pr/tests/socket.c @@ -328,7 +328,7 @@ PRInt32 native_thread = 0; native_thread = 1; break; default: - PR_ASSERT(!"Invalid scope"); + PR_NOT_REACHED("Invalid scope"); break; } if (native_thread) { diff --git a/nsprpub/pr/tests/testfile.c b/nsprpub/pr/tests/testfile.c index b5f07fa599a..23659876ef5 100644 --- a/nsprpub/pr/tests/testfile.c +++ b/nsprpub/pr/tests/testfile.c @@ -120,7 +120,7 @@ PRInt32 native_thread = 0; native_thread = 1; break; default: - PR_ASSERT(!"Invalid scope"); + PR_NOT_REACHED("Invalid scope"); break; } if (native_thread) { diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index f9f183b3ee7..8647dbfa4ac 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -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, and 4.10.6 releases. + * 4.10.5, 4.10.6 and 4.10.7 releases. * It, of course, is compatible with itself. */ 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.6", "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 }; @@ -55,7 +55,7 @@ static char *incompatible_version[] = { "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.10.8", + "4.10.9", "4.11", "4.11.1", "10.0", "11.1", "12.14.20" };