gecko/gfx/layers
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
..
basic Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
client Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
composite Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
d3d9 Bug 784739 - Switch from NULL to nullptr in gfx/layers/d3d9/; r=ehsan 2013-07-20 11:48:55 +03:00
d3d10 Bug 877700: Limit the Source region to the area of the parent layer surface. r=roc 2013-07-29 10:35:48 +00:00
d3d11 Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
ipc 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
opengl Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
Compositor.cpp Bug 885580 - Make sure that Compositor::GetBackend is only used [Cfrom the compositor thread. r=nical 2013-06-27 11:30:52 +12:00
Compositor.h Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
CompositorTypes.h Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
CopyableCanvasLayer.cpp Bug 888048 - Use CreateThebesSurfaceAliasForDrawTarget_hack to avoid having multiple cairo_surface_quartz objects for a single CGContext. r=nrc 2013-07-17 23:24:15 -04:00
CopyableCanvasLayer.h Bug 848482 - Make SourceSurface work with SkiaGL r=mattwoodrow 2013-06-06 10:58:45 -04:00
D3D9SurfaceImage.cpp Bug 784739 - Switch from NULL to nullptr in gfx/layers/; r=ehsan 2013-07-20 11:48:55 +03:00
D3D9SurfaceImage.h Bug 784739 - Switch from NULL to nullptr in gfx/layers/; r=ehsan 2013-07-20 11:48:55 +03:00
DirectedGraph.h
Effects.cpp
Effects.h Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
FrameMetrics.h Bug 866265 - Fix up some comments in FrameMetrics.h. r=kentuckyfriedtakahe 2013-07-03 09:04:10 -04:00
GrallocImages.cpp Bug 894262 - Merge GonkIOSurfaceImage to GrallocImage, r=nical, kanru 2013-07-25 10:13:35 +08:00
GrallocImages.h Bug 894262 - Merge GonkIOSurfaceImage to GrallocImage, r=nical, kanru 2013-07-25 10:13:35 +08:00
ImageContainer.cpp Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
ImageContainer.h Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
ImageDataSerializer.cpp Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
ImageDataSerializer.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
ImageLayers.cpp
ImageLayers.h Bug 877382 - Remove THEBES_API decorator. - r=BenWa 2013-05-29 14:59:24 -07:00
ImageTypes.h Bug 894262 - Merge GonkIOSurfaceImage to GrallocImage, r=nical, kanru 2013-07-25 10:13:35 +08:00
Layers.cpp Bug 775459 - Implement hit testing on layer tree + tests. r=kats 2013-07-02 12:27:17 -04:00
Layers.h Bug 784739 - Switch from NULL to nullptr in gfx/layers/; r=ehsan 2013-07-20 11:48:55 +03:00
LayersLogging.cpp Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
LayersLogging.h Bug 879004 - Move template methods to header file. r=BenWa 2013-06-10 09:05:43 -04:00
LayerSorter.cpp
LayerSorter.h
LayersTypes.h Bug 874721. Unify mask type enums; r=bas 2013-07-05 09:48:33 +12:00
LayerTreeInvalidation.cpp
LayerTreeInvalidation.h
Makefile.in Bug 892861 - Remove useless -D flags 'IMPL_THEBES,_IMPL_NS_GFX,...'. r=glandium 2013-07-12 08:56:54 -04:00
moz.build Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
ReadbackLayer.h Bug 877382 - Remove THEBES_API decorator. - r=BenWa 2013-05-29 14:59:24 -07:00
ReadbackProcessor.cpp
ReadbackProcessor.h
RenderTrace.cpp Bug 784739 - Switch from NULL to nullptr in gfx/layers/; r=ehsan 2013-07-20 11:48:55 +03:00
RenderTrace.h
SharedTextureImage.h Bug 784739 - Switch from NULL to nullptr in gfx/layers/; r=ehsan 2013-07-20 11:48:55 +03:00
ThebesLayerBuffer.cpp Bug 895369. Add some asserts to ThebesLayerBuffer. r=mattwoodrow 2013-07-24 18:46:27 +12:00
ThebesLayerBuffer.h Bug 895369. Add some asserts to ThebesLayerBuffer. r=mattwoodrow 2013-07-24 18:46:27 +12:00
TiledLayerBuffer.h Bug 881018 - Crash when TiledLayerBuffer::GetScaledTileLength returns 0; r=cwiiis 2013-07-24 11:17:49 -04:00
YCbCrImageDataSerializer.cpp Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00
YCbCrImageDataSerializer.h Bug 858914 - New texture classes + OGL backend (preffed off). r=bas, nrc 2013-07-30 11:59:51 +02:00