gecko-dev/netwerk/dns
Ehsan Akhgari 2824b29025 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
..
DNS.cpp bug 857291 - fix 807678 regression of DNS::GetCanonicalName r=josh 2013-04-08 12:02:41 -04:00
DNS.h bug 857291 - fix 807678 regression of DNS::GetCanonicalName r=josh 2013-04-08 12:02:41 -04:00
Makefile.in Bug 892861 - Remove useless -D flags 'IMPL_THEBES,_IMPL_NS_GFX,...'. r=glandium 2013-07-12 08:56:54 -04:00
effective_tld_names.dat Bug 864704 - re-add csiro.au to PSL. DONTBUILD. 2013-07-11 13:39:16 +01:00
moz.build Bug 875934 - Move LIBRARY_NAME to moz.build (batch #1); r=mshal 2013-06-17 15:21:01 -04:00
nameprep.c Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00
nameprep_template.c Bug 829685 - Remove #include "prtypes.h" from some files that no longer use PR types. r=ehsan 2013-01-10 08:19:36 -08:00
nameprepdata.c
nsDNSService2.cpp Bug 884061 - Part 3q: Use NS_DECL_THREADSAFE_ISUPPORTS in netwerk/, r=macmanus 2013-07-18 21:24:13 -05:00
nsDNSService2.h Bug 884061 - Part 3q: Use NS_DECL_THREADSAFE_ISUPPORTS in netwerk/, r=macmanus 2013-07-18 21:24:13 -05:00
nsEffectiveTLDService.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
nsEffectiveTLDService.h Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn. 2013-06-23 14:03:39 +02:00
nsHostResolver.cpp bug 887753 - server not found after reconnecting to etherpad r=sworkman 2013-07-19 18:40:00 -04:00
nsHostResolver.h bug 887753 - server not found after reconnecting to etherpad r=sworkman 2013-07-19 18:40:00 -04:00
nsIDNKitInterface.h Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
nsIDNSListener.idl Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIDNSRecord.idl Bug 826455 Expose more NetAddr functions to script r=biesi,josh 2013-01-10 18:44:17 +00:00
nsIDNSRequest.idl Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsIDNSService.idl Bug 725587 - Firefox jumps randomly from IPv6 to IPv4 and vice versa in dual-stack environment, r=mcmanus 2013-01-29 23:49:35 +01:00
nsIDNService.cpp Bug 884061 - Part 3q: Use NS_DECL_THREADSAFE_ISUPPORTS in netwerk/, r=macmanus 2013-07-18 21:24:13 -05:00
nsIDNService.h Bug 884061 - Part 3q: Use NS_DECL_THREADSAFE_ISUPPORTS in netwerk/, r=macmanus 2013-07-18 21:24:13 -05:00
nsIEffectiveTLDService.idl Bug 823175 - Add a method to return the next sub domain of a given host in nsIEffectiveTLDService. r=bz 2013-02-04 17:59:49 +00:00
nsIIDNService.idl Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
nsPIDNSService.idl bug 507578 - disable dns prefetch in presence of active proxy r=jduell 2012-09-14 16:27:46 -04:00
prepare_tlds.py Bug 704848 - reduce space required by nsEffectiveTLDService with more preprocessing; r=jduell 2012-09-11 07:42:23 -04:00
punycode.c
punycode.h
race.c Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg 2012-08-22 11:56:38 -04:00