Closed
Bug 504929
Opened 15 years ago
Closed 15 years ago
Fix "warning: comparison between signed and unsigned integer expressions" in nsDOMWindowUtils.cpp
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
When compiling nsDOMWindowUtils.cpp (in mozilla-central), I get these warnings:
/mozilla/dom/base/nsDOMWindowUtils.cpp: In member function ‘virtual nsresult nsDOMWindowUtils::CompareCanvases(nsIDOMHTMLCanvasElement*, nsIDOMHTMLCanvasElement*, PRUint32*, PRUint32*)’:
/mozilla/dom/base/nsDOMWindowUtils.cpp:662: warning: comparison between signed and unsigned integer expressions
/mozilla/dom/base/nsDOMWindowUtils.cpp:663: warning: comparison between signed and unsigned integer expressions
/mozilla/dom/base/nsDOMWindowUtils.cpp:664: warning: comparison between signed and unsigned integer expressions
/mozilla/dom/base/nsDOMWindowUtils.cpp:665: warning: comparison between signed and unsigned integer expressions
The warnings happen because "abs()" returns a *signed* integer, and we implicitly compare its result to an *unsigned* integer using PR_MAX.
Trivial fix: Just cast the result of abs() to be unsigned. It's guaranteed to be non-negative anyway, since it's an absolute value. :)
Attachment #389197 -
Flags: review?(vladimir)
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•15 years ago
|
||
This was fixed a while back, as part of bug 530300. Resolving as WORKSFORME & adding dependency.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Depends on: 530300
Resolution: --- → WORKSFORME
Whiteboard: [build_warning]
Assignee | ||
Updated•15 years ago
|
Attachment #389197 -
Flags: review?(vladimir)
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•