Closed Bug 560378 Opened 16 years ago Closed 16 years ago

Fix MSVC warnings in nsCanvasRenderingContext2D.cpp

Categories

(Core :: Graphics: Canvas2D, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

(Whiteboard: [build_warning])

Attachments

(3 files)

Found these warnings when building with WARNINGS_AS_ERRORS in content/canvas/src/ > nsCanvasRenderingContext2D.cpp(123) : error C2220: warning treated as error - no 'object' file generated > nsCanvasRenderingContext2D.cpp(123) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) > nsCanvasRenderingContext2D.cpp(715) : warning C4156: deletion of an array expression without using the array form of 'delete'; array form substituted > nsCanvasRenderingContext2D.cpp(716) : warning C4156: deletion of an array expression without using the array form of 'delete'; array form substituted > nsCanvasRenderingContext2D.cpp(2067) : warning C4244: 'argument' : conversion from 'const PRUint32' to 'float', possible loss of data > nsCanvasRenderingContext2D.cpp(3330) : warning C4244: 'argument' : conversion from 'float' to 'PRInt32', possible loss of data > nsCanvasRenderingContext2D.cpp(3330) : warning C4244: 'argument' : conversion from 'float' to 'PRInt32', possible loss of data http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTry/1271714234.1271717009.25882.gz The warnings at lines 715-716 are actually kind of scary -- IIRC, mismatched new[]/delete operators can cause memory corruption. (though in this case the compiler is saving us, as the warning indicates) Patches coming up.
Attachment #440065 - Flags: review?(vladimir)
This patch just adds explicit int<-->float casts where the compiler is already warning us about automatic casts that it's doing.
Attachment #440067 - Flags: review?(vladimir)
OS: Linux → Windows XP
Comment on attachment 440067 [details] [diff] [review] Patch C: Fix for float/int conversion warnings all look good, thanks!
Attachment #440067 - Flags: review?(vladimir) → review+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [build_warning]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: