Clean up nsresult values
Categories
(Core :: XPCOM, task)
Tracking
()
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(14 obsolete files)
The existence of any success codes other than NS_OK annoys me. Some can easily be removed.
We also have some duplicate constants, some of which appear intentional, and some which do not.
| Assignee | ||
Comment 1•5 years ago
|
||
It has a single use that can be replaced with NS_OK without any other changes.
| Assignee | ||
Comment 2•5 years ago
|
||
It's unused.
Depends on D91548
| Assignee | ||
Comment 3•5 years ago
|
||
Its uses can be replaced with NS_OK without any other changes.
Depends on D91549
| Assignee | ||
Comment 4•5 years ago
|
||
Both constants have the same value! They can be replaced by NS_OK without
effect.
Depends on D91550
| Assignee | ||
Comment 5•5 years ago
|
||
It has four constants, three of which are unused.
The one used constant is NS_RDF_NO_VALUE, which sounds like a failure code but
is actually a success code. It's only used in one place, on a failure path. But
the function that uses it has a single call site, and the return value is not
checked, which means that the NS_RDF_NO_VALUE use is never checked.
I have replaced this one use of NS_RDF_NO_VALUE with NS_ERROR_FAILURE rather
than NS_OK, because that makes more sense for a failure path.
Depends on D91551
| Assignee | ||
Comment 6•5 years ago
|
||
It's a low-value synonym of NS_OK that isn't used in mozilla-central.
Depends on D91552
| Assignee | ||
Comment 7•5 years ago
|
||
It's a low-value synonym of NS_OK that isn't used.
Depends on D91553
| Assignee | ||
Comment 8•5 years ago
|
||
It's a low-value synonym of NS_ERROR_INVALID_ARG.
Depends on D91554
| Assignee | ||
Comment 9•5 years ago
|
||
It's a deprecated and potentially confusing synonym of
NS_ERROR_UDEC_ILLEGALINPUT.
Depends on D91555
| Assignee | ||
Comment 10•5 years ago
|
||
I have included an allow-list because there are some existing dups. Some look
reasonable, some don't.
Depends on D91556
| Assignee | ||
Comment 11•5 years ago
|
||
It's never checked for, so NS_OK is good enough.
The commit also fixes the typo in GetNextPrevLineFromeBlockFrame().
Depends on D91705
| Assignee | ||
Comment 12•5 years ago
|
||
As NS_OK_UENC_NPMAPPING, because it's a success code!
Depends on D91706
| Assignee | ||
Comment 13•5 years ago
|
||
It's a low-value synonym for NS_OK.
Depends on D91707
Updated•5 years ago
|
| Assignee | ||
Comment 14•5 years ago
|
||
It's unused.
Depends on D91708
Updated•5 years ago
|
| Assignee | ||
Comment 15•5 years ago
|
||
These changes ended up being more subtle than expected, with a higher chance of introducing regressions that I originally thought. (E.g. because some success codes have no explicit uses, but do have implicit uses.) Combine that with the fact that I was only able to remove some of the non-NS_OK success codes, rather than all of them as I originally hoped... I think the cautious thing is to give up on these.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Description
•