gecko/xpcom/threads
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
..
HangMonitor.cpp Bug 867313: 'crash on hang' doesn't always trigger. r=ehsan 2013-04-30 18:39:16 -04:00
HangMonitor.h
LazyIdleThread.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
LazyIdleThread.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
Makefile.in Bug 892861 - Remove useless -D flags 'IMPL_THEBES,_IMPL_NS_GFX,...'. r=glandium 2013-07-12 08:56:54 -04:00
moz.build Bug 876029 - Make Gonk memory pressure by-pass the event queue. r=jlebar 2013-07-09 13:47:15 -07:00
nsEnvironment.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsEnvironment.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsEventQueue.cpp
nsEventQueue.h
nsICancelableRunnable.idl
nsIEnvironment.idl
nsIEventTarget.idl
nsIProcess.idl Bug 849086: Remove unused *_CLASSNAME defines. r=bsmedberg 2013-03-15 10:52:10 -07:00
nsIRunnable.idl
nsISupportsPriority.idl
nsIThread.idl
nsIThreadInternal.idl
nsIThreadManager.idl
nsIThreadPool.idl
nsITimer.idl Bug 331566 - Change idl interfaces to use @throws instead of @return NS_. r=bsmedberg 2013-05-16 08:26:55 -04:00
nsMemoryPressure.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
nsMemoryPressure.h Bug 876029 - Make Gonk memory pressure by-pass the event queue. r=jlebar 2013-07-09 13:47:15 -07:00
nsProcess.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsProcessCommon.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsThread.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsThread.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsThreadManager.cpp bug 877850 - fix static constructors in xpcom/ r=jlebar 2013-05-30 17:20:02 -04:00
nsThreadManager.h bug 877850 - fix static constructors in xpcom/ r=jlebar 2013-05-30 17:20:02 -04:00
nsThreadPool.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsThreadPool.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsTimerImpl.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
nsTimerImpl.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
SyncRunnable.h Bug 853998 - Add a common "SyncRunnable" class which dispatches events totally synchronously, avoiding event loop spinning or automatic promotion of this event to a nsThread, r=bsmedberg 2013-03-26 09:11:00 -07:00
TimerThread.cpp Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00
TimerThread.h Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg 2013-07-18 21:31:26 -05:00