From 1ac30947f4a222ba78558eddf8e5f03cec31f613 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 10:35:18 -0700 Subject: [PATCH 01/12] fix compiler warnings in Xprint/ps/PsWindow.c --- Xprint/ps/PsWindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xprint/ps/PsWindow.c b/Xprint/ps/PsWindow.c index 313e51f31..415e97efb 100644 --- a/Xprint/ps/PsWindow.c +++ b/Xprint/ps/PsWindow.c @@ -96,6 +96,7 @@ extern WindowPtr *WindowTable; * placed on the screen's root window if the property was defined in * the start-up configuration resource database. */ +#if 0 static char *propStrings[] = { DT_PRINT_JOB_HEADER, DT_PRINT_JOB_TRAILER, @@ -107,7 +108,7 @@ static char *propStrings[] = { DT_PRINT_PAGE_COMMAND, (char *)NULL }; - +#endif /* * PsCreateWindow - watch for the creation of the root window. @@ -222,7 +223,6 @@ PsPaintWindow( RegionPtr pRegion, int what) { - int status; WindowPtr pRoot; #define FUNCTION 0 From 35fccb0068e8d73d1e6a16aefdc771506e620f83 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 10:40:24 -0700 Subject: [PATCH 02/12] remove some compiler warnings in Xprint/ps/PsText.c Note that one of the existing warnings is pointing out a real bug (uninitialized use for fontPage in PsPolyText16()) if anyone really cares about this code. --- Xprint/ps/PsText.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Xprint/ps/PsText.c b/Xprint/ps/PsText.c index 228e407dc..37463ba1a 100644 --- a/Xprint/ps/PsText.c +++ b/Xprint/ps/PsText.c @@ -329,11 +329,7 @@ PsPolyText16( { PsOutPtr psOut; ColormapPtr cMap; - unsigned short c, - c_hiByte, - c_lowByte, - fontPage; - int i; + unsigned short fontPage; if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return x; From 511b231ded61159ebd70cab020ca1ca003fd0784 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 10:41:34 -0700 Subject: [PATCH 03/12] fix compiler warnings in Xprint/ps/PsPrint.c --- Xprint/ps/PsPrint.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/Xprint/ps/PsPrint.c b/Xprint/ps/PsPrint.c index 05e8e2588..8a4f0ade8 100644 --- a/Xprint/ps/PsPrint.c +++ b/Xprint/ps/PsPrint.c @@ -292,13 +292,10 @@ PsStartPage( { int iorient, iplex, icount, ires; unsigned short iwd, iht; - register WindowPtr pChild; PsContextPrivPtr pConPriv = (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr; PsWindowPrivPtr pWinPriv = (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr; - char s[80]; - xEvent event; /* * Put a pointer to the context in the window private structure From aef092e0290143c2b8b1cb98fdf55c9630032aaf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 10:53:17 -0700 Subject: [PATCH 04/12] fix compiler warnings in Xprint/ps/PsPolygon.c --- Xprint/ps/PsPolygon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Xprint/ps/PsPolygon.c b/Xprint/ps/PsPolygon.c index a1ae67f8d..c4c30bc79 100644 --- a/Xprint/ps/PsPolygon.c +++ b/Xprint/ps/PsPolygon.c @@ -215,8 +215,6 @@ PsPolyFillRect( */ if (nRects == 1) { - extern Bool noDbeExtension; - if ( (pRects[0].x==0) && (pRects[0].y==0) && (pRects[0].width==pDrawable->width) && (pRects[0].height==pDrawable->height) && (pGC->fillStyle == FillSolid) && @@ -227,7 +225,7 @@ PsPolyFillRect( #endif /* DEBUG_gismobile */ /* Remove all content from the pixmap as it would be covered * by the whole rect anyway */ - PsScrubPixmap(pDrawable); + PsScrubPixmap((PixmapPtr)pDrawable); } } #endif /* DBE */ From 2dc291384c550badf55542ae645240e166676848 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:04:40 -0700 Subject: [PATCH 05/12] fixed compiler warnings in Xprint/ps/PsPixmap.c --- Xprint/ps/Ps.h | 1 + Xprint/ps/PsPixmap.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Xprint/ps/Ps.h b/Xprint/ps/Ps.h index 781161d8a..576c3b24e 100644 --- a/Xprint/ps/Ps.h +++ b/Xprint/ps/Ps.h @@ -569,6 +569,7 @@ extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height, extern void PsScrubPixmap(PixmapPtr pPixmap); extern Bool PsDestroyPixmap(PixmapPtr pPixmap); extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv); +extern void PsReplay(DisplayElmPtr elm, DrawablePtr pDrawable); extern void PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable); extern int PsCloneDisplayElm(PixmapPtr dst, DisplayElmPtr elm, DisplayElmPtr newElm, diff --git a/Xprint/ps/PsPixmap.c b/Xprint/ps/PsPixmap.c index a698b375e..f2d05d023 100644 --- a/Xprint/ps/PsPixmap.c +++ b/Xprint/ps/PsPixmap.c @@ -191,7 +191,6 @@ Bool PsDestroyPixmap(PixmapPtr pPixmap) { PsPixmapPrivPtr priv = (PsPixmapPrivPtr)pPixmap->devPrivate.ptr; - DisplayListPtr disp = priv->dispList; if( --pPixmap->refcnt ) return TRUE; @@ -512,6 +511,8 @@ PsCreateFillElementList(PixmapPtr pix, int *nElms) case PolyFillArcCmd: *nElms += elm->c.arcs.nArcs; break; + default: /* keep the compiler happy with unhandled enums */ + break; } } } @@ -574,6 +575,8 @@ PsCreateFillElementList(PixmapPtr pix, int *nElms) *nElms += 1; } break; + default: /* keep the compiler happy with unhandled enums */ + break; } } } From 1abc7f96edf37a1e2c766b9cdba7fc9b2cb06d19 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:06:51 -0700 Subject: [PATCH 06/12] fix compiler warnings in Xprint/ps/PsInit.c --- Xprint/ps/PsInit.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Xprint/ps/PsInit.c b/Xprint/ps/PsInit.c index e663fa3a3..06c5d11a8 100644 --- a/Xprint/ps/PsInit.c +++ b/Xprint/ps/PsInit.c @@ -119,8 +119,6 @@ InitializePsDriver(ndx, pScreen, argc, argv) int maxRes, maxDim, numBytes; PsScreenPrivPtr pPriv; #endif - char **printerNames; - int numPrinters; int nv, /* total number of visuals */ nv_1bit, /* number of 8bit visuals */ nv_8bit, /* number of 8bit visuals */ From cf6169f9e99e6e8ab264f284cfa13cb379b36207 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:09:56 -0700 Subject: [PATCH 07/12] fix compiler warnings in Xprint/ps/PsFonts.c --- Xprint/ps/PsFonts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Xprint/ps/PsFonts.c b/Xprint/ps/PsFonts.c index 515a31884..c4d5b03e2 100644 --- a/Xprint/ps/PsFonts.c +++ b/Xprint/ps/PsFonts.c @@ -286,9 +286,8 @@ char *getFontFilename(FontPtr pFont) const char *dlfnam; FILE *file; struct stat statb; - int count, i, status; char buf[512]; - char *front, *end, *fn; + char *front, *fn; char font_dir_fname[PATH_MAX], /* Full path of fonts.dir */ font_file_fname[PATH_MAX]; /* Name of font file (excluding path) */ @@ -592,7 +591,6 @@ PsFontTypeInfoRec *PsCreateFontTypeInfoRec(DrawablePtr pDrawable, FontPtr pFont) { char *dlfnam; PsFontTypeInfoRec *rec; - char *psname; if (!(dlfnam = PsGetFontName(pFont))) return NULL; From 92303d534a91cb0ea30e4cd0f639efd70b9739b4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:12:16 -0700 Subject: [PATCH 08/12] fix compiler warning in Xprint/ps/PsGC.c --- Xprint/ps/PsGC.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Xprint/ps/PsGC.c b/Xprint/ps/PsGC.c index 61a2a2813..ada0b8c65 100644 --- a/Xprint/ps/PsGC.c +++ b/Xprint/ps/PsGC.c @@ -181,7 +181,6 @@ PsContextPrivPtr PsGetPsContextPriv( DrawablePtr pDrawable ) { XpContextPtr pCon; - PsContextPrivPtr cPriv; switch(pDrawable->type) { From ee2bb4d1929e20436cf0e830ece02fe07db2d524 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:15:34 -0700 Subject: [PATCH 09/12] fix compiler warnings in Xprint/ps/PsArea.c --- Xprint/ps/Ps.h | 3 +++ Xprint/ps/PsArea.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Xprint/ps/Ps.h b/Xprint/ps/Ps.h index 576c3b24e..68c95f9c9 100644 --- a/Xprint/ps/Ps.h +++ b/Xprint/ps/Ps.h @@ -427,6 +427,9 @@ extern void PsSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc, extern void PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, int imageRes, char *pImage); +extern void PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, + int x, int y, int w, int h, int leftPad, + int format, int imageRes, char *pImage); extern void PsPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage); diff --git a/Xprint/ps/PsArea.c b/Xprint/ps/PsArea.c index 32a4d5cf4..bf6f8f42a 100644 --- a/Xprint/ps/PsArea.c +++ b/Xprint/ps/PsArea.c @@ -118,7 +118,6 @@ PsPutScaledImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, { int i, j; int r, c; - char *pt; PsOutPtr psOut; ColormapPtr cMap; int pageRes, sw, sh; @@ -230,7 +229,6 @@ PsPutScaledImageIM(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, { int i, j; int r, c; - char *pt; PsOutPtr psOut; ColormapPtr cMap; int pageRes, sw, sh; From ea24b5a25c2544f3b3de6480da125edb23a6b3a9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:22:01 -0700 Subject: [PATCH 10/12] add proper function prototypes for Xprint/ps/PsCache.c to Xprint/ps/Ps.h --- Xprint/ps/Ps.h | 8 ++++++++ Xprint/ps/PsCache.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Xprint/ps/Ps.h b/Xprint/ps/Ps.h index 68c95f9c9..4effc2066 100644 --- a/Xprint/ps/Ps.h +++ b/Xprint/ps/Ps.h @@ -356,6 +356,14 @@ extern Bool InitializePsDriver(int ndx, ScreenPtr pScreen, int argc, char **argv); extern XpContextPtr PsGetContextFromWindow(WindowPtr win); +/* + * Functions in PsCache.c + */ + +extern int PsBmIsImageCached(int gWidth, int gHeight, char *pBuffer); +extern int PsBmPutImageInCache(int gWidth, int gHeight, char *pBuffer); +extern void PsBmClearImageCache(void); + /* * Functions in PsPrint.c */ diff --git a/Xprint/ps/PsCache.c b/Xprint/ps/PsCache.c index e69aa2eb7..5c823a13e 100644 --- a/Xprint/ps/PsCache.c +++ b/Xprint/ps/PsCache.c @@ -317,7 +317,7 @@ PsBmClearImageCacheList( } void -PsBmClearImageCache() +PsBmClearImageCache(void) { PsBmClearImageCacheList(bm_cache); From c496a3b9c981dc079fcc6c0ac4db3aa912b3dcf1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:23:53 -0700 Subject: [PATCH 11/12] fix compiler warning in Xprint/ps/PsImageUtil.c --- Xprint/ps/PsImageUtil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Xprint/ps/PsImageUtil.c b/Xprint/ps/PsImageUtil.c index 282786564..f3052bebb 100644 --- a/Xprint/ps/PsImageUtil.c +++ b/Xprint/ps/PsImageUtil.c @@ -33,6 +33,7 @@ copyright holders. #include #endif +#include "Ps.h" #include "gcstruct.h" #include "windowstr.h" #include "servermd.h" From 3930da3f6209312dd0f10aba0b16ef45996a07fe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 8 Jun 2006 11:27:29 -0700 Subject: [PATCH 12/12] fix compiler warnings in Xprint/ps/psout.c --- Xprint/ps/psout.c | 8 ++++---- Xprint/ps/psout.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Xprint/ps/psout.c b/Xprint/ps/psout.c index 376feec03..d7f45b16c 100644 --- a/Xprint/ps/psout.c +++ b/Xprint/ps/psout.c @@ -683,7 +683,6 @@ void PsOut_EndFile(PsOutPtr self, int closeFile) { char coms[50]; - int i; if (!self) return; @@ -1592,7 +1591,8 @@ PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, PsFillEnum type, switch(type) { case PsTile: key[1] = 't'; break; case PsStip: key[1] = 's'; break; - case PsOpStip: key[1] = 'o'; break; } + case PsOpStip: key[1] = 'o'; break; + default: break; } S_OutTok(self, key, 0); S_OutTok(self, "db/PatternType 1 d/PaintType 1 d", 0); S_OutTok(self, "/TilingType 1 d/BBox[0 0", 0); @@ -1637,7 +1637,8 @@ PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type) switch(type) { case PsTile: key[0] = 't'; break; case PsStip: key[0] = 's'; break; - case PsOpStip: key[0] = 'o'; break; } + case PsOpStip: key[0] = 'o'; break; + default: break; } S_OutTok(self, key, 0); S_OutTok(self, "spt", 1); self->CurColor = PSOUTCOLOR_NOCOLOR; @@ -1663,7 +1664,6 @@ typedef enum PsDownfontFontType_ int PsOut_DownloadType1(PsOutPtr self, const char *auditmsg, const char *name, const char *fname) { - int i; int stt; char buf[256]; FILE *fp; diff --git a/Xprint/ps/psout.h b/Xprint/ps/psout.h index 8441d8d07..d998e2a09 100644 --- a/Xprint/ps/psout.h +++ b/Xprint/ps/psout.h @@ -267,6 +267,7 @@ extern void S_OutTok(PsOutPtr self, char *tok, int cr); typedef struct PsOutRec_ *PsOutPtr; #endif /* USE_PSOUT_PRIVATE */ +extern FILE * PsOut_ChangeFile(PsOutPtr self, FILE *fp); extern PsOutPtr PsOut_BeginFile(FILE *fp, char *title, int orient, int count, int plex, int res, int wd, int ht, Bool raw); extern void PsOut_EndFile(PsOutPtr self, int closeFile);