gecko/xpcom/build
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
..
BinaryPath.h
FileLocation.cpp Bug 883729 - Fix -Wnull-conversion warnings in xpcom. r=bsmedberg 2013-06-13 20:57:47 -07:00
FileLocation.h
FrozenFunctions.cpp bug 789919, (snow-white) make addref/release of CCable objects faster by removing indirect refcnt increase/decrease, r=mccr8, test changes r=ehsan 2013-07-09 13:30:58 -04:00
mach_override.c
mach_override.h
Makefile.in Bug 889787 - Define XP_LINUX globally; r=ted 2013-07-16 17:10:10 -04:00
moz.build bug 883350: move SDK_HEADERS to mozbuild (file batch #1) r=mshal 2013-07-01 17:24:53 -04:00
mozPoisonWrite.h
mozPoisonWriteBase.cpp
mozPoisonWriteBase.h
mozPoisonWriteMac.cpp
mozPoisonWriteStub.cpp
mozPoisonWriteWin.cpp
nsXPCOM.h bug 789919, (snow-white) make addref/release of CCable objects faster by removing indirect refcnt increase/decrease, r=mccr8, test changes r=ehsan 2013-07-09 13:30:58 -04:00
nsXPCOMCID.h
nsXPCOMCIDInternal.h
nsXPComInit.cpp Bug 896124 - Implement a JS_Init() JSAPI function, to be called before any other JSAPI operations (except JS_SetICUMemoryFunctions) are performed, to centralize whole-engine initialization tasks. r=bsmedberg for the XPCOM bits, r=luke for the JS bits 2013-07-19 20:14:34 -07:00
nsXPCOMPrivate.h bug 789919, (snow-white) make addref/release of CCable objects faster by removing indirect refcnt increase/decrease, r=mccr8, test changes r=ehsan 2013-07-09 13:30:58 -04:00
nsXPCOMStrings.cpp
nsXREAppData.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
nsXULAppAPI.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
Omnijar.cpp
Omnijar.h
perfprobe.cpp
perfprobe.h
ServiceList.h
Services.cpp Bug 859817 - Remove implicit conversions from raw pointer to already_AddRefed; r=Ms2ger 2013-04-22 14:15:59 +03:00
Services.h
xpcom_alpha.def
XPCOM.h Bug 856238 - Remove unused includes of the obsolete nsISupportsArray and nsIEnumerator. r=Neil, r=bsmedberg 2013-04-08 14:35:31 -04:00
XPCOMModule.inc Backed out changesets 073791f33ab7 and 7ac5779a426c (bug 859756) for causing intermittent Windows build failures. 2013-05-17 17:30:20 -04:00
xrecore.h Bug 892861 - Remove useless -D flags 'IMPL_THEBES,_IMPL_NS_GFX,...'. r=glandium 2013-07-12 08:56:54 -04:00