Bug 898912 (part 10) - Use C++-style casts in TokenStream.cpp. r=till.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 31 Jul 2013 20:50:56 -0700
changeset 153157 8b9f64d7a47e958c9d340267d943315dded95ac5
parent 153156 7a02c72ed5ed0a2ef96429cf1adac726dc0c065d
child 153158 650bf3681eee44c85326a2d25c6fabaf0a74caa7
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs898912
milestone25.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 898912 (part 10) - Use C++-style casts in TokenStream.cpp. r=till.
js/src/frontend/TokenStream.cpp
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -479,17 +479,17 @@ TokenStream::peekChars(int n, jschar *cp
     for (i = 0; i < n; i++) {
         c = getCharIgnoreEOL();
         if (c == EOF)
             break;
         if (c == '\n') {
             ungetCharIgnoreEOL(c);
             break;
         }
-        cp[i] = (jschar)c;
+        cp[i] = jschar(c);
     }
     for (j = i - 1; j >= 0; j--)
         ungetCharIgnoreEOL(cp[j]);
     return i == n;
 }
 
 const jschar *
 TokenStream::TokenBuf::findEOLMax(const jschar *p, size_t max)
@@ -1114,17 +1114,17 @@ TokenStream::getTokenInternal()
      */
     c1kind = FirstCharKind(firstCharKinds[c]);
 
     /*
      * Look for an unambiguous single-char token.
      */
     if (c1kind < OneChar_Max) {
         tp = newToken(-1);
-        tt = (TokenKind)c1kind;
+        tt = TokenKind(c1kind);
         goto out;
     }
 
     /*
      * Skip over non-EOL whitespace chars.
      */
     if (c1kind == Space)
         goto retry;
@@ -1292,17 +1292,17 @@ TokenStream::getTokenInternal()
                                     val = 8 * val + JS7_UNDEC(c);
                                     if (val <= 0377)
                                         getChar();
                                     else
                                         val = save;
                                 }
                             }
 
-                            c = (jschar)val;
+                            c = jschar(val);
                         } else if (c == 'u') {
                             jschar cp[4];
                             if (peekChars(4, cp) &&
                                 JS7_ISHEX(cp[0]) && JS7_ISHEX(cp[1]) &&
                                 JS7_ISHEX(cp[2]) && JS7_ISHEX(cp[3])) {
                                 c = (((((JS7_UNHEX(cp[0]) << 4)
                                         + JS7_UNHEX(cp[1])) << 4)
                                       + JS7_UNHEX(cp[2])) << 4)