Closed
Bug 11598
Opened 26 years ago
Closed 25 years ago
eliminate NS_COMFALSE
Categories
(Core :: Layout, defect, P3)
Tracking
()
VERIFIED
FIXED
M10
People
(Reporter: warrensomebody, Assigned: chuang)
References
Details
We should eliminate the NS_COMFALSE madness once and for all. Here's a list of
offending uses in your module -- please pass the bug along if there's someone
else who should deal with it.
mailnews/addrbook/src/nsAddrDatabase.cpp:
View change log or Blame annotations
line 255
line 2193
mailnews/base/search/src/nsMsgLocalSearch.cpp:
View change log or Blame annotations
line 486
line 520
line 593
line 600
mailnews/base/search/src/nsMsgSearchTerm.cpp:
View change log or Blame annotations
line 579
line 589
line 648
line 680
line 741
line 853
line 898
line 948
line 988
line 1008
line 1034
mailnews/base/src/nsMsgFolderCache.cpp:
View change log or Blame annotations
line 316
mailnews/db/msgdb/src/nsMsgDatabase.cpp:
View change log or Blame annotations
line 105
line 1529
line 1654
line 1835
line 1895
mailnews/db/msgdb/src/nsMsgThread.cpp:
View change log or Blame annotations
line 717
Updated•26 years ago
|
Assignee: putterman → bienvenu
Comment 1•26 years ago
|
||
reassigning to bienvenu who owns most of these file and cc'ing chuang who owns
one of these files.
Updated•26 years ago
|
Target Milestone: M10
Comment 2•26 years ago
|
||
woa, I need a little background. What should I replace it with? Did RDF stop
caring about NS_COMFALSE? I don't want to blindly replace it with NS_OK or
NS_FAILURE and break everything.
Reporter | ||
Comment 3•26 years ago
|
||
We should replace it with NS_OK/NS_ERROR_FAILURE. You'll need to coordinate
with Waterson to change it.
This is one of Brendan's architecture cleanup items.
Comment 4•26 years ago
|
||
Chris, any thoughts about this?
Comment 5•26 years ago
|
||
Without looking at specifics...
At least some of our uses of NS_COMFALSE are functions that really just want to
return PRBool. The 'right' way to fix them is to do:
(in xpidl)
PRBool Foo();
which becomes in C++
NS_IMETHOD Foo(PRBool *_result);
So in calling it you do:
PRBool ok;
if(SUCCEEDED(bar->Foo(&ok)) && ok)
// yada yada
This is, of course, more work than using NS_COMFALSE.
But with NS_COMFALSE we have the "NS_OK == PR_FALSE and NS_COMFALSE == PR_TRUE"
problem. And also the problem that both of those return values pass the
NS_SUCCEEDED(rv) test that we all love so much.
Comment 6•26 years ago
|
||
That's fine for my internal routines which I can fix right now, but when dealing
with rdf enumerators, I don't have that kind of flexibility
Comment 7•26 years ago
|
||
jband, if you want to avoid warren's fate (losing in fisticuffs to waterson),
you might rather write the exemplar this way:
if (NS_FAILED(rv))
deal with failure, probably by early return;
if (ok)
boolean result was true;
else
boolean result was false;
Conjoining NS_SUCCEEDED(rv) && ok may hide errors along with false-no-op cases.
bienvenu, when I asked waterson about how his hoped-for conversion from
nsIEnumerator to nsISimpleEnumerator might proceed, he came back with this
thought: add boolean HasMoreElements(); and nsISupports GetNext(); methods to
nsIEnumerator and its impl, incrementally convert from the First/Next/IsDone
methods to these, then rename or equate typenames so nsIEnumerator becomes
nsISimpleEnumerator. Does this sound like a plan?
I'm cc'ing rjc in addition to waterson for RDF help. I'll seek comments in
other fora from editor, widget, and other folks who currently use nsIEnumerator
and not nsISimpleEnumerator.
/be
Updated•26 years ago
|
Status: NEW → ASSIGNED
Comment 8•26 years ago
|
||
Sounds like a good plan. I'm not real familiar with the db code that uses
NS_COMFALSE, since Warren wrote it :-) but I'll work with Chris to clean it up.
Updated•26 years ago
|
Comment 9•26 years ago
|
||
fixed in almost every file in mailnews.
Updated•26 years ago
|
Status: RESOLVED → REOPENED
Updated•26 years ago
|
Assignee: bienvenu → chuang
Status: REOPENED → NEW
Comment 10•26 years ago
|
||
I noticed there are still uses of NS_COMFALSE in the address book backend, so
I'm reopening and reassigning
Comment 11•26 years ago
|
||
Clearing Fixed resolution due to reopen.
Assignee | ||
Comment 12•25 years ago
|
||
Done on address book, will check in if tree open.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•25 years ago
|
||
Done
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Comment 14•25 years ago
|
||
Based on chuang's comment's, I mark this fixed in the Sept 2nd build.
You need to log in
before you can comment on or make changes to this bug.
Description
•