Closed
Bug 745272
Opened 13 years ago
Closed 13 years ago
nsAudioAvailableEventManager.cpp:195:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.93 KB,
patch
|
humph
:
review+
cpearce
:
review+
|
Details | Diff | Splinter Review |
Filing bug on this build warning...
{
../../../mozilla/content/media/nsAudioAvailableEventManager.cpp: In member function ‘void nsAudioAvailableEventManager::QueueWrittenAudioData(AudioDataValue*, PRUint32, PRUint64)’:
../../../mozilla/content/media/nsAudioAvailableEventManager.cpp:195:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
}
...for this chunk of code...
> 149 PRUint32 audioDataLength = aAudioDataLength;
[...]
> 153 while (signalBufferTail <= audioDataLength) {
[...]
> 167 audioData += signalBufferTail;
> 168 audioDataLength -= signalBufferTail;
[...]
> 195 NS_ASSERTION(audioDataLength >= 0, "Past new signal data length.");
[...]
> 209 }
...which was added in bug 490705.
Note that audioDataLength is unsigned, so it's >= 0 by definition.
If we actually want to assert that it's not going to wrap around, we should assert _just before_ line 168 that we're not about to subtract a value larger than audioDataLength.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #614866 -
Flags: review?(david.humphrey)
Assignee | ||
Updated•13 years ago
|
Blocks: buildwarning
Assignee | ||
Comment 2•13 years ago
|
||
(this is a build warning from g++ 4.6.3, FWIW)
Comment 3•13 years ago
|
||
Comment on attachment 614866 [details] [diff] [review]
fix
Review of attachment 614866 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good, thanks for catching it. Since I'm not an owner/peer, I'm going to ask cpearce to look at this.
Attachment #614866 -
Flags: review?(david.humphrey)
Attachment #614866 -
Flags: review?(cpearce)
Attachment #614866 -
Flags: review+
Comment 4•13 years ago
|
||
Comment on attachment 614866 [details] [diff] [review]
fix
Review of attachment 614866 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
Attachment #614866 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 5•13 years ago
|
||
Target Milestone: --- → mozilla14
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•