Closed Bug 658516 Opened 14 years ago Closed 14 years ago

nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned integer expressions

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla7

People

(Reporter: dholbert, Assigned: ehsan.akhgari)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

Filing bug on this warning: editor/libeditor/html/nsHTMLEditRules.cpp:5810:52: warning: comparison between signed and unsigned integer expressions Flagged code is: > NS_ASSERTION(rangeCount == rangeItemArray.Length(), "How did that happen?"); where rangeCount is a signed int. The contextual code already assumes it's non-negative[1], so it should be fine to just cast it to an unsigned value here. [1] At this point in the code, we've just called rangeItemArray.AppendElements(rangeCount), which would fail horribly if rangeCount were negative. http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/nsHTMLEditRules.cpp#5806
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #534119 - Flags: review?(roc)
Comment on attachment 534119 [details] [diff] [review] Patch (v1) Review of attachment 534119 [details] [diff] [review]: -----------------------------------------------------------------
Attachment #534119 - Flags: review?(roc) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Is this issue fixed? Thanks.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: