Closed Bug 847709 Opened 7 years ago Closed 6 years ago

widget/cocoa/GfxInfo.h:82:12: warning: private field 'mRendererIDs' is not used [-Wunused-private-field]

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: dholbert, Assigned: cpeterson)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file)

Noticed this clang build warning go by, on an OS X build:

{
 0:16.94 In file included from /Users/dholbert/builds/mozilla-central/mozilla/widget/cocoa/GfxInfo.mm:11:

 0:16.94 Warning: -Wunused-private-field in /Users/dholbert/builds/mozilla-central/mozilla/widget/cocoa/GfxInfo.h: private field 'mRendererIDs' is not used

 0:16.94 /Users/dholbert/builds/mozilla-central/mozilla/widget/cocoa/GfxInfo.h:82:12: warning: private field 'mRendererIDs' is not used [-Wunused-private-field]
}

This field is actually used, but it's used in #if 0 blocks -- namely here:
 https://mxr.mozilla.org/mozilla-central/source/widget/cocoa/GfxInfo.mm#132
and here:
 https://mxr.mozilla.org/mozilla-central/source/widget/cocoa/GfxInfo.mm#369

These "#if 0" wrappers were added in Bug 687868, in this cset:
  https://hg.mozilla.org/mozilla-central/rev/9ba53832faf2
Duplicate of this bug: 883721
Jeff: in bug 687868, you #if 0'd some CGLQueryRendererInfo blacklist code, but not the related member variable mRendererIDs.

Do you intend to enable this CGLQueryRendererInfo code again sometime or can it be removed? Or is the code just #if 0'd to keep around for debugging?
Flags: needinfo?(jmuizelaar)
Yeah, that stuff can probably all go.
Flags: needinfo?(jmuizelaar)
1. Remove unused GfxInfo member variable mRendererIDs.
2. Remove #if 0'd GfxInfo code that used to use mRendererIDs.
3. Remove GfxInfo member variable mRendererIDsString which is only initialized by the #if 0'd code.
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Attachment #784813 - Flags: review?(jmuizelaar)
Comment on attachment 784813 [details] [diff] [review]
R?_847709-remove-unused-mRendererIDs.patch

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

::: widget/cocoa/GfxInfo.mm
@@ -106,5 @@
>    nsresult rv = GfxInfoBase::Init();
>  
> -  // Calling CGLQueryRendererInfo causes us to switch to the discrete GPU
> -  // even when we don't want to. We'll avoid doing so for now and just
> -  // use the device ids.

This comment should stay.
Attachment #784813 - Flags: review?(jmuizelaar) → review+
Landed on mozilla-inbound with the CGLQueryRendererInfo comment restored:

https://hg.mozilla.org/integration/mozilla-inbound/rev/07e9242d563a
https://hg.mozilla.org/mozilla-central/rev/07e9242d563a
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.