gecko/dom/plugins/base
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
..
android Bug 883502 - Part 1: Move 'chromium_config.mk' includes after rules.mk. r=gps 2013-07-04 08:28:43 -04:00
Makefile.in 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
moz.build Bug 864774 - Part 2: Move CPPSRCS to moz.build as CPP_SOURCES; r=joey CLOSED TREE 2013-04-23 17:54:15 -04:00
npapi.h
npfunctions.h
npruntime.h
nptypes.h
nsIHTTPHeaderListener.idl
nsIPluginDocument.idl
nsIPluginHost.idl Bug 880735 part B - add .getPluginTagForType and make .getBlocklistStateForType scriptable, r=johns 2013-06-24 08:51:07 -04:00
nsIPluginInputStream.idl
nsIPluginInstanceOwner.idl
nsIPluginTag.idl Bug 880675 - Remove the writable nsIPluginTag.blocklisted property, which is a poorly-constructed cache of the blocklist data, r=jschoenick r=unfocused 2013-06-11 10:58:42 -04:00
nsIPluginTagInfo.idl
nsJSNPRuntime.cpp Bug 897484 - GC: Convert JS_GetProperty APIs to take MutableHandleValue r=terrence r=bholley r=smaug 2013-07-26 10:00:38 +01:00
nsJSNPRuntime.h Bug 868312 - Rooting fixes for dom r=bz 2013-05-14 16:25:32 -07:00
nsNPAPIPlugin.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
nsNPAPIPlugin.h Bug 868130 - Remove the lion's share of JSAutoRequests in gecko. r=gabor 2013-05-22 10:05:28 -06:00
nsNPAPIPluginInstance.cpp Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
nsNPAPIPluginInstance.h Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
nsNPAPIPluginStreamListener.cpp Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
nsNPAPIPluginStreamListener.h
nsPluginDirServiceProvider.cpp Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
nsPluginDirServiceProvider.h Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
nsPluginHost.cpp Fixing bug 855611. Convert navigator.plugins and navigator.mimeTypes to use new DOM bindings. r=peterv@propagandism.org. 2013-07-09 06:58:21 -07:00
nsPluginHost.h Fixing bug 855611. Convert navigator.plugins and navigator.mimeTypes to use new DOM bindings. r=peterv@propagandism.org. 2013-07-09 06:58:21 -07:00
nsPluginInstanceOwner.cpp Bug 738396 - Only pass canonicalized codebase to Java. r=bsmedberg sr=jst 2013-06-27 13:59:37 -07:00
nsPluginInstanceOwner.h Bug 877746 - Annotate ~230 methods with MOZ_OVERRIDE in /dom. r=Ms2ger 2013-06-05 12:15:48 -04:00
nsPluginLogging.h
nsPluginManifestLineReader.h
nsPluginModule.cpp
nsPluginNativeWindow.cpp
nsPluginNativeWindow.h
nsPluginNativeWindowGtk2.cpp
nsPluginNativeWindowOS2.cpp
nsPluginNativeWindowQt.cpp
nsPluginNativeWindowWin.cpp
nsPluginPlayPreviewInfo.cpp
nsPluginPlayPreviewInfo.h
nspluginroot.idl
nsPluginsCID.h
nsPluginsDir.h
nsPluginsDirDarwin.cpp Bug 800220 - Part 1. Replace PL_strlen with strlen. r=ehsan 2013-05-08 12:40:12 +09:00
nsPluginsDirOS2.cpp
nsPluginsDirUnix.cpp Bug 800220 - Part 1. Replace PL_strlen with strlen. r=ehsan 2013-05-08 12:40:12 +09:00
nsPluginsDirUtils.h
nsPluginsDirWin.cpp Bug 607832. r=ehsan 2013-05-28 10:16:58 -04:00
nsPluginStreamListenerPeer.cpp Bug 895168 - Part 2: Stop using LL_ZERO in the tree; r=jcranmer 2013-07-18 16:48:15 -04:00
nsPluginStreamListenerPeer.h
nsPluginTags.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
nsPluginTags.h Fixing bug 855611. Convert navigator.plugins and navigator.mimeTypes to use new DOM bindings. r=peterv@propagandism.org. 2013-07-09 06:58:21 -07:00
PluginPRLibrary.cpp
PluginPRLibrary.h