Closed
Bug 782608
Opened 12 years ago
Closed 12 years ago
Use NS_FAILED instead of boolean test (image/)
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: ayg, Assigned: ayg)
References
Details
Attachments
(1 file)
1.11 KB,
patch
|
justin.lebar+bug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•12 years ago
|
||
Treating an nsresult as a bool is incorrect, because there are success codes other than NS_OK (although they're rarely used!). Without this patch, the file will fail to compile when nsresult becomes an enum class, because enum classes don't implicitly convert to other types. This patch will only change behavior if something was using some value in the range 0 < x < 0x80000000 as an nsresult, and expecting it to be treated as an error. This is probably not the case here, but I didn't check every usage of this macro in the file -- there are a lot. Generally this only happens with things that grossly abuse nsresult, like some nsISupportsArray methods that return a boolean when they're declared to return an nsresult.
Attachment #651713 -
Flags: review?(justin.lebar+bug)
Comment 2•12 years ago
|
||
> but I didn't check every usage of this macro in the file -- there are a lot.
All the uses look fine to me, although I didn't go and check that the functions involved return what they seem to return.
This will likely burn a test if someone does something wrong, so I'm OK with it.
Updated•12 years ago
|
Attachment #651713 -
Flags: review?(justin.lebar+bug) → review+
Assignee | ||
Comment 3•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0f7d474fb52 Green try: https://tbpl.mozilla.org/?tree=Try&rev=da4047717ef7
Flags: in-testsuite-
Comment 4•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e0f7d474fb52
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in
before you can comment on or make changes to this bug.
Description
•