Closed Bug 739635 Opened 8 years ago Closed 8 years ago

fix -Wunused-but-set-variable warnings in gfx/thebes/

Categories

(Core :: Graphics, defect)

All
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: froydnj, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp: In member function 'gfxShapedWord* gfxFont::GetShapedWord(gfxContext*, const T*, PRUint32, PRUint32, PRInt32, PRInt32, PRUint32) [with T = unsigned char, PRUint32 = unsigned int, PRInt32 = int]':
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:5260:83:   instantiated from here
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:2044:10: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp: In member function 'gfxShapedWord* gfxFont::GetShapedWord(gfxContext*, const T*, PRUint32, PRUint32, PRInt32, PRInt32, PRUint32) [with T = short unsigned int, PRUint32 = unsigned int, PRInt32 = int]':
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:2241:56:   instantiated from 'bool gfxFont::SplitAndInitTextRun(gfxContext*, gfxTextRun*, const T*, PRUint32, PRUint32, PRInt32) [with T = short unsigned int, PRUint32 = unsigned int, PRInt32 = int]'
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:3381:13:   instantiated from 'void gfxFontGroup::InitScriptRun(gfxContext*, gfxTextRun*, const T*, PRUint32, PRUint32, PRInt32) [with T = short unsigned int, PRUint32 = unsigned int, PRInt32 = int]'
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:3328:13:   instantiated from 'void gfxFontGroup::InitTextRun(gfxContext*, gfxTextRun*, const T*, PRUint32) [with T = unsigned char, PRUint32 = unsigned int]'
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:3206:61:   instantiated from here
/home/froydnj/src/m-c.git/gfx/thebes/gfxFont.cpp:2044:10: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
/home/froydnj/src/m-c.git/gfx/thebes/gfxFontUtils.cpp: In static member function 'static nsresult gfxFontUtils::RenameFont(const nsAString_internal&, const PRUint8*, PRUint32, FallibleTArray<unsigned char>*)':
/home/froydnj/src/m-c.git/gfx/thebes/gfxFontUtils.cpp:1426:10: warning: variable 'foundName' set but not used [-Wunused-but-set-variable]
Attached patch patch (obsolete) — Splinter Review
Attachment #609739 - Flags: review?(jmuizelaar)
Comment on attachment 609739 [details] [diff] [review]
patch

Review of attachment 609739 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/thebes/gfxFontUtils.cpp
@@ +1422,5 @@
>      TableDirEntry *dirEntry = 
>          reinterpret_cast<TableDirEntry*>(newFontData + sizeof(SFNTHeader));
>  
>      PRUint32 numTables = sfntHeader->numTables;
> +    DebugOnly<bool> foundName = false;

Rather than making this DebugOnly, I'd suggest removing it altogether and changing the NS_ASSERTION that used it to assert that i < numTables instead.
Attached patch patchSplinter Review
(In reply to Jonathan Kew (:jfkthame) from comment #2)
> >      PRUint32 numTables = sfntHeader->numTables;
> > +    DebugOnly<bool> foundName = false;
> 
> Rather than making this DebugOnly, I'd suggest removing it altogether and
> changing the NS_ASSERTION that used it to assert that i < numTables instead.

Thanks, done.  I also took care of the warnings about foundOS2 and nameLen; nameLen seemed rather easy, but I wasn't sure of the best way to deal with foundOS2, since it only applies for XP_WIN.
Attachment #609739 - Attachment is obsolete: true
Attachment #609739 - Flags: review?(jmuizelaar)
Attachment #610135 - Flags: review?(jmuizelaar)
Comment on attachment 610135 [details] [diff] [review]
patch

Review of attachment 610135 [details] [diff] [review]:
-----------------------------------------------------------------

Sure.
Attachment #610135 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/378f53635589
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.