Closed
Bug 583618
Opened 15 years ago
Closed 13 years ago
Fix PRBool misuses in mailnews
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 10.0
People
(Reporter: standard8, Assigned: standard8)
Details
Attachments
(1 file)
2.50 KB,
patch
|
neil
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
As discovered in bug 582523 we are mis-using the PRBool values across the xpconnect boundary.
The case causing test failures is nsMsgHdr::GetIsFlagged, however there's at least one other instance in that file, and I suspect others dotted around.
It would probably also help to do regular static analysis on mailnews, but I'll be filing on a new bug that.
Assignee | ||
Comment 1•14 years ago
|
||
This fixes some of the instances in mailnews/db/msgdb - which should also fix the xpcshell tests.
I've also done a few changes so that where we're returning a PRBool result, the flag checks are a more consistent format.
I also spotted a missing arg check in nsDBFolderInfo so I added that.
I took a look around at other areas of mailnews, but haven't found anything yet. As the majority of the tests pass on trunk, I'm going to assume we're reasonably all right, but getting static analysis done soon will be a priority.
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
Attachment #462020 -
Flags: superreview?(neil)
Attachment #462020 -
Flags: review?(neil)
Comment 2•14 years ago
|
||
Comment on attachment 462020 [details] [diff] [review]
Fix some nsMsgDatabase errors
>@@ -3999,7 +3999,7 @@ nsresult nsMsgDatabase::GetBooleanProper
> {
> PRUint32 res;
> nsresult rv = GetUint32Property(row, propertyName, &res, (PRUint32) defaultValue);
>- *result = (PRBool) res;
>+ *result = (res != 0);
> return rv;
> }
Always assuming we called SetBooleanProperty with either PR_TRUE or PR_FALSE, I would have hoped that we would only read back PR_TRUE or PR_FALSE ;-)
Attachment #462020 -
Flags: superreview?(neil)
Attachment #462020 -
Flags: superreview+
Attachment #462020 -
Flags: review?(neil)
Attachment #462020 -
Flags: review+
Assignee | ||
Comment 3•14 years ago
|
||
(In reply to comment #2)
> Always assuming we called SetBooleanProperty with either PR_TRUE or PR_FALSE, I
> would have hoped that we would only read back PR_TRUE or PR_FALSE ;-)
I'd hope so too, however, just in case I think its worth changing as well. I have, however, switched it to !!res in that function, as indicated by Mnyromyr on irc.
Assignee | ||
Comment 4•14 years ago
|
||
I checked in http://hg.mozilla.org/comm-central/rev/af27e33d07de as an additional fix with r=Neil over irc. This did the actual xpcshell-test fix.
Assignee | ||
Comment 5•13 years ago
|
||
Shouldn't be necessary to keep this open now that we've switched to bool.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 6•13 years ago
|
||
mark, TM=10?
Assignee | ||
Updated•13 years ago
|
Target Milestone: --- → Thunderbird 10.0
You need to log in
before you can comment on or make changes to this bug.
Description
•