Commit 45ad5ab2 authored by Chris Peterson's avatar Chris Peterson
Browse files

Bug 1356843 - Fix -Wcomma warning in extensions/spellcheck/src/mozSpellChecker.cpp. r=masayuki

clang's -Wcomma warning warns about suspicious use of the comma operator such as calling a function for side effects within an expression. Check NS_SUCCEEDED() to use HasMoreElement() in an expression and confirm that it actually returned a legitimate out parameter.

extensions/spellcheck/src/mozSpellChecker.cpp:532:54 [-Wcomma] possible misuse of comma operator here

MozReview-Commit-ID: 3GnKVvx8Nu4

--HG--
extra : rebase_source : 0ceaaad16e3d701e24029e431a9d577e9636d626
extra : source : ceb864752cc324d629118d44f22a01d9594b26fd
parent 064b9e32
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "mozSpellChecker.h"
#include "nsIServiceManager.h"
#include "mozISpellI18NManager.h"
@@ -552,7 +551,8 @@ mozSpellChecker::GetEngineList(nsCOMArray<mozISpellCheckingEngine>* aSpellChecki
  if (NS_FAILED(rv))
    return rv;

  while (catEntries->HasMoreElements(&hasMoreEngines), hasMoreEngines){
  while (NS_SUCCEEDED(catEntries->HasMoreElements(&hasMoreEngines)) &&
         hasMoreEngines) {
    nsCOMPtr<nsISupports> elem;
    rv = catEntries->GetNext(getter_AddRefs(elem));