Closed Bug 398568 Opened 18 years ago Closed 18 years ago

PRBool misuse bugs in netwerk/

Categories

(Core :: Networking, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: taras.mozilla, Assigned: taras.mozilla)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch PRbool fixes (obsolete) — Splinter Review
This is the automatic patch produced by prcheck. The misuse in netwerk is relatively harmless compared to other modules.
Attachment #283565 - Flags: review?(cbiesinger)
Attached patch PRBool fixes, take 2 (obsolete) — Splinter Review
Updated patch to use !!. Took out the problematic hunk for now: --- netwerk/base/src/nsLoadGroup.cpp 18 Jul 2007 21:37:40 -0000 1.73 +++ netwerk/base/src/nsLoadGroup.cpp 4 Oct 2007 17:03:39 -0000 @@ -708,17 +708,17 @@ nsLoadGroup::RemoveRequest(nsIRequest *r // hash to an nsISupportsArray. PR_STATIC_CALLBACK(PLDHashOperator) AppendRequestsToISupportsArray(PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg) { RequestMapEntry *e = static_cast<RequestMapEntry *>(hdr); nsISupportsArray *array = static_cast<nsISupportsArray *>(arg); - PRBool ok = array->AppendElement(e->mKey); + PRBool ok = !!array->AppendElement(e->mKey); if (!ok) { return PL_DHASH_STOP; } return PL_DHASH_NEXT; }
Attachment #283565 - Attachment is obsolete: true
Attachment #283757 - Flags: review?(cbiesinger)
Attachment #283565 - Flags: review?(cbiesinger)
The problem is that nsISupportsArray inherits from nsICollection which specifies AppendElement as returning nsresult.
Comment on attachment 283757 [details] [diff] [review] PRBool fixes, take 2 I preferred 0 !=...
Attachment #283757 - Flags: review?(cbiesinger) → review-
Same as original patch but without the AppendElement() issue. Note that this would be the only patch in the series to use 0 !=.
Attachment #283757 - Attachment is obsolete: true
Attachment #284176 - Flags: review?(cbiesinger)
Christian, Can you review the patch?
Attachment #284176 - Flags: review?(cbiesinger) → review+
Attachment #284176 - Flags: approval1.9?
Comment on attachment 284176 [details] [diff] [review] PRBool fixes, take 3 a1.9+=damons
Attachment #284176 - Flags: approval1.9? → approval1.9+
Checking in netwerk/cache/src/nsCacheRequest.h; /cvsroot/mozilla/netwerk/cache/src/nsCacheRequest.h,v <-- nsCacheRequest.h new revision: 1.19; previous revision: 1.18 done Checking in netwerk/cache/src/nsCacheSession.h; /cvsroot/mozilla/netwerk/cache/src/nsCacheSession.h,v <-- nsCacheSession.h new revision: 1.6; previous revision: 1.5 done Checking in netwerk/cache/src/nsDiskCacheMap.h; /cvsroot/mozilla/netwerk/cache/src/nsDiskCacheMap.h,v <-- nsDiskCacheMap.h new revision: 1.20; previous revision: 1.19 done Checking in netwerk/cookie/src/nsCookieService.cpp; /cvsroot/mozilla/netwerk/cookie/src/nsCookieService.cpp,v <-- nsCookieService.cpp new revision: 1.87; previous revision: 1.86 done Checking in netwerk/protocol/http/src/nsHttpChannel.cpp; /cvsroot/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp,v <-- nsHttpChannel.cpp new revision: 1.327; previous revision: 1.326 done Checking in netwerk/streamconv/converters/mozTXTToHTMLConv.cpp; /cvsroot/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp,v <-- mozTXTToHTMLConv.cpp new revision: 1.87; previous revision: 1.86 done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: