Closed Bug 398587 Opened 17 years ago Closed 17 years ago

PRBool misuse bugs in dom/

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

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

References

Details

Attachments

(1 file, 4 obsolete files)

Attached patch Correct prbool misuse (obsolete) — Splinter Review
Manually corrected patch from prcheck
Attachment #283585 - Flags: review?(Olli.Pettay)
Comment on attachment 283585 [details] [diff] [review]
Correct prbool misuse

>Index: dom/src/base/nsDOMClassInfo.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/dom/src/base/nsDOMClassInfo.cpp,v
>retrieving revision 1.478
>--- dom/src/base/nsDOMClassInfo.cpp	28 Sep 2007 14:28:16 -0000	1.478
>+++ dom/src/base/nsDOMClassInfo.cpp	4 Oct 2007 18:33:22 -0000
>@@ -4224,17 +4224,17 @@ nsWindowSH::GlobalScopePolluterNewResolv
...
>-    NS_ENSURE_SUCCESS(rv, rv);
>+    NS_ENSURE_SUCCESS(rv, PR_FALSE);


the method returns JSBool, not PRBool, so use JS_FALSE

> 
>-  *aSecure = (PRBool)secureInt;
>+  *aSecure = (PRBool)(0 != secureInt);
> 

Why do you need (PRBool) casting?
Attached patch Correct prbool misuse (obsolete) — Splinter Review
Thanks for spotting the JS_Bool. Took out the cast too. Can you review this one too?
Attachment #283585 - Attachment is obsolete: true
Attachment #283585 - Flags: review?(Olli.Pettay)
Comment on attachment 283589 [details] [diff] [review]
Correct prbool misuse

>+  *aSecure = 0 != secureInt;
I'd prefer *aSecure = (0 != secureInt);
Attachment #283589 - Flags: review+
Attached patch Reviewed: Correct prbool misuse (obsolete) — Splinter Review
Attachment #283589 - Attachment is obsolete: true
Attachment #283591 - Flags: approval1.9?
Attached patch Corrected prbool misuse (obsolete) — Splinter Review
Changed 0 != to !! to be consistent with other patches of this sort.
Attachment #283591 - Attachment is obsolete: true
Attachment #283784 - Flags: review?(Olli.Pettay)
Attachment #283591 - Flags: approval1.9?
Attachment #283784 - Flags: review?(Olli.Pettay) → review+
Attachment #283784 - Flags: approval1.9?
Comment on attachment 283784 [details] [diff] [review]
Corrected prbool misuse

a=release drivers
Attachment #283784 - Flags: approval1.9? → approval1.9+
Attachment #283784 - Attachment is obsolete: true
Checking in dom/src/base/nsDOMClassInfo.cpp;
/cvsroot/mozilla/dom/src/base/nsDOMClassInfo.cpp,v  <--  nsDOMClassInfo.cpp
new revision: 1.490; previous revision: 1.489
done
Checking in dom/src/storage/nsDOMStorageDB.cpp;
/cvsroot/mozilla/dom/src/storage/nsDOMStorageDB.cpp,v  <--  nsDOMStorageDB.cpp
new revision: 1.9; previous revision: 1.8
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: