Closed
Bug 742565
Opened 9 years ago
Closed 9 years ago
nsRange.cpp:668:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.26 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Filing bug on these new build warnings: > content/base/src/nsRange.cpp: In member function ‘virtual nsresult nsRange::ComparePoint(nsIDOMNode*, PRInt32, PRInt16*)’: > content/base/src/nsRange.cpp:668:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] > content/base/src/nsRange.cpp: In member function ‘nsresult nsRange::SetStart(nsINode*, PRInt32)’: > content/base/src/nsRange.cpp:932:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] > content/base/src/nsRange.cpp: In member function ‘nsresult nsRange::SetEnd(nsINode*, PRInt32)’: > content/base/src/nsRange.cpp:996:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] In each case, it's something like: > if (aOffset < 0 || aOffset > aParent->Length()) { ...where aOffset is signed and Length() returns an unsigned value. This comparison would only be problematic if aOffset were negative; however, we're already ensuring it's nonnegative before we perform the comparison. So we can just cast it to be a signed val for the purpose of the comparison.
Assignee | ||
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #0) > So we can just cast it to be a signed val for the purpose of the comparison. (er I meant "cast it to be an _un_signed val" (which the attached patch does))
Updated•9 years ago
|
Attachment #612373 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 3•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9082d2112975
Target Milestone: --- → mozilla14
Comment 4•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9082d2112975
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•2 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•