Closed Bug 903012 Opened 11 years ago Closed 11 years ago

Replace PR_STATIC_ASSERT with static_assert in WaveReader

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: rillian, Assigned: rillian)

References

Details

Attachments

(2 files, 1 obsolete file)

Now that we can use C++11 static_assert, replace PR_STATIC_ASSERT macros in content/media/wave/
Assignee: nobody → giles
Attachment #787651 - Flags: review?(kinetik)
Attachment #787651 - Flags: feedback?(ehsan)
Attached patch Part 2: fix assertion nits (obsolete) — Splinter Review
Attachment #787652 - Flags: review?(kinetik)
Comment on attachment 787651 [details] [diff] [review]
Part 1: replace PR_STATIC_ASSERT with static_assert in WaveReader

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

Nice!
Attachment #787651 - Flags: feedback?(ehsan) → feedback+
Attachment #787651 - Flags: review?(kinetik) → review+
Comment on attachment 787652 [details] [diff] [review]
Part 2: fix assertion nits

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

::: content/media/wave/WaveReader.cpp
@@ +337,4 @@
>      return false;
>    }
>  
> +  static_assert(sizeof(uint32_t) * 2 + 4 <= RIFF_INITIAL_SIZE,

I think it'd be slightly clearer if we make it |sizeof(uint32_t) * 3| and change |p += 4| to |p += sizeof(uint32_t)|.
Attachment #787652 - Flags: review?(kinetik) → review+
Thanks. Updated patch to incorporate review suggestions. Carrying forward r=kinetik.
Attachment #787652 - Attachment is obsolete: true
Attachment #788746 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/ea96533eaff9
https://hg.mozilla.org/mozilla-central/rev/ce87bb4db33f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: