gecko/dom/workers
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
..
test Bug 878600 - Move WorkerLocation to WebIDL; r=khuey 2013-07-24 09:41:55 +02:00
ChromeWorkerScope.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
ChromeWorkerScope.h Bug 868312: Various dom rooting fixes r=bz 2013-05-04 03:52:57 -04:00
DOMBindingBase.cpp Bug 860573 - Part 1 - Store wrapper cache flags separately to the object pointer r=smaug 2013-06-08 09:53:21 +01:00
DOMBindingBase.h Bug 860573 - Part 1 - Store wrapper cache flags separately to the object pointer r=smaug 2013-06-08 09:53:21 +01:00
DOMBindingInlines.h Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
EventListenerManager.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
EventListenerManager.h Bug 868312 finale: finish rooting dom/ code. r=smaug 2013-05-17 21:48:25 -04:00
Events.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
Events.h Bug 868312: Root dom/workers r=bz 2013-05-09 03:27:40 -04:00
EventTarget.cpp Bug 868312 finale: finish rooting dom/ code. r=smaug 2013-05-17 21:48:25 -04:00
EventTarget.h Bug 865377. Give EventTarget a chrome-only getter that returns its global. r=smaug 2013-05-30 17:46:39 -04:00
Exceptions.cpp Bug 885310 - 1 Rename JSHandleFoo in the browser r=bz 2013-06-21 14:12:46 +01:00
Exceptions.h
File.cpp Bug 885310 - 1 Rename JSHandleFoo in the browser r=bz 2013-06-21 14:12:46 +01:00
File.h Bug 868312 - Some more rooting fixes for dom r=bz 2013-05-10 22:39:45 -04:00
FileReaderSync.cpp Bug 868715 part 4. Use on-stack Rooted<JSObject*> for 'object' arguments in WebIDL bindings. r=peterv 2013-05-16 12:36:55 -04:00
FileReaderSync.h Bug 877746 - Annotate ~230 methods with MOZ_OVERRIDE in /dom. r=Ms2ger 2013-06-05 12:15:48 -04:00
ImageData.cpp Bug 885310 - 1 Rename JSHandleFoo in the browser r=bz 2013-06-21 14:12:46 +01:00
ImageData.h Bug 868312 - Some more rooting fixes for dom r=bz 2013-05-10 22:39:45 -04:00
Location.cpp Bug 878600 - Move WorkerLocation to WebIDL; r=khuey 2013-07-24 09:41:55 +02:00
Location.h Bug 878600 - Move WorkerLocation to WebIDL; r=khuey 2013-07-24 09:41:55 +02: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 878600 - Move WorkerLocation to WebIDL; r=khuey 2013-07-24 09:41:55 +02:00
Navigator.cpp Bug 878401 - Move WorkerNavigator to WebIDL; r=khuey 2013-07-24 09:38:23 +02:00
Navigator.h Bug 878401 - Move WorkerNavigator to WebIDL; r=khuey 2013-07-24 09:38:23 +02:00
Principal.cpp
Principal.h
Queue.h
RuntimeService.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
RuntimeService.h Bug 854739: Ensure that messages are delivered in order when suspending and resuming workers. r=bent+bholley 2013-06-06 10:28:47 -07:00
ScriptLoader.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
ScriptLoader.h Bug 587251 - new Worker(badURL) should throw a SECURITY_ERR. r=khuey 2013-03-08 07:27:21 +09:00
TextDecoder.cpp
TextDecoder.h
TextEncoder.cpp
TextEncoder.h
URL.cpp Bug 890928 - Crashfix for URL.createURL in subworker. r=bent 2013-07-18 10:30:41 -04:00
URL.h
Worker.cpp Bug 885310 - 1 Rename JSHandleFoo in the browser r=bz 2013-06-21 14:12:46 +01:00
Worker.h
WorkerFeature.h
WorkerInlines.h
WorkerPrivate.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
WorkerPrivate.h Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
Workers.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
WorkerScope.cpp Bug 899245 - Rename JS_GetGlobalForScopeChain to JS::CurrentGlobalOrNull. r=luke 2013-07-29 16:45:27 -07:00
WorkerScope.h
XMLHttpRequest.cpp Bug 884061 - Part 3f: Use NS_DECL_THREADSAFE_ISUPPORTS in dom/, r=smaug,dhylands. 2013-07-18 21:21:20 -05:00
XMLHttpRequest.h Bug 888338 - 7 - add post barriers to workers r=smaug 2013-07-23 10:58:27 +01:00
XMLHttpRequestEventTarget.cpp
XMLHttpRequestEventTarget.h Bug 868312 finale: finish rooting dom/ code. r=smaug 2013-05-17 21:48:25 -04:00
XMLHttpRequestUpload.cpp Bug 777548 - Make non-cc-participant tracing indirect; r=smaug,billm,jst 2013-03-28 13:37:22 -07:00
XMLHttpRequestUpload.h