summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwchang0222%aol.com <devnull@localhost>2004-04-12 23:53:42 +0000
committerwchang0222%aol.com <devnull@localhost>2004-04-12 23:53:42 +0000
commite90c8d14a66cb149c3267f215ba22af491920684 (patch)
treea70ac4da4860e81a6089a420dedfa4f8699f4fa2
parent7527f8fb09a2647f7e4a1a62f949a4bd6aec7541 (diff)
downloadnspr-hg-e90c8d14a66cb149c3267f215ba22af491920684.tar.gz
Bugzilla bug 238563: fixed errors reported by an IBM internal tool.
r=darin. Thanks to Philip K. Warren for running the automated tool on NSPR. Modified Files: prcountr.c prdtoa.c prtrace.c prtpd.c Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/src/misc/prcountr.c2
-rw-r--r--pr/src/misc/prdtoa.c5
-rw-r--r--pr/src/misc/prtrace.c2
-rw-r--r--pr/src/threads/prtpd.c10
4 files changed, 10 insertions, 9 deletions
diff --git a/pr/src/misc/prcountr.c b/pr/src/misc/prcountr.c
index b5f6ae23..a3e57465 100644
--- a/pr/src/misc/prcountr.c
+++ b/pr/src/misc/prcountr.c
@@ -284,7 +284,7 @@ PR_IMPLEMENT(PRCounterHandle)
)
{
const char *qn, *rn, *desc;
- PRCounterHandle qh, rh;
+ PRCounterHandle qh, rh = NULL;
RName *rnp = NULL;
PR_LOG( lm, PR_LOG_DEBUG, ("PR_Counter: GetCounterHandleFromName:\n\t"
diff --git a/pr/src/misc/prdtoa.c b/pr/src/misc/prdtoa.c
index 78b509e6..fad511ee 100644
--- a/pr/src/misc/prdtoa.c
+++ b/pr/src/misc/prdtoa.c
@@ -577,7 +577,7 @@ static PRInt32 lo0bits(unsigned Long *y)
if (!(x & 1)) {
k++;
x >>= 1;
- if (!x & 1)
+ if (!x)
return 32;
}
*y = x;
@@ -2342,6 +2342,7 @@ PR_dtoa(PRFloat64 d, int mode, int ndigits,
/* Check for special case that d is a normalized power of 2. */
+ spec_case = 0;
if (mode < 2) {
if (!word1(d) && !(word0(d) & Bndry_mask)
#ifndef Sudden_Underflow
@@ -2353,8 +2354,6 @@ PR_dtoa(PRFloat64 d, int mode, int ndigits,
s2 += Log2P;
spec_case = 1;
}
- else
- spec_case = 0;
}
/* Arrange for convenient computation of quotients:
diff --git a/pr/src/misc/prtrace.c b/pr/src/misc/prtrace.c
index f861557c..b6007cf2 100644
--- a/pr/src/misc/prtrace.c
+++ b/pr/src/misc/prtrace.c
@@ -569,7 +569,7 @@ PR_IMPLEMENT(PRTraceHandle)
)
{
const char *qn, *rn, *desc;
- PRTraceHandle qh, rh;
+ PRTraceHandle qh, rh = NULL;
RName *rnp = NULL;
PR_LOG( lm, PR_LOG_DEBUG, ("PRTrace: GetTraceHandleFromName:\n\t"
diff --git a/pr/src/threads/prtpd.c b/pr/src/threads/prtpd.c
index 6d8fd416..ca15ee4b 100644
--- a/pr/src/threads/prtpd.c
+++ b/pr/src/threads/prtpd.c
@@ -189,10 +189,12 @@ PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void *priv)
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
return PR_FAILURE;
}
- (void)memcpy(
- extension, self->privateData,
- self->tpdLength * sizeof(void*));
- PR_DELETE(self->privateData);
+ if (self->privateData) {
+ (void)memcpy(
+ extension, self->privateData,
+ self->tpdLength * sizeof(void*));
+ PR_DELETE(self->privateData);
+ }
self->tpdLength = _pr_tpd_length;
self->privateData = (void**)extension;
}