gecko/dom/ipc
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
..
tests Bug 855465 - Add emacs python mode comments to moz.build files; r=gps 2013-04-01 11:36:59 -07:00
AppProcessChecker.cpp Bug 879475 - Make PBrowser manually keep track of its manager r=jlebar 2013-07-10 13:07:51 -04:00
AppProcessChecker.h Bug 882911 - Add nsIProcessChecker.checkAppHasStatus. r=smaug 2013-06-29 03:52:16 -07:00
Blob.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
Blob.h Bug 879475 - Make PBlob manually keep track of its manager r=jlebar 2013-07-16 13:07:09 -07:00
ContentChild.cpp Bug 879475 - Make PBlob manually keep track of its manager r=jlebar 2013-07-16 13:07:09 -07:00
ContentChild.h Backout 129da44ac469 (bug 870180) for breaking message manager 2013-07-10 18:22:34 -07:00
ContentParent.cpp Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
ContentParent.h Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
ContentProcess.cpp
ContentProcess.h
CrashReporterChild.cpp
CrashReporterChild.h
CrashReporterParent.cpp Bug 855822 - Remove Add/RemoveLibraryMappingForChild. r=ted 2013-03-30 10:32:10 +01:00
CrashReporterParent.h Bug 855822 - Remove Add/RemoveLibraryMappingForChild. r=ted 2013-03-30 10:32:10 +01:00
DOMTypes.ipdlh Bug 879475 - Move some blob constructor params to ipdlh headers r=jlebar 2013-07-10 13:07:51 -04:00
jar.mn
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 879475 - Move TabContext to its own ipdl header r=jlebar 2013-07-10 13:07:50 -04:00
nsICachedFileDescriptorListener.h
nsIRemoteBlob.h
PBlob.ipdl
PBlobStream.ipdl
PBrowser.ipdl Bug 890938 - Convert AsyncPanZoomController::ZoomToRect to take a CSSRect instead of a gfxRect. r=kats 2013-07-11 10:43:35 -04:00
PCOMContentPermissionRequestChild.h
PContent.ipdl Backout 129da44ac469 (bug 870180) for breaking message manager 2013-07-10 18:22:34 -07:00
PContentDialog.ipdl
PContentPermissionRequest.ipdl
PCrashReporter.ipdl Bug 855822 - Remove Add/RemoveLibraryMappingForChild. r=ted 2013-03-30 10:32:10 +01:00
PDocumentRenderer.ipdl
PermissionMessageUtils.cpp
PermissionMessageUtils.h
PMemoryReportRequest.ipdl
PreallocatedProcessManager.cpp Bug 844323 - Part 1: Move process preallocation logic out of ContentParent and into a new file, PreallocatedProcessManager. r=bent 2013-04-25 20:53:26 -04:00
PreallocatedProcessManager.h Bug 844323 - Part 1: Move process preallocation logic out of ContentParent and into a new file, PreallocatedProcessManager. r=bent 2013-04-25 20:53:26 -04:00
preload.js Bug 889503 - Move Settings API to WebIDL. r=gwagner r=bz 2013-07-15 18:17:46 -07:00
ProcessPriorityManager.cpp Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
ProcessPriorityManager.h Bug 844323 - Part 2 (The Main Event): Move ProcesPriorityManager to the main process. r=bent,khuey 2013-04-25 20:53:26 -04:00
PTabContext.ipdlh Bug 879475 - Move TabContext to its own ipdl header r=jlebar 2013-07-10 13:07:50 -04:00
remote-test.js
StructuredCloneUtils.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
StructuredCloneUtils.h
TabChild.cpp Bug 894288 - Prevent triggering an endless abort cycle when loading any tabs in the browser. r=BenWa 2013-07-25 14:54:26 -04:00
TabChild.h Bug 870311 - Fix coordinates on contextmenu event, r=kats 2013-07-16 15:54:59 -04:00
TabContext.cpp Bug 853632 - Cache own and containing apps in TabContext. r=jlebar 2013-04-16 15:34:11 +02:00
TabContext.h Bug 853632 - Cache own and containing apps in TabContext. r=jlebar 2013-04-16 15:34:11 +02:00
TabMessageUtils.cpp
TabMessageUtils.h
TabParent.cpp Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
TabParent.h Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
test.xul Bug 868859 - Make chromeWindow.content work in e10s. r=bz 2013-05-08 23:16:46 +02:00