Closed Bug 1720432 Opened 3 years ago Closed 3 years ago

Fix -Wunused-but-set-variable warnings in dom/media

Categories

(Core :: Audio/Video, defect, P3)

defect

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox90 --- wontfix
firefox91 --- wontfix
firefox92 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

clang and gcc report the following -Wunsed-but-set-variable warnings in dom/media:

dom/media/gmp/GMPSharedMemManager.cpp:54:10: warning: variable 'total' set but not used [-Wunused-but-set-variable]
dom/media/gtest/TestMP3Demuxer.cpp:423:13: warning: variable 'numSamples' set but not used [-Wunused-but-set-variable]

GMPSharedMemManager.cpp updates local variable total, but never reads it so we can remove it.

TestMP3Demuxer.cpp updates local variable numSamples, but the EXPECT test checks that use numSamples are commented out. I don't know how to address the commented-out checks' issues, but testing that numSamples is non-negative seems a safe assumption (and a way to fix the -Wunused-but-set-variable warning).

dom/media/gmp/GMPSharedMemManager.cpp:54:10: warning: variable 'total' set but not used [-Wunused-but-set-variable]
dom/media/gtest/TestMP3Demuxer.cpp:423:13: warning: variable 'numSamples' set but not used [-Wunused-but-set-variable]

GMPSharedMemManager.cpp updates local variable total, but never reads it so we can remove it.

TestMP3Demuxer.cpp updates local variable numSamples, but the EXPECT test checks that use numSamples are commented out. I don't know how to address the commented-out checks' issues, but testing that numSamples is non-negative seems a safe assumption (and a way to fix the -Wunused-but-set-variable warning).

Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cdd6ccd2d242
Fix -Wunsed-but-set-variable warnings in dom/media. r=kinetik
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: