gecko/content/media
Ehsan Akhgari 5ee21d6d3f Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
..
dash bug 887483 - remove a bunch of useless assignments to FORCE_STATIC_LIB implied by LIBXUL_LIBRARY=1 r=mshal 2013-07-11 11:06:34 -04:00
encoder bug 887483 - remove a bunch of useless assignments to FORCE_STATIC_LIB implied by LIBXUL_LIBRARY=1 r=mshal 2013-07-11 11:06:34 -04:00
gstreamer Bug 889699 - Make gstreamer backend return more accurate results for canPlayType() r=alessandro.d 2013-07-20 12:03:08 +12:00
mediasource Bug 887483 - Remove some more useless FORCE_STATIC_LIB and leftover comments from previous removal. r=mshal 2013-07-15 18:48:40 +09:00
ogg Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
omx Bug 894262 - Merge GonkIOSurfaceImage to GrallocImage, r=nical, kanru 2013-07-25 10:13:35 +08:00
plugins Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
raw bug 887483 - remove a bunch of useless assignments to FORCE_STATIC_LIB implied by LIBXUL_LIBRARY=1 r=mshal 2013-07-11 11:06:34 -04:00
test Backed out changesets f2862e93b710, 4fe81f58dbef, and f8f855f0b7dc (bug 896353) for mochitest-1 asserts. 2013-07-26 14:08:29 -04:00
wave Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
webaudio Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo 2013-07-18 13:59:53 -04:00
webm Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
webrtc Bug 884061 - Part 3d: Use NS_DECL_THREADSAFE_ISUPPORTS in content/, r=smaug 2013-07-18 21:21:19 -05:00
webspeech Bug 893004 part 2. Remove various no-longer-used XPCOM bits from Navigator, except the ones from nsIDOMNavigator. r=smaug 2013-07-17 23:23:52 -04:00
wmf Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
AbstractMediaDecoder.h
AudioAvailableEventManager.cpp
AudioAvailableEventManager.h
AudioChannelFormat.cpp
AudioChannelFormat.h
AudioEventTimeline.h
AudioNodeEngine.cpp Bug 890716. Fix race in Reverb::Reverb. r=padenot 2013-07-26 13:35:22 +12:00
AudioNodeEngine.h Bug 890716. Fix race in Reverb::Reverb. r=padenot 2013-07-26 13:35:22 +12:00
AudioNodeStream.cpp Backed out changeset f211d6754796 (bug 856361) 2013-07-29 09:55:12 +01:00
AudioNodeStream.h Backed out changeset f211d6754796 (bug 856361) 2013-07-29 09:55:12 +01:00
AudioSampleFormat.h Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo 2013-07-18 13:59:53 -04:00
AudioSegment.cpp
AudioSegment.h
AudioStream.cpp Bug 859022 - Remove the MSVC exemption for FAIL_ON_WARNINGS in content/media. r=roc 2013-06-27 20:30:41 +09:00
AudioStream.h
AudioStreamTrack.cpp
AudioStreamTrack.h
BufferMediaResource.h Bug 894148 - Implement MediaResource::ReadAt for threadsafe seek+read - r=cpearce 2013-07-17 13:54:52 +12:00
DecoderTraits.cpp Bug 885371 - Don't create VideoDocument for formats that dont play in content. r=smaug 2013-07-01 09:30:48 -04:00
DecoderTraits.h
DOMMediaStream.cpp Backed out changeset 3d6f6f06da5e (bug 856361) 2013-07-29 09:55:03 +01:00
DOMMediaStream.h Backed out changeset f211d6754796 (bug 856361) 2013-07-29 09:55:12 +01:00
EncodedBufferCache.cpp Bug 803414 - Part 3: Add EncodedBufferCache. r=roc 2013-07-02 11:00:53 +08:00
EncodedBufferCache.h Bug 803414 - Part 3: Add EncodedBufferCache. r=roc 2013-07-02 11:00:53 +08:00
FileBlockCache.cpp
FileBlockCache.h
Makefile.in bug 887483 - remove a bunch of useless assignments to FORCE_STATIC_LIB implied by LIBXUL_LIBRARY=1 r=mshal 2013-07-11 11:06:34 -04:00
MediaCache.cpp Bug 891238. Don't resume reading from a paused connection if we still have plenty of data cached. This could save power. r=cpearce 2013-07-19 21:00:19 +12:00
MediaCache.h Bug 894148 - Implement MediaResource::ReadAt for threadsafe seek+read - r=cpearce 2013-07-17 13:54:52 +12:00
MediaDecoder.cpp Backed out changeset 3f2c0edda4c2 (bug 856361) 2013-07-29 09:55:15 +01:00
MediaDecoder.h Backed out changeset 3f2c0edda4c2 (bug 856361) 2013-07-29 09:55:15 +01:00
MediaDecoderOwner.h Backed out changeset 78424c3ea6cb (bug 883731) 2013-06-19 09:51:05 +01:00
MediaDecoderReader.cpp Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
MediaDecoderReader.h
MediaDecoderStateMachine.cpp Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
MediaDecoderStateMachine.h
MediaMetadataManager.h
MediaRecorder.cpp Backed out changesets f2862e93b710, 4fe81f58dbef, and f8f855f0b7dc (bug 896353) for mochitest-1 asserts. 2013-07-26 14:08:29 -04:00
MediaRecorder.h Backed out changesets f2862e93b710, 4fe81f58dbef, and f8f855f0b7dc (bug 896353) for mochitest-1 asserts. 2013-07-26 14:08:29 -04:00
MediaResource.cpp Bug 894148 - Implement MediaResource::ReadAt for threadsafe seek+read - r=cpearce 2013-07-17 13:54:52 +12:00
MediaResource.h Bug 884061 - Part 1: Use mozilla::Atomic in NS_DECL_INLINE_THREADSAFE_REFCOUNTING, r=jlebar 2013-07-13 20:18:03 -05:00
MediaSegment.h
MediaStreamGraph.cpp Backed out changeset f211d6754796 (bug 856361) 2013-07-29 09:55:12 +01:00
MediaStreamGraph.h Backed out changeset 0ad406a69f2c (bug 856361) for mochitest-1 failures in test_mediaElementAudioSourceNode.html on a CLOSED TREE 2013-07-29 09:56:06 +01:00
MediaStreamGraphImpl.h Bug 882543 - Use a linked list for ordering stream instead of an array. r=ehsan 2013-07-19 16:40:58 +02:00
MediaStreamTrack.cpp
MediaStreamTrack.h
moz.build Backed out changeset 9e90a81b9e37 (bug 856361) 2013-07-29 09:55:06 +01:00
SharedBuffer.h
StreamBuffer.cpp
StreamBuffer.h
TextTrack.cpp
TextTrack.h Bug 882706 - Implement TextTrackList::GetTrackById(). r=rillian 2013-07-09 11:44:35 -04:00
TextTrackCue.cpp Bug 894104 - Part 3: remove TextTrackCue's mGlobal. r=bz 2013-07-18 15:01:48 -07:00
TextTrackCue.h Bug 894104 - Part 3: remove TextTrackCue's mGlobal. r=bz 2013-07-18 15:01:48 -07:00
TextTrackCueList.cpp
TextTrackCueList.h
TextTrackList.cpp Bug 882706 - Implement TextTrackList::GetTrackById(). r=rillian 2013-07-09 11:44:35 -04:00
TextTrackList.h Bug 882706 - Implement TextTrackList::GetTrackById(). r=rillian 2013-07-09 11:44:35 -04:00
TimeVarying.h
TrackUnionStream.h
VideoFrameContainer.cpp
VideoFrameContainer.h
VideoPlaybackQuality.cpp Bug 895754 - Update VideoPlaybackQuality to current MSE spec (remove playbackJitter, add totalFrameDelay). r=doublec 2013-07-24 11:46:43 +12:00
VideoPlaybackQuality.h Bug 895754 - Update VideoPlaybackQuality to current MSE spec (remove playbackJitter, add totalFrameDelay). r=doublec 2013-07-24 11:46:43 +12:00
VideoSegment.cpp
VideoSegment.h
VideoStreamTrack.cpp
VideoStreamTrack.h
VideoUtils.cpp Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
VideoUtils.h Bug 885879 - Make sure cue times are not rounded r=rillian 2013-06-19 14:35:04 -04:00
VorbisUtils.h
WebVTTLoadListener.cpp Bug 887463 - remove webvtt parser library. r=cpearce. 2013-07-09 17:02:00 -07:00
WebVTTLoadListener.h Bug 887463 - remove webvtt parser library. r=cpearce. 2013-07-09 17:02:00 -07:00