Closed
Bug 908514
Opened 11 years ago
Closed 11 years ago
Fix warnings in nsICODecoder.cpp
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: seth, Assigned: seth)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 3 obsolete files)
22.49 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
1.06 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
nsICODecoder.cpp always generates warnings when compiling imagelib, which causes unnecessary debugging friction. There are two issues:
- Self-assignment warnings, caused by macros in EndianMacros.h.
- Cast-alignment warnings, which can be avoided through the use of a temporary variable.
Assignee | ||
Comment 1•11 years ago
|
||
Proposed patch. Try job here:
https://tbpl.mozilla.org/?tree=Try&rev=26cf8f00e965
Assignee | ||
Updated•11 years ago
|
Attachment #794781 -
Attachment is obsolete: true
Assignee | ||
Comment 2•11 years ago
|
||
Actually, I changed my mind about the approach to fixing the self-assignment warnings. Let's just get rid of those macros altogether and replace them with template functions.
Assignee | ||
Comment 3•11 years ago
|
||
Proposed patch. This renames EndianMacros.h to Endian.h and replaces all of the macros with template functions. The bodies of the template functions are taken directly from the original macros.
Attachment #794813 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 4•11 years ago
|
||
This is a tiny patch to fix a cast alignment warning in nsICODecoder.cpp.
Attachment #794815 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 5•11 years ago
|
||
Try job here:
https://tbpl.mozilla.org/?tree=Try&rev=d96a0c0b3299
Assignee | ||
Comment 6•11 years ago
|
||
Looks like there is some bustage. Will look into this tomorrow.
Comment 7•11 years ago
|
||
Why don't you use mfbt/Endian.h?
Comment 8•11 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #7)
> Why don't you use mfbt/Endian.h?
I was going suggest the same.
Assignee | ||
Comment 9•11 years ago
|
||
Didn't know it existed. That's great. I'll switch it over.
Assignee | ||
Comment 10•11 years ago
|
||
Redid the patch to use MFBT's Endian.h and fixed known orange tests.
Attachment #796363 -
Flags: review?(jmuizelaar)
Assignee | ||
Updated•11 years ago
|
Attachment #794813 -
Attachment is obsolete: true
Attachment #794813 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 11•11 years ago
|
||
The new version of part 1 naturally takes care of the warning handled by the old part 2, but while verifying this I discovered that there's another warning produced by gcc in image/decoders. This new part 2 takes care of that warning by explicitly initializing a variable.
Attachment #796365 -
Flags: review?(jmuizelaar)
Assignee | ||
Updated•11 years ago
|
Attachment #794815 -
Attachment is obsolete: true
Attachment #794815 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 12•11 years ago
|
||
New try job here: https://tbpl.mozilla.org/?tree=Try&rev=c911f1c44216
Updated•11 years ago
|
Attachment #796363 -
Flags: review?(jmuizelaar) → review+
Updated•11 years ago
|
Attachment #796365 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 13•11 years ago
|
||
Updated•11 years ago
|
Blocks: buildwarning
Comment 14•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1f846fad9b0f
https://hg.mozilla.org/mozilla-central/rev/20287656b048
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•