Bug 473530 - PRBool violations after landing of bug 441782; r,sr=roc
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Thu, 15 Jan 2009 11:24:44 +0330
changeset 23737 a1f3caa94673bbee6663e27643fa71d175bc9873
parent 23736 0c5fb2ad3414147fae7c81da9de5156e20226899
child 23738 a7f7ec7f347cb39b47977f8a3a259277bb96ba3b
push id4691
push userehsan.akhgari@gmail.com
push dateThu, 15 Jan 2009 07:55:36 +0000
treeherdermozilla-central@a1f3caa94673 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs473530, 441782
milestone1.9.2a1pre
Bug 473530 - PRBool violations after landing of bug 441782; r,sr=roc
gfx/thebes/src/gfxTextRunWordCache.cpp
intl/unicharutil/util/nsBidiUtils.cpp
--- a/gfx/thebes/src/gfxTextRunWordCache.cpp
+++ b/gfx/thebes/src/gfxTextRunWordCache.cpp
@@ -596,35 +596,35 @@ TextRunWordCache::MakeTextRun(const PRUn
     PRUint32 hash = 0;
     PRBool seenDigitToModify = PR_FALSE;
     PRBool needsNumeralProcessing =
         mBidiNumeral != IBMBIDI_NUMERAL_NOMINAL;
     for (i = 0; i <= aLength; ++i) {
         PRUnichar ch = i < aLength ? aText[i] : ' ';
         if (!seenDigitToModify && needsNumeralProcessing) {
             // check if there is a digit that needs to be transformed
-            if (HandleNumberInChar(ch, i > 0 ?
+            if (HandleNumberInChar(ch, !!(i > 0 ?
                                        IS_ARABIC_CHAR(aText[i-1]) :
-                                       (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR),
+                                       (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR)),
                                    mBidiNumeral) != ch)
                 seenDigitToModify = PR_TRUE;
         }
         if (IsWordBoundary(ch)) {
             if (seenDigitToModify) {
                 // the word included at least one digit that is modified by the current
                 // bidi.numerals setting, so we must not use the cache for this word;
                 // instead, we'll create a new textRun and a DeferredWord entry pointing to it
                 PRUint32 length = i - wordStart;
                 nsAutoPtr<PRUnichar> numString;
                 numString = new PRUnichar[length];
                 for (PRUint32 j = 0; j < length; ++j) {
                     numString[j] = HandleNumberInChar(aText[wordStart+j],
-                                                      wordStart+j > 0 ?
+                                                      !!(wordStart+j > 0 ?
                                                           IS_ARABIC_CHAR(numString[j-1]) :
-                                                          (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR),
+                                                          (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR)),
                                                       mBidiNumeral);
                 }
                 // now we make a transient textRun for the transformed word; this will not be cached
                 gfxTextRun *numRun;
                 numRun =
                     aFontGroup->MakeTextRun(numString.get(), length, aParams,
                                             aFlags & ~(gfxTextRunFactory::TEXT_IS_PERSISTENT |
                                                        gfxTextRunFactory::TEXT_IS_8BIT));
@@ -732,19 +732,19 @@ TextRunWordCache::MakeTextRun(const PRUi
         if (IsWordBoundary(ch)) {
             if (seenDigitToModify) {
                 // see parallel code in the 16-bit method above
                 PRUint32 length = i - wordStart;
                 nsAutoPtr<PRUnichar> numString;
                 numString = new PRUnichar[length];
                 for (PRUint32 j = 0; j < length; ++j) {
                     numString[j] = HandleNumberInChar(aText[wordStart+j],
-                                                      wordStart+j > 0 ?
+                                                      !!(wordStart+j > 0 ?
                                                           IS_ARABIC_CHAR(numString[j-1]) :
-                                                          (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR),
+                                                          (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR)),
                                                       mBidiNumeral);
                 }
                 // now we make a transient textRun for the transformed word; this will not be cached
                 gfxTextRun *numRun;
                 numRun =
                     aFontGroup->MakeTextRun(numString.get(), length, aParams,
                                             aFlags & ~(gfxTextRunFactory::TEXT_IS_PERSISTENT |
                                                        gfxTextRunFactory::TEXT_IS_8BIT));
--- a/intl/unicharutil/util/nsBidiUtils.cpp
+++ b/intl/unicharutil/util/nsBidiUtils.cpp
@@ -579,17 +579,17 @@ nsresult HandleNumbers(PRUnichar* aBuffe
   PRUint32 i;
 
   switch (aNumFlag) {
     case IBMBIDI_NUMERAL_HINDI:
     case IBMBIDI_NUMERAL_ARABIC:
     case IBMBIDI_NUMERAL_REGULAR:
     case IBMBIDI_NUMERAL_HINDICONTEXT:
       for (i=0;i<aSize;i++)
-        aBuffer[i] = HandleNumberInChar(aBuffer[i], i>0 ? aBuffer[i-1] : 0, aNumFlag);
+        aBuffer[i] = HandleNumberInChar(aBuffer[i], !!(i>0 ? aBuffer[i-1] : 0), aNumFlag);
       break;
     case IBMBIDI_NUMERAL_NOMINAL:
     default:
       break;
   }
   return NS_OK;
 }