Bug 1405598 - Restyle prefread.cpp (clang-format 3). r=glandium. draft
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 04 Oct 2017 20:26:35 +1100
changeset 674751 5783a1d689f4a3aeb72aa2c8dbcf582ed52cb6c8
parent 674750 b58b11e70a57d7f91e38d20861ff776ae5b8b32f
child 734418 3a2437f55ea6df0f100e6164bf4b37b4c7ce802e
push id82932
push usernnethercote@mozilla.com
push dateWed, 04 Oct 2017 09:27:25 +0000
reviewersglandium
bugs1405598
milestone58.0a1
Bug 1405598 - Restyle prefread.cpp (clang-format 3). r=glandium. MozReview-Commit-ID: 6tY9GE0gIc3
modules/libpref/prefread.cpp
--- a/modules/libpref/prefread.cpp
+++ b/modules/libpref/prefread.cpp
@@ -433,27 +433,28 @@ PREF_ParseBuf(PrefParseState* aPS, const
           case 'n':
             c = '\n';
             break;
           case 'x': // hex escape -- always interpreted as Latin-1
           case 'u': // UTF16 escape
             aPS->esctmp[0] = c;
             aPS->esclen = 1;
             aPS->utf16[0] = aPS->utf16[1] = 0;
-            aPS->sindex = (c == 'x') ? HEX_ESC_NUM_DIGITS : UTF16_ESC_NUM_DIGITS;
+            aPS->sindex =
+              (c == 'x') ? HEX_ESC_NUM_DIGITS : UTF16_ESC_NUM_DIGITS;
             state = PREF_PARSE_HEX_ESCAPE;
             continue;
           default:
             pref_ReportParseProblem(
               *aPS, "preserving unexpected JS escape sequence", lineNum, false);
             NS_WARNING("preserving unexpected JS escape sequence");
             // Invalid escape sequence so we do have to write more than one
             // character. Grow line buffer if necessary...
             if ((aPS->lbcur + 1) == aPS->lbend && !pref_GrowBuf(aPS)) {
-              return false;       // out of memory
+              return false; // out of memory
             }
             *aPS->lbcur++ = '\\'; // preserve the escape sequence
             break;
         }
         *aPS->lbcur++ = c;
         state = PREF_PARSE_QUOTED_STRING;
         break;
 
@@ -462,18 +463,20 @@ PREF_ParseBuf(PrefParseState* aPS, const
         if (c >= '0' && c <= '9') {
           udigit = (c - '0');
         } else if (c >= 'A' && c <= 'F') {
           udigit = (c - 'A') + 10;
         } else if (c >= 'a' && c <= 'f') {
           udigit = (c - 'a') + 10;
         } else {
           // bad escape sequence found, write out broken escape as-is
-          pref_ReportParseProblem(
-            *aPS, "preserving invalid or incomplete hex escape", lineNum, false);
+          pref_ReportParseProblem(*aPS,
+                                  "preserving invalid or incomplete hex escape",
+                                  lineNum,
+                                  false);
           NS_WARNING("preserving invalid or incomplete hex escape");
           *aPS->lbcur++ = '\\'; // original escape slash
           if ((aPS->lbcur + aPS->esclen) >= aPS->lbend && !pref_GrowBuf(aPS)) {
             return false;
           }
           for (int i = 0; i < aPS->esclen; ++i) {
             *aPS->lbcur++ = aPS->esctmp[i];
           }