Closed Bug 604158 Opened 14 years ago Closed 14 years ago

nsGeolocation.cpp:762: warning: comparison between signed and unsigned integer expressions

Categories

(Core :: DOM: Geolocation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

(Whiteboard: [build_warning])

Attachments

(1 file, 1 obsolete file)

../../../../mozilla/dom/src/geolocation/nsGeolocation.cpp: In member function ‘nsresult nsGeolocationService::StartDevice()’:
../../../../mozilla/dom/src/geolocation/nsGeolocation.cpp:762: warning: comparison between signed and unsigned integer expressions
../../../../mozilla/dom/src/geolocation/nsGeolocation.cpp: In member function ‘void nsGeolocationService::StopDevice()’:
../../../../mozilla/dom/src/geolocation/nsGeolocation.cpp:806: warning: comparison between signed and unsigned integer expressions

In both cases, the problem is that we're using an unsigned value to iterate through a nsCOMArray (whose Length() method returns a *signed* value).  So each comparison vs Length() is unsigned vs signed.
Blocks: 599591
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [build_warning]
Attached patch fix (obsolete) — Splinter Review
Fix: just use a PRInt32 instead of PRUint32.  (also fixes some whitespace on blank line in contextual code)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #482948 - Flags: review?(doug.turner)
Attachment #482948 - Flags: approval2.0?
Attached patch fixSplinter Review
Made one more whitespace tweak -- replacing
> i <mProviders.Count()
with
> i < mProviders.Count();
on the latter of the two fixed lines.
Attachment #482952 - Flags: review?(doug.turner)
Attachment #482952 - Flags: approval2.0?
Attachment #482948 - Attachment is obsolete: true
Attachment #482948 - Flags: review?(doug.turner)
Attachment #482948 - Flags: approval2.0?
Comment on attachment 482952 [details] [diff] [review]
fix

low risk, fixes warnings
Attachment #482952 - Flags: review?(doug.turner)
Attachment #482952 - Flags: review+
Attachment #482952 - Flags: approval2.0?
Attachment #482952 - Flags: approval2.0+
http://hg.mozilla.org/mozilla-central/rev/26c6dfa66726
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.