gecko/dom/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
..
crashtests Bug 886213 - Cycle collect Navigator more better. r=smaug 2013-06-28 11:06:39 -07:00
test Bug 898817 - Stop exposing nsIDOM* interfaces on the global automatically. r=bz 2013-07-30 22:26:27 +09:00
BarProps.cpp Bug 858524 - Move BarProp objects to Paris bindings, r=ms2ger, r=smaug 2013-06-01 01:53:00 -07:00
BarProps.h Bug 858524 - Move BarProp objects to Paris bindings, r=ms2ger, r=smaug 2013-06-01 01:53:00 -07:00
ConsoleAPI.js Bug 874061 - Figure out private browsing and the browser console; r=robcee f=ehsan 2013-05-25 12:25:36 +03:00
ConsoleAPI.manifest
ConsoleAPIStorage.jsm Bug 861338 - [browserconsole] Cache Console.jsm API calls with ConsoleAPIStorage.jsm; r=jwalker 2013-06-07 20:13:48 +03:00
Crypto.cpp
Crypto.h
DOMCursor.cpp Bug 874583 - Use NS_IMPL_CYCLE_COLLECTION_INHERITED_n in more places. r=smaug 2013-05-21 16:23:53 -07:00
DOMCursor.h
domerr.msg
DOMError.cpp Bug 883178 - [MMI] Implement DOMMMIResult and DOMMMIError. Part 1: DOMError. r=sicking, sr=peterv 2013-06-30 20:21:31 +08:00
DOMError.h Bug 883178 - [MMI] Implement DOMMMIResult and DOMMMIError. Part 1: DOMError. r=sicking, sr=peterv 2013-06-30 20:21:31 +08:00
DOMRequest.cpp Bug 802686 - s/MOZ_NOT_REACHED/MOZ_CRASH/ in Gecko. r=(see below) 2013-06-28 18:38:30 -07:00
DOMRequest.h Bug 885701 - [DOMRequest] Implement DOMRequestService.fireDetailedError. r,sr=sicking 2013-06-28 10:53:44 +08:00
DOMRequestHelper.jsm Bug 892647 - Add check to DOMRequestIpcHelperMessageListener.destroy() to take actions only once. r=jlebar 2013-07-11 17:13:42 -04:00
IndexedDBHelper.jsm Bug 877869 - Fix typo in indexedbHelper.jsm r=bent 2013-05-30 16:19:22 -07:00
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 855130 - Implement HTMLVideoElement's VideoPlaybackQuality (from 2013-06-21 15:14:18 +12:00
Navigator.cpp Bug 884921 - navigator.geolocation should never be null. r=dougt 2013-07-26 16:12:12 -04:00
Navigator.h Bug 891235: remove mozSms. rs=mounir 2013-07-26 18:40:27 +08:00
nsContentPermissionHelper.cpp Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
nsContentPermissionHelper.h Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
nsDOMCID.h
nsDOMClassInfo.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
nsDOMClassInfo.h Bug 892493 - Remove nsNamedArraySH; r=peterv 2013-07-24 09:27:42 +02:00
nsDOMClassInfoClasses.h Bug 898817 - Stop exposing nsIDOM* interfaces on the global automatically. r=bz 2013-07-30 22:26:27 +09:00
nsDOMClassInfoID.h
nsDOMException.cpp bug 877886 - get rid of a number of static constructors in content/ and dom/ r=smaug 2013-05-30 18:34:53 -04:00
nsDOMException.h
nsDOMJSUtils.h
nsDOMNavigationTiming.cpp Bug 888323 - Stop including prtime.h in nsrootidl.idl. r=ehsan 2013-07-04 00:56:26 +09:00
nsDOMNavigationTiming.h
nsDOMScriptObjectFactory.cpp Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
nsDOMScriptObjectFactory.h Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
nsDOMString.h
nsDOMWindowList.cpp
nsDOMWindowList.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
nsDOMWindowUtils.cpp Backout b43b3d14ea16 for mochitest failures on CLOSED TREE 2013-07-29 22:46:45 -07:00
nsDOMWindowUtils.h
nsFocusManager.cpp Bug 887718, don't call SetVisibility when focus test mode is enabled, r=smaug 2013-07-05 12:05:26 -04:00
nsFocusManager.h Bug 396542 nsFocusManager should restore caret browsing mode when an editor loses focus r=ehsan 2013-05-22 12:28:43 +09:00
nsGlobalWindow.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
nsGlobalWindow.h Backout b43b3d14ea16 for mochitest failures on CLOSED TREE 2013-07-29 22:46:45 -07:00
nsGlobalWindowCommands.cpp
nsGlobalWindowCommands.h
nsHistory.cpp
nsHistory.h
nsIDOMClassInfo.h
nsIDOMDOMCursor.idl
nsIDOMDOMRequest.idl Bug 885701 - [DOMRequest] Implement DOMRequestService.fireDetailedError. r,sr=sicking 2013-06-28 10:53:44 +08:00
nsIDOMScriptObjectFactory.h
nsIEntropyCollector.idl
nsIGlobalObject.h
nsIJSEventListener.h Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn. 2013-06-23 14:03:39 +02:00
nsIJSNativeInitializer.h
nsIScriptChannel.idl
nsIScriptContext.h Bug 876805. Fix unsafe reference gc hazards in dom/ code. r=smaug 2013-05-29 16:16:04 -04:00
nsIScriptExternalNameSet.h
nsIScriptGlobalObject.h
nsIScriptGlobalObjectOwner.h
nsIScriptNameSpaceManager.h
nsIScriptObjectPrincipal.h
nsIScriptRuntime.h
nsIScriptTimeoutHandler.h
nsISiteSpecificUserAgent.idl
nsISizeOfEventTarget.h Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn. 2013-06-23 14:03:39 +02:00
nsJSEnvironment.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
nsJSEnvironment.h Bug 877746 - Annotate ~230 methods with MOZ_OVERRIDE in /dom. r=Ms2ger 2013-06-05 12:15:48 -04:00
nsJSTimeoutHandler.cpp Bug 877762 - GC: Post-barrier cycle collector participants - 6 Convert jsid and JS::String to use Heap<T> r=smaug 2013-06-18 11:00:38 +01:00
nsJSUtils.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
nsJSUtils.h
nsLocation.cpp Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
nsLocation.h
nsMimeTypeArray.cpp Bug 893004 part 3. Remove the unused-from-C++ bits of nsIDOMNavigator, except the ones that share implementation with WebIDL anyway. r=smaug 2013-07-17 23:23:52 -04:00
nsMimeTypeArray.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
nsPerformance.cpp Bug 870667. Reinstate a way to turn off performance.timing bits using a pref. r=smaug 2013-05-10 18:57:58 -04:00
nsPerformance.h Bug 870667. Reinstate a way to turn off performance.timing bits using a pref. r=smaug 2013-05-10 18:57:58 -04:00
nsPIDOMWindow.h Bug 894646 - Various dom deCOM cleanups r=Ms2ger 2013-07-23 16:39:17 -07:00
nsPIWindowRoot.h Bug 865377. Give EventTarget a chrome-only getter that returns its global. r=smaug 2013-05-30 17:46:39 -04:00
nsPluginArray.cpp Bug 896242. Fix possible crash due to dangling pointer to nsPluginElement. r=mccr8 2013-07-24 23:33:21 -07:00
nsPluginArray.h Bug 896242. Fix possible crash due to dangling pointer to nsPluginElement. r=mccr8 2013-07-24 23:33:21 -07:00
nsQueryContentEventResult.cpp
nsQueryContentEventResult.h
nsScreen.cpp Bug 820686 - Remove code after MOZ_CRASH or MOZ_ASSUME_NOT_REACHED. r=(see below) 2013-06-28 18:38:32 -07:00
nsScreen.h Bug 851642 - Make sure fullscreenchange event is sent even when the document is being removed from the doctree. r=smaug 2013-05-13 12:00:42 +01:00
nsScriptNameSpaceManager.cpp Bug 898817 - Stop exposing nsIDOM* interfaces on the global automatically. r=bz 2013-07-30 22:26:27 +09:00
nsScriptNameSpaceManager.h Bug 898817 - Stop exposing nsIDOM* interfaces on the global automatically. r=bz 2013-07-30 22:26:27 +09:00
nsStructuredCloneContainer.cpp Bug 868130 - Remove the lion's share of JSAutoRequests in gecko. r=gabor 2013-05-22 10:05:28 -06:00
nsStructuredCloneContainer.h
nsWindowMemoryReporter.cpp Bug 888693 - Add a null-check to nsWindowMemoryReporter.cpp so taking a memory report doesn't crash B2G. r=nmaier 2013-06-30 09:39:10 -07:00
nsWindowMemoryReporter.h Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn. 2013-06-23 14:03:39 +02:00
nsWindowRoot.cpp Bug 865377. Give EventTarget a chrome-only getter that returns its global. r=smaug 2013-05-30 17:46:39 -04:00
nsWindowRoot.h Bug 877746 - Annotate ~230 methods with MOZ_OVERRIDE in /dom. r=Ms2ger 2013-06-05 12:15:48 -04:00
nsWrapperCache.cpp Bug 884268 - Part b: Move nsContentUtils::PreserveWrapper to nsWrapperCache; r=smaug 2013-06-23 09:15:42 +02:00
nsWrapperCache.h Bug 884268 - Part b: Move nsContentUtils::PreserveWrapper to nsWrapperCache; r=smaug 2013-06-23 09:15:42 +02:00
nsWrapperCacheInlines.h Bug 877762 - GC: Post-barrier cycle collector participants - 7 Convert most JSObect to use Heap<T> (ex. XBL) r=bz 2013-06-18 11:00:38 +01:00
ObjectWrapper.jsm
ScreenOrientation.h
SiteSpecificUserAgent.js Bug 814379 - Don't use cached userAgent for fallback when no site-specific UA exists. r=dao 2013-05-10 08:40:44 -04:00
SiteSpecificUserAgent.manifest
StructuredCloneTags.h
URL.cpp Bug 855130 - Implement URL::createObjectURL overload for 2013-06-21 15:15:15 +12:00
URL.h Bug 855130 - Implement URL::createObjectURL overload for 2013-06-21 15:15:15 +12:00