gecko/dom/bindings
Ehsan Akhgari 085494b95d 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
..
crashtests Bug 869038 - Clear expando object the right way. r=bz. 2013-05-08 09:20:13 +02:00
parser Bug 895728 part 2. Make booleans, numerics, and strings/enums all be distinguishable from each other. r=khuey 2013-07-30 10:39:34 -07:00
test Bug 895728 part 4. Fix unions to work with the new boolean/numeric/string setup. r=khuey 2013-07-30 10:39:35 -07:00
BindingDeclarations.h Bug 883827. Make Optional<NonNull<T>> and Optional<OwningNonNull<T>> nicer to use by having their const Value() method return a T&. r=peterv 2013-06-19 14:48:43 -04:00
BindingGen.py Bug 875620. Work around bug 874923 by just trying to regenerate all the binding .h and .cpp files if we detect that our dependencies got screwed up. r=khuey 2013-05-28 10:11:19 -04:00
Bindings.conf Bug 888598 - Move IDBTransaction to WebIDL, r=janv 2013-07-29 19:12:21 +02:00
BindingUtils.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
BindingUtils.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
CallbackFunction.h Bug 868312 finale: finish rooting dom/ code. r=smaug 2013-05-17 21:48:25 -04:00
CallbackInterface.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
CallbackInterface.h Bug 865975. Better rooting for the 'this', 'callable', and 'rval' values in WebIDL callbacks. r=bholley 2013-04-26 13:41:21 -04:00
CallbackObject.cpp Bug 883450 - Re-order stuff in CallSetup so that we construct the RootedObject after the Push. r=bz 2013-06-20 11:05:34 -07:00
CallbackObject.h Bug 891966 - 2 - Comment calls to Handle::fromMarkedLocation r=bz 2013-07-23 10:58:28 +01:00
Codegen.py Bug 895728 part 4. Fix unions to work with the new boolean/numeric/string setup. r=khuey 2013-07-30 10:39:35 -07:00
Configuration.py Bug 760851 - Add jsonifier WebIDL declaration and add toJSON to performance.timing. r=bz 2013-07-26 12:00:49 -04:00
DOMJSClass.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
DOMJSProxyHandler.cpp Bug 887558 (part 2) - Move various functions into ProxyObject and FunctionProxyObject. r=jorendorff. 2013-06-20 22:39:22 -07:00
DOMJSProxyHandler.h Bug 887558 (part 2) - Move various functions into ProxyObject and FunctionProxyObject. r=jorendorff. 2013-06-20 22:39:22 -07:00
ErrorResult.h Bug 889016 - Part 1: Add an API to report a not-enough-arguments error in Web IDL bindings; r=bzbarsky 2013-07-04 09:24:49 -04:00
Errors.msg Bug 883358 part 2. Use the new information in bindings error reporting. r=smaug 2013-06-17 16:31:13 -04:00
ExampleGen.py Bug 867903. Speed up getDescriptors and some other obvious slow points in codegen. r=khuey 2013-05-09 13:06:48 -04:00
GenerateCSS2PropertiesWebIDL.py
GlobalGen.py Bug 867903. Speed up getDescriptors and some other obvious slow points in codegen. r=khuey 2013-05-09 13:06:48 -04:00
Makefile.in Bug 838146 part 3. Set up preprocessing of Navigator.webidl, since we want to make some stuff on Navigator build-time-conditional. r=khuey 2013-07-12 10:35:53 -04:00
moz.build Backed out changeset 496846474ed3 (bug 864774) 2013-05-13 10:05:49 +01:00
NonRefcountedDOMObject.h
Nullable.h Bug 865940. Remove AsMutable now that our binding stack variables aren't const. r=bholley 2013-04-25 22:46:18 -04:00
PrimitiveConversions.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
TypedArray.h Bug 877540. Fix remaining unsafe reference hazards in browser code. r=terrence 2013-05-30 17:46:48 -04:00