Closed Bug 731393 Opened 12 years ago Closed 12 years ago

nsDeviceContext.cpp:764:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

{
nsDeviceContext.cpp: In member function ‘bool nsDeviceContext::SetPixelScale(float)’:
nsDeviceContext.cpp:764:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}

Code in question:
> 761     PRInt32 oldAppUnitsPerDevPixel = mAppUnitsPerDevPixel;
> 762     mPixelScale = aScale;
> 763     UpdateScaledAppUnits();
> 764     return oldAppUnitsPerDevPixel != mAppUnitsPerDevPixel;

mAppUnitsPerDevPixel used to be a signed int, but it was changed a few months back to be unsigned (in bug 678222).

oldAppUnitsPerDevPixel is just a temporary cached copy of mAppUnitsPerDevPixel, and its type should clearly match.
Attached patch fixSplinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #601390 - Flags: review?(joe)
For reference, here's the change that made mAppUnitsPerDevPixel unsigned:
 http://hg.mozilla.org/mozilla-central/diff/8a2432d7f8f3/gfx/src/nsDeviceContext.h
Attachment #601390 - Flags: review?(joe) → review+
Keywords: checkin-needed
Heck, let's give it a try.
Whiteboard: [autoland]
Whiteboard: [autoland] → [autoland-in-queue]
Autoland Patchset:
	Patches: 601390
	Branch: mozilla-central => try
	Destination: http://hg.mozilla.org/try/pushloghtml?changeset=1a8be8b85af3
Try run started, revision 1a8be8b85af3. To cancel or monitor the job, see: https://tbpl.mozilla.org/?tree=Try&rev=1a8be8b85af3
Try run for 1a8be8b85af3 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=1a8be8b85af3
Results (out of 169 total builds):
    exception: 5
    success: 134
    warnings: 30
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/autolanduser@mozilla.com-1a8be8b85af3
Whiteboard: [autoland-in-queue]
https://hg.mozilla.org/mozilla-central/rev/31af9742004c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: