From a288a80eac2766498c3e7a62daf12bf68c9ae3d5 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 24 Feb 2010 11:50:11 -0800 Subject: [PATCH] Bug 547714. Fix compilation failure on gcc 4.5, r=roc --HG-- extra : rebase_source : 9836c306e1087b45809cac39ed79262c285cb966 --- widget/src/windows/nsDeviceContextSpecWin.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/widget/src/windows/nsDeviceContextSpecWin.cpp b/widget/src/windows/nsDeviceContextSpecWin.cpp index ac336168a267..7b0ff646bd29 100644 --- a/widget/src/windows/nsDeviceContextSpecWin.cpp +++ b/widget/src/windows/nsDeviceContextSpecWin.cpp @@ -460,9 +460,6 @@ NS_IMETHODIMP nsDeviceContextSpecWin::Init(nsIWidget* aWidget, PR_PL(("***** nsDeviceContextSpecWin::Init - aPrintSettingswas NULL!\n")); } - LPDEVMODEW pDevMode = NULL; - HGLOBAL hDevNames = NULL; - // Get the Print Name to be used PRUnichar * printerName = nsnull; if (mPrintSettings) { @@ -601,7 +598,6 @@ MapPaperSizeToNativeEnum(LPDEVMODEW aDevMode, BOOL doingPaperWidth = aDevMode->dmFields & DM_PAPERWIDTH; #endif - PRBool foundEnum = PR_FALSE; for (PRInt32 i=0;idmPaperSize = kPaperSizes[i].mPaperSize; @@ -960,7 +956,7 @@ void GlobalPrinters::FreeGlobalPrinters() { if (mPrinters != nsnull) { - for (int i=0;iLength();i++) { + for (unsigned int i=0;iLength();i++) { free(mPrinters->ElementAt(i)); } delete mPrinters; @@ -987,7 +983,7 @@ GlobalPrinters::EnumerateNativePrinters() LPWSTR ePtr = szDefaultPrinterName + status; LPWSTR prvPtr = sPtr; while (sPtr < ePtr) { - if (*sPtr == NULL) { + if (*sPtr == 0) { LPWSTR name = wcsdup(prvPtr); mPrinters->AppendElement(name); PR_PL(("Printer Name: %s\n", prvPtr)); @@ -1017,7 +1013,7 @@ GlobalPrinters::GetDefaultPrinterName(nsString& aDefaultPrinterName) if (status > 0) { WCHAR comma = ','; LPWSTR sPtr = szDefaultPrinterName; - while (*sPtr != comma && *sPtr != NULL) + while (*sPtr != comma && *sPtr != 0) sPtr++; if (*sPtr == comma) { *sPtr = NULL; @@ -1027,7 +1023,7 @@ GlobalPrinters::GetDefaultPrinterName(nsString& aDefaultPrinterName) aDefaultPrinterName = NS_LITERAL_STRING(""); } - PR_PL(("DEFAULT PRINTER [%s]\n", aDefaultPrinterName)); + PR_PL(("DEFAULT PRINTER [%s]\n", aDefaultPrinterName.get())); #else aDefaultPrinterName = NS_LITERAL_STRING("UNKNOWN"); #endif @@ -1054,7 +1050,7 @@ GlobalPrinters::EnumeratePrinterList() // put the default printer at the beginning of list if (!defPrinterName.IsEmpty()) { - for (PRInt32 i=0;iLength();i++) { + for (PRUint32 i=0;iLength();i++) { LPWSTR name = mPrinters->ElementAt(i); if (defPrinterName.Equals(name)) { if (i > 0) {