Commit Graph

23 Commits

Author SHA1 Message Date
Jason Orendorff
8f8c95724a Bug 1312001 - Scramble hash codes securely, to avoid leaking bits of object and symbol addresses.
MozReview-Commit-ID: yR1cIjrlPP
2016-11-30 15:31:56 -06:00
Chris Peterson
0eccc785ff Bug 1277106 - Part 1: Use VS2015's real char16_t instead of aliasing wchar_t. r=Waldo
and remove MOZ_CHAR16_IS_NOT_WCHAR #ifdefs.
2016-07-20 22:01:43 -07:00
Nicholas Nethercote
26b6e79d96 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX
2016-04-27 14:16:50 +10:00
Xidorn Quan
77c9f51733 Bug 1119199 - Rewrite HashFunctions with variadic templates. r=waldo 2015-01-13 10:48:10 +11:00
Eric Rahm
4f908546f3 Bug 1047176 - Part 3: Cast to unsigned char in HashString. r=froydnj 2014-08-04 11:29:33 -07:00
Nicholas Nethercote
50bb9d3f06 Bug 1026319 - Convert the second quarter of MFBT to Gecko style. r=froydnj. 2014-06-12 23:34:08 -07:00
Jan de Mooij
fa788b58b4 Bug 1023778 part 3 - Make AtomizeChars and js_NewStringCopyN accept Latin1 chars. r=luke 2014-06-13 20:51:05 +02:00
Ehsan Akhgari
68bfe70f09 Bug 927728 - Part 1: Replace PRUnichar with char16_t; r=roc
This patch was automatically generated by the following script:

#!/bin/bash
# Command to convert PRUnichar to char16_t

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*modules/libmar*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name prtypes.h \
       ! -name Char16.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRUnichar char16_t
2014-01-04 10:02:17 -05:00
Ehsan Akhgari
238346bfcd Bug 924012 - Provide a HashString version for char16_t if needed; r=Waldo 2013-10-15 11:54:08 -04:00
Ehsan Akhgari
1ab9c7bcb4 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])
2013-07-18 13:59:53 -04:00
Ehsan Akhgari
6d396d8bcb Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
Ms2ger
d1c985e201 Bug 896341 - Update include guards and modelines in MFBT; r=Waldo 2013-07-24 09:41:39 +02:00
Justin Lebar
5887611bd1 No bug - Fix typo in comment in mfbt/HashFunctions.h. DONTBUILD 2013-06-14 11:17:01 -07:00
Rafael Ávila de Espíndola
6968ad058c Bug 805416 - refactor macros to avoid the need for empty macro arguments. r=Waldo. 2012-10-30 16:12:22 -04:00
Nicholas Nethercote
c1a3b9bb18 Bug 647367 - Sequester jshash.{h,cpp} in js/jsd/ (attempt 2). r=luke. 2012-07-18 17:38:10 -07:00
Jeff Walden
24c6b0e0f9 Eliminate Assertions.h's dependency on Types.h, for a narrower interface and minimized dependencies. No bug, r=Ms2ger 2012-06-11 16:16:46 -07:00
Ed Morley
1fec29e57b Backout 1c5a8d617bff (bug 765990), 617cb36ead59, b3067d05a76a (bug 760995), 79f9a61a1e43 (bug 426163) for bustage 2012-06-21 10:00:36 +01:00
Jeff Walden
3cd2b04fc0 Eliminate Assertions.h's dependency on Types.h, for a narrower interface and minimized dependencies. No bug, r=Ms2ger 2012-06-11 16:16:46 -07:00
Jeff Walden
9eafe3f278 Style patrol to make everything conform to mfbt/STYLE. No bug, r=sparky 2012-06-03 20:36:43 -07:00
Jacek Caban
a57267756f Bug 735704 - RotateLeft32 conflicts with winnt.h macro r=Waldo 2012-03-15 13:43:28 +01:00
Justin Lebar
72e36806f7 Bug 729940 - Part 1: Add hash function utilities to mfbt. r=waldo 2012-03-12 18:53:18 -04:00
Justin Lebar
c15697ae1f Bug 729952 - Part 3: Add missing #include. r=me 2012-03-02 17:46:09 -05:00
Justin Lebar
fbd06276e9 Bug 729952 - Part 1: Add a better hash function to mfbt. r=waldo 2012-03-02 17:18:21 -05:00