Bug 797316 - Fix -Werror=conversion-null errors in Windows-only code (gfx/thebes part) r=jmuizelaar
authorJacek Caban <jacek@codeweavers.com>
Thu, 04 Oct 2012 10:35:15 +0200
changeset 115530 1415aa5411b1355700b80f3728ee1503abf455eb
parent 115529 bd36f348362baf804d4382210b2fa4aa314dcd84
child 115531 3ce909bed24a824050f69bc0649c71309fae1767
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar
bugs797316
milestone18.0a1
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
Bug 797316 - Fix -Werror=conversion-null errors in Windows-only code (gfx/thebes part) r=jmuizelaar
gfx/thebes/gfxGDIFontList.cpp
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -104,17 +104,17 @@ public:
 #if DEBUG
             if (err != E_NONE) {
                 char buf[256];
                 sprintf(buf, "error deleting embedded font handle (%p) - TTDeleteEmbeddedFont returned %8.8x", mFontRef, err);
                 NS_ASSERTION(err == E_NONE, buf);
             }
 #endif
         } else {
-            BOOL success;
+            DebugOnly<BOOL> success;
             success = RemoveFontMemResourceEx(mFontRef);
 #if DEBUG
             if (!success) {
                 char buf[256];
                 sprintf(buf, "error deleting font handle (%p) - RemoveFontMemResourceEx failed", mFontRef);
                 NS_ASSERTION(success, buf);
             }
 #endif
@@ -274,18 +274,18 @@ GDIFontEntry::GetFontTable(uint32_t aTab
 {
     if (!IsTrueType()) {
         return NS_ERROR_FAILURE;
     }
 
     AutoDC dc;
     AutoSelectFont font(dc.GetDC(), &mLogFont);
     if (font.IsValid()) {
-        int32_t tableSize =
-            ::GetFontData(dc.GetDC(), NS_SWAP32(aTableTag), 0, NULL, NULL);
+        uint32_t tableSize =
+            ::GetFontData(dc.GetDC(), NS_SWAP32(aTableTag), 0, NULL, 0);
         if (tableSize != GDI_ERROR) {
             if (aBuffer.SetLength(tableSize)) {
                 ::GetFontData(dc.GetDC(), NS_SWAP32(aTableTag), 0,
                               aBuffer.Elements(), tableSize);
                 return NS_OK;
             }
             return NS_ERROR_OUT_OF_MEMORY;
         }
@@ -328,17 +328,17 @@ GDIFontEntry::FillLogFont(LOGFONTW *aLog
 
 #define MISSING_GLYPH 0x1F // glyph index returned for missing characters
                            // on WinXP with .fon fonts, but not Type1 (.pfb)
 
 bool 
 GDIFontEntry::TestCharacterMap(uint32_t aCh)
 {
     if (!mCharacterMap) {
-        nsresult rv = ReadCMAP();
+        ReadCMAP();
         NS_ASSERTION(mCharacterMap, "failed to initialize a character map");
     }
 
     if (mCharacterMap->mBuildOnTheFly) {
         if (aCh > 0xFFFF)
             return false;
 
         // previous code was using the group style