Closed Bug 1079672 Opened 10 years ago Closed 10 years ago

Fix -Wpointer-arith warning in GonkAudioDecoderManager.cpp

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35
Tracking Status
b2g-v2.0 --- unaffected
b2g-v2.1 --- wontfix
b2g-v2.2 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This is the last -Wpointer-arith warning in mozilla-central:

content/media/fmp4/gonk/GonkAudioDecoderManager.cpp:124:29: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]

I cast the MediaBuffer's data() pointer from void* to uint8_t* so the `data+dataOffset` expression is explicitly doing pointer math with bytes. I also moved some local variable declarations to their initialization and fixed some whitespace.

content/media/fmp4/gonk/moz.build includes FAIL_ON_WARNINGS, but this warning was not caught earlier because B2G doesn't build with ac_add_options --enable-warnings-as-errors!
Attachment #8501528 - Flags: review?(cpearce)
Attachment #8501528 - Flags: review?(cpearce) → review+
https://hg.mozilla.org/mozilla-central/rev/9efe56741acf
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.