diff --git a/gfx/src/gtk/nsFontMetricsGTK.cpp b/gfx/src/gtk/nsFontMetricsGTK.cpp index 5e1163ee932..cd57245aa8c 100644 --- a/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -137,8 +137,8 @@ struct nsFontFamily struct nsFontFamilyName { - char* mName; - char* mXName; + const char* mName; + const char* mXName; }; struct nsFontPropertyName @@ -1045,7 +1045,7 @@ InitGlobals(nsIDeviceContext *aDevice) nsFontFamilyName* f = gFamilyNameTable; while (f->mName) { nsCStringKey key(f->mName); - gAliases->Put(&key, f->mXName); + gAliases->Put(&key, (void *)f->mXName); f++; } gWeights = new nsHashtable(); @@ -3174,11 +3174,13 @@ nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch* aStretch, return AddToLoadedFontsList(font); } +PR_BEGIN_EXTERN_C static int CompareSizes(const void* aArg1, const void* aArg2, void *data) { return (*((nsFontGTK**) aArg1))->mSize - (*((nsFontGTK**) aArg2))->mSize; } +PR_END_EXTERN_C void nsFontStretch::SortSizes(void) @@ -4953,6 +4955,7 @@ EnumerateNode(void* aElement, void* aData) return PR_TRUE; // continue } +PR_BEGIN_EXTERN_C static int CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) { @@ -4963,6 +4966,7 @@ CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) return nsCRT::strcmp(str1, str2); } +PR_END_EXTERN_C static nsresult EnumFonts(nsIAtom* aLangGroup, const char* aGeneric, PRUint32* aCount, diff --git a/gfx/src/xlib/nsFontMetricsXlib.cpp b/gfx/src/xlib/nsFontMetricsXlib.cpp index cfcefc4f4bf..3e7298f58a0 100644 --- a/gfx/src/xlib/nsFontMetricsXlib.cpp +++ b/gfx/src/xlib/nsFontMetricsXlib.cpp @@ -110,7 +110,9 @@ static PRLogModuleInfo *FontMetricsXlibLM = PR_NewLogModule("FontMetricsXlib"); /* Local prototypes */ static PRBool FreeNode(nsHashKey* aKey, void* aData, void* aClosure); +#ifdef USE_FREETYPE static void CharSetNameToCodeRangeBits(const char*, PRUint32*, PRUint32*); +#endif /* USE_FREETYPE */ static nsFontCharSetMapXlib *GetCharSetMap(const char *aCharSetName); // the font catalog is so expensive to generate @@ -222,14 +224,16 @@ static PRInt32 gBitmapScaleMinimum = 10; static double gBitmapOversize = 1.2; static double gBitmapUndersize = 0.8; +#ifdef USE_AASB static PRInt32 gAntiAliasMinimum = 8; +#endif /* USE_AASB */ static PRInt32 gEmbeddedBitmapMaximumHeight = 1000000; -#ifdef USE_FREETYOE +#ifdef USE_FREETYPE static PRBool gEnableFreeType2 = PR_TRUE; static PRBool gFreeType2Autohinted = PR_FALSE; static PRBool gFreeType2Unhinted = PR_TRUE; -#endif /* USE_FREETYOE */ +#endif /* USE_FREETYPE */ #ifdef USE_AASB static PRUint8 gAATTDarkTextMinValue = 64; static double gAATTDarkTextGain = 0.8; @@ -3262,7 +3266,9 @@ nsFontMetricsXlib::PickASizeAndLoad(nsFontStretchXlib* aStretch, PRBool use_scaled_font = PR_FALSE; PRBool have_nearly_rightsized_bitmap = PR_FALSE; +#ifdef USE_AASB nsFontXlib *base_aafont = nsnull; +#endif /* USE_AASB */ #ifdef USE_XPRINT #define ALWAYS_USE_SCALED_FONTS_FOR_XPRINT 1 @@ -3463,11 +3469,13 @@ nsFontMetricsXlib::PickASizeAndLoad(nsFontStretchXlib* aStretch, return AddToLoadedFontsList(font); } +PR_BEGIN_EXTERN_C static int CompareSizes(const void* aArg1, const void* aArg2, void *data) { return (*((nsFontXlib**) aArg1))->mSize - (*((nsFontXlib**) aArg2))->mSize; } +PR_END_EXTERN_C void nsFontStretchXlib::SortSizes(void) @@ -5340,6 +5348,7 @@ EnumerateNode(void* aElement, void* aData) return PR_TRUE; // continue } +PR_BEGIN_EXTERN_C static int CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) { @@ -5350,6 +5359,7 @@ CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) return nsCRT::strcmp(str1, str2); } +PR_END_EXTERN_C static nsresult EnumFonts(nsIAtom* aLangGroup, const char* aGeneric, PRUint32* aCount, @@ -5441,6 +5451,7 @@ nsFontCharSetMapXlib *GetCharSetMap(const char *aCharSetName) return charSetMap; } +#ifdef USE_FREETYPE static void CharSetNameToCodeRangeBits(const char *aCharset, PRUint32 *aCodeRange1, PRUint32 *aCodeRange2) @@ -5451,4 +5462,5 @@ void CharSetNameToCodeRangeBits(const char *aCharset, *aCodeRange1 = charSetInfo->mCodeRange1Bits; *aCodeRange2 = charSetInfo->mCodeRange2Bits; } +#endif /* USE_FREETYPE */ diff --git a/gfx/src/xlib/nsRenderingContextXlib.cpp b/gfx/src/xlib/nsRenderingContextXlib.cpp index 4303647df02..7534f8ee891 100644 --- a/gfx/src/xlib/nsRenderingContextXlib.cpp +++ b/gfx/src/xlib/nsRenderingContextXlib.cpp @@ -440,7 +440,6 @@ nsRenderingContextXlib::SetClipRect(const nsRect& aRect, nsClipCombine aCombine, { PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::SetClipRect()\n")); nsRect trect = aRect; - Region rgn; mTranMatrix->TransformCoord(&trect.x, &trect.y, &trect.width, &trect.height); switch(aCombine) { @@ -482,7 +481,6 @@ NS_IMETHODIMP nsRenderingContextXlib::SetClipRegion(const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipState) { PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::SetClipRegion()\n")); - Region rgn; switch(aCombine) { case nsClipCombine_kIntersect: diff --git a/gfx/src/xlibrgb/xlibrgb.c b/gfx/src/xlibrgb/xlibrgb.c index 0a14468f8aa..ff21e6732e6 100644 --- a/gfx/src/xlibrgb/xlibrgb.c +++ b/gfx/src/xlibrgb/xlibrgb.c @@ -3973,8 +3973,7 @@ xxlib_rgb_ditherable (XlibRgbHandle *handle) Colormap xxlib_rgb_get_cmap (XlibRgbHandle *handle) { - /* xxlib_rgb_init (); */ - return (handle)?(handle->cmap):(NULL); + return (handle)?(handle->cmap):(None); } Visual * @@ -4084,7 +4083,7 @@ Bool xxlib_register_handle(const char *name, XlibRgbHandle *handle) Bool xxlib_deregister_handle(const char *name) { RegisteredHandle *entry; - if (entry = xxlib_find_registered_handle(name)) + if ((entry = xxlib_find_registered_handle(name)) != NULL) { free((void *)entry->name); entry->name = NULL; diff --git a/gfx/src/xprint/nsXPrintContext.cpp b/gfx/src/xprint/nsXPrintContext.cpp index 0159dd0ac7c..9b6436a319e 100644 --- a/gfx/src/xprint/nsXPrintContext.cpp +++ b/gfx/src/xprint/nsXPrintContext.cpp @@ -389,7 +389,7 @@ nsresult nsXPrintContext::SetMediumSize(const char *aPaperName) char *s; /* Did we get a tray name and paper name (e.g. "manual/din-a4") ? */ - if (s = strchr(paper_name, '/')) + if ((s = strchr(paper_name, '/')) != nsnull) { const char *tray_name; *s = '\0'; diff --git a/gfx/src/xprint/xprintutil.c b/gfx/src/xprint/xprintutil.c index 5e9ab0011d1..b2cdd3499c0 100644 --- a/gfx/src/xprint/xprintutil.c +++ b/gfx/src/xprint/xprintutil.c @@ -787,7 +787,7 @@ XPPrinterList XpuGetPrinterList( const char *printer, int *res_list_count ) { Display *pdpy; - if( pdpy = XOpenDisplay(display) ) + if( (pdpy = XOpenDisplay(display)) != NULL ) { XPPrinterList list; int list_count; diff --git a/gfx/src/xprint/xprintutil_printtofile.c b/gfx/src/xprint/xprintutil_printtofile.c index 0a0e63d82ab..c181e0eab5c 100644 --- a/gfx/src/xprint/xprintutil_printtofile.c +++ b/gfx/src/xprint/xprintutil_printtofile.c @@ -44,14 +44,12 @@ #include #else #include -#endif -#else -#ifdef __sun -#include -#endif /* __sun */ +#endif /* XPU_USE_NSPR */ #endif /* XPU_USE_THREADS */ #include #include +#include +#include /* local prototypes */ #ifdef DEBUG