Bug 673188 style followup.
authorChris Leary <cdleary@mozilla.com>
Fri, 14 Oct 2011 03:19:52 -0700
changeset 78733 d50bd6d5b097d2790c9125c3a060ae2773f98e53
parent 78732 61dd23c012eef276495b8956cc8747e3ae4b7abd
child 78734 2244089600ffab5d1db0ea72ed68ca06c92a9a0c
push id21329
push usereakhgari@mozilla.com
push dateFri, 14 Oct 2011 14:37:50 +0000
treeherdermozilla-central@349f3d4b2d87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs673188
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 673188 style followup.
js/src/builtin/RegExp.cpp
js/src/jsstr.cpp
js/src/vm/MatchPairs.h
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -524,17 +524,17 @@ ExecuteRegExp(JSContext *cx, Native nati
     /*
      * Code execution under this call could swap out the guts of |reobj|, so we
      * have to take a defensive refcount here.
      */
     AutoRefCount<RegExpPrivate> arc(cx, NeedsIncRef<RegExpPrivate>(rep));
     RegExpStatics *res = cx->regExpStatics();
 
     /* Step 2. */
-    JSString *input = js_ValueToString(cx, args.length() > 0 ?  args[0] : UndefinedValue());
+    JSString *input = js_ValueToString(cx, (args.length() > 0) ? args[0] : UndefinedValue());
     if (!input)
         return false;
 
     /* Step 3. */
     JSLinearString *linearInput = input->ensureLinear(cx);
     const jschar *chars = linearInput->chars();
     size_t length = input->length();
 
@@ -553,17 +553,17 @@ ExecuteRegExp(JSContext *cx, Native nati
     /* Step 9a. */
     if (i < 0 || i > length) {
         reobj->zeroLastIndex();
         args.rval() = NullValue();
         return true;
     }
 
     /* Steps 8-21. */
-    RegExpExecType execType = native == regexp_test ? RegExpTest : RegExpExec;
+    RegExpExecType execType = (native == regexp_test) ? RegExpTest : RegExpExec;
     size_t lastIndexInt(i);
     if (!ExecuteRegExp(cx, res, rep, linearInput, chars, length, &lastIndexInt, execType,
                        &args.rval())) {
         return false;
     }
 
     /* Step 11 (with sticky extension). */
     if (rep->global() || (!args.rval().isNull() && rep->sticky())) {
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -1444,17 +1444,17 @@ class RegExpGuard
     bool hasRegExpPair() const { return !rep.null(); }
 #endif
 };
 
 /* ExecuteRegExp indicates success in two ways, based on the 'test' flag. */
 static JS_ALWAYS_INLINE bool
 Matched(RegExpExecType type, const Value &v)
 {
-    return type == RegExpTest ? v.isTrue() : !v.isNull();
+    return (type == RegExpTest) ? v.isTrue() : !v.isNull();
 }
 
 typedef bool (*DoMatchCallback)(JSContext *cx, RegExpStatics *res, size_t count, void *data);
 
 /*
  * BitOR-ing these flags allows the DoMatch caller to control when how the
  * RegExp engine is called and when callbacks are fired.
  */
@@ -1477,17 +1477,17 @@ DoMatch(JSContext *cx, RegExpStatics *re
     JSLinearString *linearStr = str->ensureLinear(cx);
     if (!linearStr)
         return false;
     const jschar *chars = linearStr->chars();
     size_t length = linearStr->length();
 
     if (rep->global()) {
         /* global matching ('g') */
-        RegExpExecType type = flags & TEST_GLOBAL_BIT ? RegExpTest : RegExpExec;
+        RegExpExecType type = (flags & TEST_GLOBAL_BIT) ? RegExpTest : RegExpExec;
         if (RegExpObject *reobj = regExpPair.reobj())
             reobj->zeroLastIndex();
 
         for (size_t count = 0, i = 0, length = str->length(); i <= length; ++count) {
             if (!ExecuteRegExp(cx, res, rep, linearStr, chars, length, &i, type, rval))
                 return false;
             if (!Matched(type, *rval))
                 break;
--- a/js/src/vm/MatchPairs.h
+++ b/js/src/vm/MatchPairs.h
@@ -109,17 +109,17 @@ class MatchPairs
         return MatchPair(buffer_[2 * i], buffer_[2 * i + 1]);
     }
 
     void displace(size_t amount) {
         if (!amount)
             return;
 
         for (int *it = buffer_; it < buffer_ + 2 * pairCount_; ++it)
-            *it = *it < 0 ? -1 : *it + amount;
+            *it = (*it < 0) ? -1 : *it + amount;
     }
 
     inline void checkAgainst(size_t length);
 };
 
 } /* namespace js */
 
 #endif