Closed
Bug 560378
Opened 16 years ago
Closed 16 years ago
Fix MSVC warnings in nsCanvasRenderingContext2D.cpp
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
References
()
Details
(Whiteboard: [build_warning])
Attachments
(3 files)
|
736 bytes,
patch
|
vlad
:
review+
|
Details | Diff | Splinter Review |
|
885 bytes,
patch
|
vlad
:
review+
|
Details | Diff | Splinter Review |
|
2.23 KB,
patch
|
vlad
:
review+
|
Details | Diff | Splinter Review |
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.
| Assignee | ||
Comment 1•16 years ago
|
||
Attachment #440065 -
Flags: review?(vladimir)
| Assignee | ||
Comment 2•16 years ago
|
||
Attachment #440066 -
Flags: review?(vladimir)
| Assignee | ||
Comment 3•16 years ago
|
||
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)
| Assignee | ||
Updated•16 years ago
|
OS: Linux → Windows XP
Attachment #440065 -
Flags: review?(vladimir) → review+
Attachment #440066 -
Flags: review?(vladimir) → review+
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+
| Assignee | ||
Comment 5•16 years ago
|
||
| Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [build_warning]
You need to log in
before you can comment on or make changes to this bug.
Description
•