Bug 1358444 - port bug 1356843 to mailnews: Fix clang's -Wcomma warnings (more). r=aceman
authorJorg K <jorgk@jorgk.com>
Sat, 22 Apr 2017 00:46:37 +0200
changeset 21449 2bf4d1d2bf58662aeb5dd8f260f83842eeb63f61
parent 21448 09f4a64c933abae2079964efc050796e546f4c4d
child 21450 756dadb206f5d280ce8b1f80eda047e7f5fa1e92
push id13057
push usermozilla@jorgk.com
push dateFri, 21 Apr 2017 22:53:25 +0000
treeherdercomm-central@756dadb206f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1358444, 1356843
Bug 1358444 - port bug 1356843 to mailnews: Fix clang's -Wcomma warnings (more). r=aceman
db/mork/src/morkDeque.h
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/mime/emitters/nsMimeHtmlEmitter.cpp
mailnews/mime/src/mimeenc.cpp
mailnews/mime/src/mimetric.cpp
mailnews/news/src/nsNNTPProtocol.cpp
--- a/db/mork/src/morkDeque.h
+++ b/db/mork/src/morkDeque.h
@@ -210,30 +210,30 @@ From IronDoc documentation for AddFirst:
 | h.next |-->| b.next |      | h.next |-->| a.next |-->| b.next |
 +--------+   +--------+  ==> +--------+   +--------+   +--------+
 | h.prev |<--| b.prev |      | h.prev |<--| a.prev |<--| b.prev |
 +--------+   +--------+      +--------+   +--------+   +--------+
 */
 
   void AddFirst(morkLink* in) /*i*/ 
   {
-    ( (mDeque_Head.mLink_Next->mLink_Prev = 
-      (in))->mLink_Next = mDeque_Head.mLink_Next, 
-        ((in)->mLink_Prev = &mDeque_Head)->mLink_Next = (in) );
+    (mDeque_Head.mLink_Next->mLink_Prev = in)->mLink_Next =
+      mDeque_Head.mLink_Next;
+    (in->mLink_Prev = &mDeque_Head)->mLink_Next = in;
   }
 /*
 From IronDoc documentation for AddLast:
 +--------+   +--------+      +--------+   +--------+   +--------+
 | y.next |-->| h.next |      | y.next |-->| z.next |-->| h.next |
 +--------+   +--------+  ==> +--------+   +--------+   +--------+
 | y.prev |<--| h.prev |      | y.prev |<--| z.prev |<--| h.prev |
 +--------+   +--------+      +--------+   +--------+   +--------+
 */
 
   void AddLast(morkLink* in)
   {
-    ( (mDeque_Head.mLink_Prev->mLink_Next = 
-      (in))->mLink_Prev = mDeque_Head.mLink_Prev, 
-        ((in)->mLink_Next = &mDeque_Head)->mLink_Prev = (in) );
+    (mDeque_Head.mLink_Prev->mLink_Next = in)->mLink_Prev =
+      mDeque_Head.mLink_Prev;
+    (in->mLink_Next = &mDeque_Head)->mLink_Prev = in;
   }
 };
 
 #endif /* _MORKDEQUE_ */
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -449,17 +449,17 @@ void Tokenizer::tokenizeAttachment(const
 }
 
 void Tokenizer::tokenizeHeaders(nsIUTF8StringEnumerator * aHeaderNames, nsIUTF8StringEnumerator * aHeaderValues)
 {
   nsCString headerValue;
   nsAutoCString headerName; // we'll be normalizing all header names to lower case
   bool hasMore;
  
-  while (aHeaderNames->HasMore(&hasMore), hasMore)
+  while (NS_SUCCEEDED(aHeaderNames->HasMore(&hasMore)) && hasMore)
   {
     aHeaderNames->GetNext(headerName);
     ToLowerCase(headerName);
     aHeaderValues->GetNext(headerValue);
 
     bool headerProcessed = false;
     if (mCustomHeaderTokenization)
     {
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -4267,17 +4267,18 @@ void nsImapMailFolder::FindKeysToDelete(
   // anything thats in existingKeys but not in the flag state, as well
   // as messages with the deleted flag set.
   uint32_t total = existingKeys.Length();
   int onlineIndex = 0; // current index into flagState
   for (uint32_t keyIndex = 0; keyIndex < total; keyIndex++)
   {
 
     while ((onlineIndex < numMessageInFlagState) &&
-         (flagState->GetUidOfMessage(onlineIndex, &uidOfMessage), (existingKeys[keyIndex] > uidOfMessage) ))
+           NS_SUCCEEDED(flagState->GetUidOfMessage(onlineIndex, &uidOfMessage)) &&
+           (existingKeys[keyIndex] > uidOfMessage))
       onlineIndex++;
 
     flagState->GetUidOfMessage(onlineIndex, &uidOfMessage);
     flagState->GetMessageFlags(onlineIndex, &flags);
     // delete this key if it is not there or marked deleted
     if ( (onlineIndex >= numMessageInFlagState ) ||
        (existingKeys[keyIndex] != uidOfMessage) ||
        ((flags & kImapMsgDeletedFlag) && !showDeletedMessages) )
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -7900,17 +7900,17 @@ void nsImapProtocol::Search(const char *
      protocolString.Append(" uid");
   protocolString.Append(" ");
   protocolString.Append(searchCriteria);
   // the search criteria can contain string literals, which means we
   // need to break up the protocol string by CRLF's, and after sending CRLF,
   // wait for the server to respond OK before sending more data
   nsresult rv;
   int32_t crlfIndex;
-  while (crlfIndex = protocolString.Find(CRLF), crlfIndex != kNotFound && !DeathSignalReceived())
+  while ((crlfIndex = protocolString.Find(CRLF)) != kNotFound && !DeathSignalReceived())
   {
     nsAutoCString tempProtocolString;
     tempProtocolString = StringHead(protocolString, crlfIndex + 2);
     rv = SendData(tempProtocolString.get());
     if (NS_FAILED(rv))
       return;
     ParseIMAPandCheckForNewMail();
     protocolString.Cut(0, crlfIndex + 2);
--- a/mailnews/mime/emitters/nsMimeHtmlEmitter.cpp
+++ b/mailnews/mime/emitters/nsMimeHtmlEmitter.cpp
@@ -185,40 +185,59 @@ nsresult nsMimeHtmlDisplayEmitter::Broad
   }
 
   for (size_t i = 0; i < mHeaderArray->Length(); i++)
   {
     headerInfoType * headerInfo = mHeaderArray->ElementAt(i);
     if ( (!headerInfo) || (!headerInfo->name) || (!(*headerInfo->name)) || (!headerInfo->value) || (!(*headerInfo->value)))
       continue;
 
-    const char * headerValue = headerInfo->value;
-
     // optimization: if we aren't in view all header view mode, we only show a small set of the total # of headers.
     // don't waste time sending those out to the UI since the UI is going to ignore them anyway.
     if (aHeaderMode != VIEW_ALL_HEADERS && (mFormat != nsMimeOutput::nsMimeMessageFilterSniffer))
     {
-      nsDependentCString headerStr(headerInfo->name);
-      if (PL_strcasecmp("to", headerInfo->name) && PL_strcasecmp("from", headerInfo->name) &&
-          PL_strcasecmp("cc", headerInfo->name) && PL_strcasecmp("newsgroups", headerInfo->name) &&
-          PL_strcasecmp("bcc", headerInfo->name) && PL_strcasecmp("followup-to", headerInfo->name) &&
-          PL_strcasecmp("reply-to", headerInfo->name) && PL_strcasecmp("subject", headerInfo->name) &&
-          PL_strcasecmp("organization", headerInfo->name) && PL_strcasecmp("user-agent", headerInfo->name) &&
-          PL_strcasecmp("content-base", headerInfo->name) && PL_strcasecmp("sender", headerInfo->name) &&
-          PL_strcasecmp("date", headerInfo->name) && PL_strcasecmp("x-mailer", headerInfo->name) &&
-          PL_strcasecmp("content-type", headerInfo->name) && PL_strcasecmp("message-id", headerInfo->name) &&
-          PL_strcasecmp("x-newsreader", headerInfo->name) && PL_strcasecmp("x-mimeole", headerInfo->name) &&
-          PL_strcasecmp("references", headerInfo->name) && PL_strcasecmp("in-reply-to", headerInfo->name) &&
-          PL_strcasecmp("list-post", headerInfo->name) && PL_strcasecmp("delivered-to", headerInfo->name) &&
-          // make headerStr lower case because IndexOf is case-sensitive
-         (!extraExpandedHeadersArray.Length() || (ToLowerCase(headerStr),
-            !extraExpandedHeadersArray.Contains(headerStr))))
-            continue;
+      bool skip = true;
+      const char * headerName = headerInfo->name;
+      // Accept the following:
+      if (!PL_strcasecmp("to",           headerName) ||
+          !PL_strcasecmp("from",         headerName) ||
+          !PL_strcasecmp("cc",           headerName) ||
+          !PL_strcasecmp("newsgroups",   headerName) ||
+          !PL_strcasecmp("bcc",          headerName) ||
+          !PL_strcasecmp("followup-to",  headerName) ||
+          !PL_strcasecmp("reply-to",     headerName) ||
+          !PL_strcasecmp("subject",      headerName) ||
+          !PL_strcasecmp("organization", headerName) ||
+          !PL_strcasecmp("user-agent",   headerName) ||
+          !PL_strcasecmp("content-base", headerName) ||
+          !PL_strcasecmp("sender",       headerName) ||
+          !PL_strcasecmp("date",         headerName) ||
+          !PL_strcasecmp("x-mailer",     headerName) ||
+          !PL_strcasecmp("content-type", headerName) ||
+          !PL_strcasecmp("message-id",   headerName) ||
+          !PL_strcasecmp("x-newsreader", headerName) ||
+          !PL_strcasecmp("x-mimeole",    headerName) ||
+          !PL_strcasecmp("references",   headerName) ||
+          !PL_strcasecmp("in-reply-to",  headerName) ||
+          !PL_strcasecmp("list-post",    headerName) ||
+          !PL_strcasecmp("delivered-to", headerName)) {
+        skip = false;
+      } else if (extraExpandedHeadersArray.Length() > 0) {
+        // Make headerStr lower case because IndexOf is case-sensitive.
+        nsDependentCString headerStr(headerInfo->name);
+        ToLowerCase(headerStr);
+        // Accept if it's an "extra" header.
+        if (extraExpandedHeadersArray.Contains(headerStr))
+          skip = false;
+      }
+      if (skip)
+        continue;
     }
 
+    const char * headerValue = headerInfo->value;
     headerNameEnumerator->Append(headerInfo->name);
     headerValueEnumerator->Append(headerValue);
 
     // Add a localized version of the date header if we encounter it.
     if (!PL_strcasecmp("Date", headerInfo->name))
     {
       headerNameEnumerator->Append("X-Mozilla-LocalizedDate");
       GenerateDateString(headerValue, convertedDateString, false);
--- a/mailnews/mime/src/mimeenc.cpp
+++ b/mailnews/mime/src/mimeenc.cpp
@@ -185,17 +185,17 @@ mime_decode_base64_token (const char *in
   for (j = 0; j < 4; j++)
   {
     unsigned char c = 0;
     if (in[j] >= 'A' && in[j] <= 'Z')     c = in[j] - 'A';
     else if (in[j] >= 'a' && in[j] <= 'z') c = in[j] - ('a' - 26);
     else if (in[j] >= '0' && in[j] <= '9') c = in[j] - ('0' - 52);
     else if (in[j] == '+')         c = 62;
     else if (in[j] == '/')         c = 63;
-    else if (in[j] == '=')         c = 0, eq_count++;
+    else if (in[j] == '=')         { c = 0; eq_count++; }
     else
     NS_ERROR("Invalid character");
     num = (num << 6) | c;
   }
 
   *out++ = (char) (num >> 16);
   *out++ = (char) ((num >> 8) & 0xFF);
   *out++ = (char) (num & 0xFF);
@@ -353,18 +353,20 @@ mime_decode_uue_buffer (MimeDecoderData 
       input_length--;
 
       if (out[-1] == '\r' || out[-1] == '\n')
         {
         /* If we just copied a CR, and an LF is waiting, grab it too.
          */
         if (out[-1] == '\r' &&
           input_length > 0 &&
-          *input_buffer == '\n')
-          input_buffer++, input_length--;
+          *input_buffer == '\n') {
+            input_buffer++;
+            input_length--;
+          }
 
         /* We have a line. */
         break;
         }
       }
     *out = 0;
 
     /* Ignore blank lines.
@@ -585,18 +587,20 @@ mime_decode_yenc_buffer (MimeDecoderData
         *out++ = *input_buffer++;
         input_length--;
 
         if (out[-1] == '\r' || out[-1] == '\n')
         {
           /* If we just copied a CR, and an LF is waiting, grab it too. */
           if (out[-1] == '\r' &&
                   input_length > 0 &&
-                  *input_buffer == '\n')
-            input_buffer++, input_length--;
+                  *input_buffer == '\n') {
+            input_buffer++;
+            input_length--;
+          }
 
            /* We have a line. */
            break;
         }
       }
       *out = 0;
 
       /* Ignore blank lines. */
--- a/mailnews/mime/src/mimetric.cpp
+++ b/mailnews/mime/src/mimetric.cpp
@@ -169,129 +169,126 @@ MimeRichtextConvert (const char *line, i
       if (*old == '/')
       {
         /* This is </tag> */
         old++;
       }
 
       switch (*old)
       {
-      case 'b': case 'B':
+      case 'b':
+      case 'B':
         if (!PL_strncasecmp ("BIGGER>", old, 7))
-        tag_open = "<FONT SIZE=\"+1\">", tag_close = "</FONT>";
-        else if (!PL_strncasecmp ("BLINK>", old, 5))
-        /* Of course, both text/richtext and text/enriched must be
-           enhanced *somehow*...  Or else what would people think. */
-        tag_open = "<BLINK>", tag_close = "</BLINK>";
+          { tag_open = "<FONT SIZE=\"+1\">"; tag_close = "</FONT>"; }
+        else if (!PL_strncasecmp ("BLINK>", old, 6))
+          // Of course, both text/richtext and text/enriched must be
+          // enhanced *somehow*...  Or else what would people think.
+          { tag_open = "<BLINK>"; tag_close = "</BLINK>"; }
         else if (!PL_strncasecmp ("BOLD>", old, 5))
-        tag_open = "<B>", tag_close = "</B>";
+          { tag_open = "<B>"; tag_close = "</B>"; }
         break;
-      case 'c': case 'C':
+
+      case 'c':
+      case 'C':
         if (!PL_strncasecmp ("CENTER>", old, 7))
-        tag_open = "<CENTER>", tag_close = "</CENTER>";
-        else if (!enriched_p &&
-             !PL_strncasecmp ("COMMENT>", old, 8))
-        tag_open = "<!-- ", tag_close = " -->";
+          { tag_open = "<CENTER>"; tag_close = "</CENTER>"; }
+        else if (!enriched_p && !PL_strncasecmp ("COMMENT>", old, 8))
+          { tag_open = "<!-- "; tag_close = " -->"; }
         break;
-      case 'e': case 'E':
+
+      case 'e':
+      case 'E':
         if (!PL_strncasecmp ("EXCERPT>", old, 8))
-        tag_open = "<BLOCKQUOTE>", tag_close = "</BLOCKQUOTE>";
+         { tag_open = "<BLOCKQUOTE>"; tag_close = "</BLOCKQUOTE>"; }
         break;
-      case 'f': case 'F':
+
+      case 'f':
+      case 'F':
         if (!PL_strncasecmp ("FIXED>", old, 6))
-        tag_open = "<TT>", tag_close = "</TT>";
-        else if (enriched_p &&
-             !PL_strncasecmp ("FLUSHBOTH>", old, 10))
-        tag_open = "<P ALIGN=LEFT>", tag_close = "</P>";
+          { tag_open = "<TT>"; tag_close = "</TT>"; }
+        else if (enriched_p && !PL_strncasecmp ("FLUSHBOTH>", old, 10))
+          { tag_open = "<P ALIGN=JUSTIFY>"; tag_close = "</P>"; }
         else if (!PL_strncasecmp ("FLUSHLEFT>", old, 10))
-        tag_open = "<P ALIGN=LEFT>", tag_close = "</P>";
+          { tag_open = "<P ALIGN=LEFT>"; tag_close = "</P>"; }
         else if (!PL_strncasecmp ("FLUSHRIGHT>", old, 11))
-        tag_open = "<P ALIGN=RIGHT>", tag_close = "</P>";
-        else if (!enriched_p &&
-             !PL_strncasecmp ("FOOTING>", old, 8))
-        tag_open = "<H6>", tag_close = "</H6>";
+          { tag_open = "<P ALIGN=RIGHT>"; tag_close = "</P>"; }
+        else if (!enriched_p && !PL_strncasecmp ("FOOTING>", old, 8))
+          { tag_open = "<H6>"; tag_close = "</H6>"; }
         break;
-      case 'h': case 'H':
-        if (!enriched_p &&
-          !PL_strncasecmp ("HEADING>", old, 8))
-        tag_open = "<H6>", tag_close = "</H6>";
+
+      case 'h':
+      case 'H':
+        if (!enriched_p && !PL_strncasecmp ("HEADING>", old, 8))
+          { tag_open = "<H6>"; tag_close = "</H6>"; }
         break;
-      case 'i': case 'I':
+
+      case 'i':
+      case 'I':
         if (!PL_strncasecmp ("INDENT>", old, 7))
-        tag_open = "<UL>", tag_close = "</UL>";
+          { tag_open = "<UL>"; tag_close = "</UL>"; }
         else if (!PL_strncasecmp ("INDENTRIGHT>", old, 12))
-        tag_open = 0, tag_close = 0;
-/*        else if (!enriched_p &&
-               !PL_strncasecmp ("ISO-8859-", old, 9))
-        tag_open = 0, tag_close = 0; */
+          { tag_open = 0; tag_close = 0; }
         else if (!PL_strncasecmp ("ITALIC>", old, 7))
-        tag_open = "<I>", tag_close = "</I>";
-        break;
-      case 'l': case 'L':
-        if (!enriched_p &&
-          !PL_strncasecmp ("LT>", old, 3))
-        tag_open = "&lt;", tag_close = 0;
+          { tag_open = "<I>"; tag_close = "</I>"; }
         break;
-      case 'n': case 'N':
-        if (!enriched_p &&
-          !PL_strncasecmp ("NL>", old, 3))
-        tag_open = "<BR>", tag_close = 0;
-        if (enriched_p &&
-          !PL_strncasecmp ("NOFILL>", old, 7))
-        tag_open = "<NOBR>", tag_close = "</NOBR>";
-/*        else if (!enriched_p &&
-               !PL_strncasecmp ("NO-OP>", old, 6))
-        tag_open = 0, tag_close = 0; */
-/*        else if (!enriched_p &&
-               !PL_strncasecmp ("NP>", old, 3))
-        tag_open = 0, tag_close = 0; */
+
+      case 'l':
+      case 'L':
+        if (!enriched_p && !PL_strncasecmp ("LT>", old, 3))
+          { tag_open = "&lt;"; tag_close = 0; }
         break;
-      case 'o': case 'O':
-        if (!enriched_p &&
-          !PL_strncasecmp ("OUTDENT>", old, 8))
-        tag_open = 0, tag_close = 0;
-        else if (!enriched_p &&
-             !PL_strncasecmp ("OUTDENTRIGHT>", old, 13))
-        tag_open = 0, tag_close = 0;
+
+      case 'n':
+      case 'N':
+        if (!enriched_p && !PL_strncasecmp ("NL>", old, 3))
+          { tag_open = "<BR>"; tag_close = 0; }
+        if (enriched_p && !PL_strncasecmp ("NOFILL>", old, 7))
+          { tag_open = "<NOBR>"; tag_close = "</NOBR>"; }
+        break;
+
+      case 'o':
+      case 'O':
+        if (!enriched_p && !PL_strncasecmp ("OUTDENT>", old, 8))
+          { tag_open = 0; tag_close = 0; }
+        else if (!enriched_p && !PL_strncasecmp ("OUTDENTRIGHT>", old, 13))
+          { tag_open = 0; tag_close = 0; }
         break;
-      case 'p': case 'P':
-        if (enriched_p &&
-          !PL_strncasecmp ("PARAM>", old, 6))
-        tag_open = "<!-- ", tag_close = " -->";
-        else if (!enriched_p &&
-             !PL_strncasecmp ("PARAGRAPH>", old, 10))
-        tag_open = "<P>", tag_close = 0;
+
+      case 'p':
+      case 'P':
+        if (enriched_p && !PL_strncasecmp ("PARAM>", old, 6))
+          { tag_open = "<!-- "; tag_close = " -->"; }
+        else if (!enriched_p && !PL_strncasecmp ("PARAGRAPH>", old, 10))
+          { tag_open = "<P>"; tag_close = 0; }
         break;
-      case 's': case 'S':
-        if (!enriched_p &&
-          !PL_strncasecmp ("SAMEPAGE>", old, 9))
-        tag_open = 0, tag_close = 0;
-        else if (!enriched_p &&
-             !PL_strncasecmp ("SIGNATURE>", old, 10))
-        tag_open = "<I><FONT SIZE=\"-1\">", tag_close = "</FONT></I>";
+
+      case 's':
+      case 'S':
+        if (!enriched_p && !PL_strncasecmp ("SAMEPAGE>", old, 9))
+          { tag_open = 0; tag_close = 0; }
+        else if (!enriched_p && !PL_strncasecmp ("SIGNATURE>", old, 10))
+          { tag_open = "<I><FONT SIZE=\"-1\">"; tag_close = "</FONT></I>"; }
         else if (!PL_strncasecmp ("SMALLER>", old, 8))
-        tag_open = "<FONT SIZE=\"-1\">", tag_close = "</FONT>";
-        else if (!enriched_p &&
-             !PL_strncasecmp ("SUBSCRIPT>", old, 10))
-        tag_open = "<SUB>", tag_close = "</SUB>";
-        else if (!enriched_p &&
-             !PL_strncasecmp ("SUPERSCRIPT>", old, 12))
-        tag_open = "<SUP>", tag_close = "</SUP>";
+          { tag_open = "<FONT SIZE=\"-1\">"; tag_close = "</FONT>"; }
+        else if (!enriched_p && !PL_strncasecmp ("SUBSCRIPT>", old, 10))
+          { tag_open = "<SUB>"; tag_close = "</SUB>"; }
+        else if (!enriched_p && !PL_strncasecmp ("SUPERSCRIPT>", old, 12))
+          { tag_open = "<SUP>"; tag_close = "</SUP>"; }
         break;
-      case 'u': case 'U':
+
+      case 'u':
+      case 'U':
         if (!PL_strncasecmp ("UNDERLINE>", old, 10))
-        tag_open = "<U>", tag_close = "</U>";
-/*        else if (!enriched_p &&
-             !PL_strncasecmp ("US-ASCII>", old, 10))
-        tag_open = 0, tag_close = 0; */
+          { tag_open = "<U>"; tag_close = "</U>"; }
         break;
-      case 'v': case 'V':
-        if (enriched_p &&
-          !PL_strncasecmp ("VERBATIM>", old, 9))
-        tag_open = "<PRE>", tag_close = "</PRE>";
+
+      case 'v':
+      case 'V':
+        if (enriched_p && !PL_strncasecmp ("VERBATIM>", old, 9))
+          { tag_open = "<PRE>"; tag_close = "</PRE>"; }
         break;
       }
 
       if (this_start[1] == '/')
       {
         if (tag_close) PL_strncpyz (out, tag_close, outlen);
         addedlen = strlen (out);
         outlen -= addedlen;
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -231,18 +231,17 @@ const char *const stateLabels[] = {
 ///////////////////////////////////////////////////////////////////////////////////////////
 #define NET_IS_SPACE(x) ((x)==' ' || (x)=='\t')
 
 // turn "\xx" (with xx being hex numbers) in string into chars
 char *MSG_UnEscapeSearchUrl (const char *commandSpecificData)
 {
   nsAutoCString result(commandSpecificData);
   int32_t slashpos = 0;
-  while (slashpos = result.FindChar('\\', slashpos),
-         slashpos != kNotFound)
+  while ((slashpos = result.FindChar('\\', slashpos)) != kNotFound)
   {
     nsAutoCString hex;
     hex.Assign(Substring(result, slashpos + 1, 2));
     int32_t ch;
     nsresult rv;
     ch = hex.ToInteger(&rv, 16);
     result.Replace(slashpos, 3, NS_SUCCEEDED(rv) && ch != 0 ? (char) ch : 'X');
     slashpos++;