gecko/toolkit
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
..
components Bug 899504 - Disable about:memory vsize test under ASan. r=ted 2013-07-30 16:01:46 +02:00
content Bug 872127 - Part 3: Remove MSStdInt.h; r=Waldo 2013-07-30 10:25:42 -04:00
crashreporter Bug 889787 - Define XP_LINUX globally; r=ted 2013-07-16 17:10:10 -04:00
devtools Merge m-c to inbound on a CLOSED TREE. 2013-07-30 09:23:28 -04:00
forgetaboutsite Bug 887012 - Remove some emptyish makefiles; r=gps 2013-07-01 09:02:32 +02:00
identity 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
library backout bug 886526 because it probably made us use a lot more memory to link on windows 2013-07-29 11:03:21 -04:00
locales Bug 888510 - In-content theming fixup for the new plugin click-to-activate. Remove the "lightweight" transparent click-to-play theming and make the normal styling plain grey. Switch from a CSS gradient to an image gradient because of performance issues. Highlight the "check for updates" button for outdated plugins. Icons by shorlander and lco, ui-review=lco r=jaws 2013-07-26 09:30:27 -04:00
modules Merge m-c to inbound. 2013-07-29 18:42:45 -04:00
mozapps Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
obsolete
profile Bug 895168 - Part 6: Stop using LL_DIV in the tree; r=jcranmer 2013-07-18 16:50:43 -04:00
system backout bug 886526 because it probably made us use a lot more memory to link on windows 2013-07-29 11:03:21 -04:00
themes Bug 891136: Set pointer-events:auto CSS rule for overlay scrollbars to help make them work on sites such as Google Docs. r=roc 2013-07-29 20:23:31 -04:00
webapps Bug 893297 - Icon problem when installing an app from within another app (yo dawg). r=Mossop 2013-07-29 12:17:57 -04:00
xre 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
Makefile.in
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
toolkit.mozbuild Bug 896729 - Attempt to re-register network link service crashes nsComponentManager. r=bsmedberg 2013-07-26 01:36:55 -07:00