The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla14

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: froydnj, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
mozilla14
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
/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]
(Reporter)

Comment 1

5 years ago
Created attachment 609739 [details] [diff] [review]
patch
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.
(Reporter)

Comment 3

5 years ago
Created attachment 610135 [details] [diff] [review]
patch

(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+
(Reporter)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/378f53635589
https://hg.mozilla.org/mozilla-central/rev/378f53635589
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.