Commit Graph

15 Commits

Author SHA1 Message Date
Wesley Chalmers
653d35b85a Bug 891537. WebIDL now includes 2**53 and -2**53 as valid values for long long (and for unsigned long long, in the case of 2**53). r=bzbarsky 2013-09-30 10:37:28 -04:00
Ms2ger
cedde1c419 Bug 907605 - Remove BindingUtils.h include from PrimitiveConversions.h; r=bz 2013-08-22 08:34:48 +02:00
Nicholas Nethercote
849635b8f1 Bug 898914 (part 1) - Remove JSBool.
--HG--
extra : rebase_source : 2d202e0e5005a7f54724b1540481c15cde3ad52e
2013-08-08 15:53:04 -07:00
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
Justin Lebar
09d2312322 Bug 820686 - Remove code after MOZ_CRASH or MOZ_ASSUME_NOT_REACHED. r=(see below)
r=tbsaunde for accessible
r=jmuizelaar for gfx
r=waldo for js
r=roc for layout
r=glandium for mozglue
r=jduell for netwerk
r=khuey for everything else
2013-06-28 18:38:32 -07:00
Justin Lebar
cab87a0cce Bug 802686 - s/MOZ_NOT_REACHED/MOZ_CRASH/ in Gecko. r=(see below)
r=tbsaunde for accessible
r=jmuizelaar for gfx
r=roc for layout
r=glandium for mozglue
r=jduell for netwerk
r=khuey for everything else

This is a mechanical change made with sed.  Later patches in this queue
clean up the whitespace errors and so on.
2013-06-28 18:38:30 -07:00
Boris Zbarsky
14e7edc59d Bug 876805. Fix unsafe reference gc hazards in dom/ code. r=smaug 2013-05-29 16:16:04 -04:00
Nathan Froyd
dbba9baf39 Bug 858131 - rewrite FloatingPoint.h to be C++-only instead of C-compatible C++; r+original-author=Waldo 2013-05-01 16:55:13 -04:00
Robert O'Callahan
f181913ea5 Bug 832788. Part 4: PrimitiveConversions should avoid implicit narrowing casts to avoid compiler warnings; make them explicit. r=bzbarsky
--HG--
extra : rebase_source : 276f7834714ded347bd9d368258bc049f24787c4
2013-01-29 16:14:40 +13:00
Ms2ger
c84831a407 Bug 763367 - Add support for [EnforceRange] and [Clamp]; r=bz 2012-09-06 09:25:03 +02:00
Ms2ger
40c67660e9 No bug - Move the bool specialization of PrimitiveConversionTraits from between the integer ones. 2012-09-06 09:20:29 +02:00
Eric Faust
b1b08f985c Bug 742188 - Implement ToInt64 and ToUint64 per the WebIDL standard. (r=jorendorff) 2012-08-03 15:15:04 -07:00
Eric Faust
d074f7d445 Bug 749536 - Implement JS::ToBoolean to fastpath Value to Boolean unwrappings. (r=luke) 2012-07-24 22:59:55 -07:00
Kyle Huey
7c216602ee Bug 763573: Don't export PrimitiveConversions.h. r=bz 2012-06-11 13:04:34 -07:00
Boris Zbarsky
a6dfa5d203 Bug 748637. Refactor argument conversion to primitive values to make it easier to extend in the future. r=peterv 2012-05-04 12:38:48 -04:00