Closed
Bug 801471
Opened 13 years ago
Closed 13 years ago
Failed to convert nsresult to HRESULT in nsDataObj.cpp on windows build
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: romaxa, Assigned: romaxa)
References
Details
Attachments
(2 files)
1010 bytes,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
444 bytes,
patch
|
tbsaunde
:
review+
|
Details | Diff | Splinter Review |
Build fix
Attachment #671271 -
Flags: review?(jmathies)
Assignee | ||
Comment 1•13 years ago
|
||
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #671282 -
Flags: review?(surkov.alexander)
Assignee | ||
Updated•13 years ago
|
Version: unspecified → Trunk
Comment 2•13 years ago
|
||
Comment on attachment 671282 [details] [diff] [review]
One more nsresult vs HRESULT conversion fail
r=tbsaunde
Attachment #671282 -
Flags: review?(surkov.alexander) → review+
![]() |
||
Updated•13 years ago
|
Attachment #671271 -
Flags: review?(jmathies) → review+
![]() |
||
Updated•13 years ago
|
Blocks: nsresult-enum-class
Comment 4•13 years ago
|
||
For personal reference, do nsresult and HRESULT match up enough for a cast between them to be better than just returning a general failure?
For example I've done this before: return SUCCEEDED(hr) ? NS_OK : NS_ERROR_FAILURE;
Comment 5•13 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #4)
> For personal reference, do nsresult and HRESULT match up enough for a cast
> between them to be better than just returning a general failure?
>
> For example I've done this before: return SUCCEEDED(hr) ? NS_OK :
> NS_ERROR_FAILURE;
My patch did that. See the duped bug.
Comment 6•13 years ago
|
||
Oops ya that's the patch I was looking at.
Comment 7•13 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #4)
> For personal reference, do nsresult and HRESULT match up enough for a cast
> between them to be better than just returning a general failure?
A few specific values agree, like S_OK == NS_OK and E_FAIL == NS_ERROR_FAILURE, but the large majority don't correspond. In particular, all module-specific errors are likely to be totally uncorrelated.
However, the only difference between different error codes is so that different reasons for failure can be distinguished. From that perspective, it might be more useful to propagate back the actual error even though it will be bogus as an nsresult, because it will make debugging easier -- if it hits NS_ENSURE_SUCCESS etc. and is printed to the console, or gets back to JS in an exception message.
Assignee | ||
Comment 8•13 years ago
|
||
Comment 10•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/25f31c96a280
https://hg.mozilla.org/mozilla-central/rev/8c6f15a77695
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in
before you can comment on or make changes to this bug.
Description
•