gecko/layout/tables
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
..
crashtests Bug 759249 - Crash tests. 2013-05-14 10:36:51 +02:00
test Bug 855465 - Add emacs python mode comments to moz.build files; r=gps 2013-04-01 11:36:59 -07:00
BasicTableLayoutStrategy.cpp Bug 781360 patch 3: Rename {nsIFrame,nsStyleContext,nsComputedDOMStyle}::GetStyle* to Style*, since they can never return null. r=dholbert 2013-02-16 13:51:02 -08:00
BasicTableLayoutStrategy.h
celldata.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
FixedTableLayoutStrategy.cpp Bug 860242: If box-sizing includes border/padding, then don't add border/padding to cell-width, in fixed table layout's percent-width case. r=dbaron 2013-07-11 16:46:06 -07:00
FixedTableLayoutStrategy.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
moz.build Bug 875934 - Move LIBRARY_NAME to moz.build (batch #1); r=mshal 2013-06-17 15:21:01 -04:00
nsCellMap.cpp 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
nsCellMap.h Bug 786533 - Replace NS_MIN/NS_MAX with std::min/std::max and #include <algorithm> where needed. r=ehsan 2013-01-15 13:22:03 +01:00
nsITableCellLayout.h
nsITableLayoutStrategy.h
nsTableCellFrame.cpp Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableCellFrame.h Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableColFrame.cpp bug 846487 - remove remaining usage of some nsIDOMFooElement r=Ms2Ger 2013-02-14 10:33:16 -05:00
nsTableColFrame.h Bug 870516: Annotate ~600 more methods with MOZ_OVERRIDE in /layout r=dholbert 2013-05-14 09:33:23 -07:00
nsTableColGroupFrame.cpp Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableColGroupFrame.h Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableFrame.cpp Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableFrame.h Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableOuterFrame.cpp Bug 762902: Add a new ReflowChild flag within nsContainerState to disable deletion of next-in-flow children to prevent crash. [r=mats] 2013-03-15 13:36:30 -05:00
nsTableOuterFrame.h Bug 870516: Annotate ~600 more methods with MOZ_OVERRIDE in /layout r=dholbert 2013-05-14 09:33:23 -07:00
nsTablePainter.cpp Bug 781360 patch 3: Rename {nsIFrame,nsStyleContext,nsComputedDOMStyle}::GetStyle* to Style*, since they can never return null. r=dholbert 2013-02-16 13:51:02 -08:00
nsTablePainter.h
nsTableRowFrame.cpp Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableRowFrame.h Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableRowGroupFrame.cpp Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
nsTableRowGroupFrame.h Bug 743402, Part 4: Refactor ApplySkipSides() and GetSkipSides() to return the correct value during reflow by adding an optional nsHTMLReflowState parameter. [r=roc] 2013-07-25 10:34:27 -05:00
SpanningCellSorter.cpp
SpanningCellSorter.h Bug 856108 - Port static analyses to clang, part 2e: use MOZ_STACK_CLASS in layout. r=mats 2013-04-11 22:20:45 -05:00