b=597147 part 7: avoid some signed/unsigned comparisons r=jfkthame
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 08 Nov 2010 11:44:51 +1300
changeset 57266 1f8b0ef812227bbd6c27f01fe51e84ba258773ed
parent 57265 ddba4d6b177df76198e045318402f5898c9b5669
child 57267 38776ca9e076ba0c13dc8232c6e3612c59a9219d
push id16852
push userktomlinson@mozilla.com
push dateWed, 10 Nov 2010 20:06:29 +0000
treeherdermozilla-central@85b93f3ea9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs597147
milestone2.0b8pre
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
b=597147 part 7: avoid some signed/unsigned comparisons r=jfkthame
gfx/thebes/gfxHarfBuzzShaper.cpp
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -208,17 +208,17 @@ gfxHarfBuzzShaper::GetGlyphMetrics(gfxCo
     }
 
     // font did not implement GetHintedGlyphWidth, so get an unhinted value
     // directly from the font tables
 
     NS_ASSERTION((mNumLongMetrics > 0) && mHmtxTable != nsnull,
                  "font is lacking metrics, we shouldn't be here");
 
-    if (glyph >= mNumLongMetrics) {
+    if (glyph >= PRUint32(mNumLongMetrics)) {
         glyph = mNumLongMetrics - 1;
     }
 
     // glyph must be valid now, because we checked during initialization
     // that mNumLongMetrics is > 0, and that the hmtx table is large enough
     // to contain mNumLongMetrics records
     const HMetrics* hmtx =
         reinterpret_cast<const HMetrics*>(hb_blob_lock(mHmtxTable));
@@ -896,17 +896,17 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxC
         return NS_ERROR_OUT_OF_MEMORY;
 
     PRInt32 *charToGlyph = charToGlyphArray.Elements();
     for (PRUint32 offset = 0; offset < aRunLength; ++offset) {
         charToGlyph[offset] = NO_GLYPH;
     }
 
     for (PRInt32 i = 0; i < numGlyphs; ++i) {
-        PRInt32 loc = ginfo[i].cluster;
+        PRUint32 loc = ginfo[i].cluster;
         if (loc < aRunLength) {
             charToGlyph[loc] = i;
         }
     }
 
     PRInt32 glyphStart = 0; // looking for a clump that starts at this glyph
     PRInt32 charStart = 0; // and this char index within the range of the run