gecko-dev/toolkit/xre
Ehsan Akhgari 2824b29025 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
..
test Bug 864774 - Part 2: Move CPPSRCS to moz.build as CPP_SOURCES; r=joey CLOSED TREE 2013-04-23 17:54:15 -04:00
CreateAppData.cpp
EventTracer.cpp Bug 853896 - Turn off MOZ_EVENT_TRACE when profiling. r=ted 2013-03-22 17:16:52 +01:00
EventTracer.h Bug 853896 - Turn off MOZ_EVENT_TRACE when profiling. r=ted 2013-03-22 17:16:52 +01:00
glxtest.cpp
MacApplicationDelegate.h
MacApplicationDelegate.mm Bug 825150 - Remove const_casts by adding some const-ness to nsICommandLineRunner.init(). r=karlt, sr=bsmedberg. 2013-01-03 13:52:32 -08:00
MacAutoreleasePool.h
MacAutoreleasePool.mm
MacLaunchHelper.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
MacLaunchHelper.mm Bug 829685 - Remove #include "prtypes.h" from some files that no longer use PR types. r=ehsan 2013-01-10 08:19:36 -08:00
MacQuirks.h
make-platformini.py Bug 838459 - Add printing of current timestamp to make-platformini.py. r=gps 2013-02-05 20:15:35 -08:00
Makefile.in Bug 883502 - Part 1: Move 'chromium_config.mk' includes after rules.mk. r=gps 2013-07-04 08:28:43 -04:00
moz.build Bug 877626 - Port GTK2 to GTK3 - build config - xpcom, toolkit, accessible, xulrunner dirs. r=ted, r=karlt 2013-06-10 08:36:26 -04:00
MozMeegoAppService.h
nsAndroidStartup.cpp Bug 855823 - Rely on breakpad finding file ids itself instead of relying on AddLibraryMapping caller to provide them. r=ted 2013-04-09 14:04:53 +02:00
nsAppRunner.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
nsAppRunner.h
nsCommandLineServiceMac.cpp
nsCommandLineServiceMac.h
nsConsoleWriter.cpp
nsEmbedFunctions.cpp Bug 889787 - Define XP_LINUX globally; r=ted 2013-07-16 17:10:10 -04:00
nsINativeAppSupport.idl
nsIWinAppHelper.idl
nsNativeAppSupportBase.cpp
nsNativeAppSupportBase.h
nsNativeAppSupportCocoa.mm Bug 850408 - Part 1: Remove Snow Leopard OS checks in gfx and xre. r=joshmoz 2013-03-07 23:00:07 +00:00
nsNativeAppSupportDefault.cpp
nsNativeAppSupportOS2.cpp Bug 865729 - Remove nsIJSContextStack from other miscellaneous parts of gecko. r=gabor 2013-04-29 11:16:19 -07:00
nsNativeAppSupportOS2.h
nsNativeAppSupportQt.cpp
nsNativeAppSupportQt.h
nsNativeAppSupportUnix.cpp
nsNativeAppSupportWin.cpp Bug 860438 - Straightforward cases. r=gabor 2013-04-18 11:36:03 -04:00
nsNativeAppSupportWin.h
nsQAppInstance.cpp Bug 842805 - Use of API deprecated in Qt5. r=romaxa, r=glandium 2013-02-25 12:25:16 -08:00
nsQAppInstance.h
nsSigHandlers.cpp
nsSigHandlers.h
nsUpdateDriver.cpp Bug 884061 - Part 3v: Use NS_DECL_THREADSAFE_ISUPPORTS in toolkit/, r=Mossop 2013-07-18 21:24:15 -05:00
nsUpdateDriver.h Bug 884061 - Part 3v: Use NS_DECL_THREADSAFE_ISUPPORTS in toolkit/, r=Mossop 2013-07-18 21:24:15 -05:00
nsWindowsDllBlocklist.cpp Bug 890714 - Fix mixed line endings. r=joe, r=jesup 2013-07-08 16:33:15 -04:00
nsWindowsDllInterceptor.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
nsWindowsRestart.cpp
nsWindowsWMain.cpp
nsX11ErrorHandler.cpp
nsX11ErrorHandler.h
nsXREDirProvider.cpp Bug 865188 - Remove Storage support for profile special database. r=mak 2013-07-11 10:00:48 +02:00
nsXREDirProvider.h Bug 239254 - Remove some PRBools that snuck in. r=jduell 2013-02-14 09:11:07 -05:00
ProfileReset.cpp Bug 763890 - Add all the old profiles to the same folder when resetting Firefox multiple times, r=bsmedberg 2013-04-05 14:31:28 +02:00
ProfileReset.h Bug 763890 - Add all the old profiles to the same folder when resetting Firefox multiple times, r=bsmedberg 2013-04-05 14:31:28 +02:00