Index: Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/Init.c,v retrieving revision 1.1.4.4 diff -u -r1.1.4.4 Init.c --- a/Init.c 21 Apr 2004 10:03:35 -0000 1.1.4.4 +++ b/Init.c 25 Apr 2004 21:40:28 -0000 @@ -279,10 +279,6 @@ static const char printServerConfigDir[] = "XPSERVERCONFIGDIR"; -static int printScreenPrivIndex, - printWindowPrivIndex, - printGCPrivIndex; -static unsigned long printGeneration = 0; static char *configFileName = (char *)NULL; static Bool freeDefaultFontPath = FALSE; static char *origFontPath = (char *)NULL; @@ -668,7 +664,7 @@ /* * Check for a LANG-specific file. */ - if(dirName = XpGetConfigDir(TRUE)) + if((dirName = XpGetConfigDir(TRUE))) { filePath = (char *)xalloc(strlen(dirName) + strlen(XPRINTERSFILENAME) + 2); @@ -687,7 +683,7 @@ xfree(filePath); } - if(dirName = XpGetConfigDir(FALSE)) + if((dirName = XpGetConfigDir(FALSE))) { filePath = (char *)xalloc(strlen(dirName) + strlen(XPRINTERSFILENAME) + 2); @@ -719,7 +715,6 @@ static PrinterDbPtr BuildPrinterDb(void) { - char *printerList, *augmentCmd = (char *)NULL; Bool defaultAugment = TRUE, freeConfigFileName; if(configFileName && access(configFileName, R_OK) != 0) @@ -746,7 +741,7 @@ { while((tok = strtok((char *)NULL, " \t")) != (char *)NULL) { - if(ptr = MbStrchr(tok, '\012')) + if((ptr = MbStrchr(tok, '\012'))) *ptr = (char)'\0'; AddPrinterDbName(tok); } @@ -1006,7 +1001,7 @@ return (char *)NULL; configDir = XpGetConfigDir(TRUE); - if(fontDir = ValidateFontDir(configDir, modelName)) + if((fontDir = ValidateFontDir(configDir, modelName))) { xfree(configDir); return fontDir; @@ -1068,8 +1063,8 @@ static void AugmentFontPath(void) { - char *newPath, *modelID, **allIDs = (char **)NULL; - PrinterDbPtr pDb, pDbEntry; + char *modelID, **allIDs = (char **)NULL; + PrinterDbPtr pDbEntry; int numModels, i; if(!origFontPath) @@ -1127,7 +1122,7 @@ for(i = 0; allIDs != (char **)NULL && allIDs[i] != (char *)NULL; i ++) { char *fontDir; - if(fontDir = FindFontDir(allIDs[i])) + if((fontDir = FindFontDir(allIDs[i]))) { AddToFontPath(fontDir); xfree(fontDir); @@ -1517,10 +1512,9 @@ int argc, char **argv) { - int i; float fWidth, fHeight, maxWidth, maxHeight; unsigned short width, height; - PrinterDbPtr pDb, pDb2; + PrinterDbPtr pDb; int res, maxRes; /* @@ -1573,6 +1567,7 @@ (unsigned short)(maxHeight + 0.5); } +#if 0 /* * QualifyName - takes an unqualified file name such as X6printers and * a colon-separated list of directory path names such as @@ -1623,6 +1618,7 @@ } return NULL; } +#endif /* * FillPrinterListEntry fills in a single XpDiListEntry element with data @@ -1667,7 +1663,7 @@ int localeLen, char *locale) { - PrinterDbPtr pDb, pDb2; + PrinterDbPtr pDb; for(pDb = printerDb; pDb != (PrinterDbPtr)NULL; pDb = pDb->next) { @@ -1716,7 +1712,7 @@ if(!nameLen || name == (char *)NULL) { int i; - PrinterDbPtr pDb, pDb2; + PrinterDbPtr pDb; for(pDb = printerDb, i = 0; pDb != (PrinterDbPtr)NULL; pDb = pDb->next, i++) @@ -1766,7 +1762,6 @@ XpDiValidatePrinter(char *printerName, int printerNameLen) { PrinterDbPtr pCurEntry; - WindowPtr pWin; for(pCurEntry = printerDb; pCurEntry != (PrinterDbPtr)NULL; pCurEntry = pCurEntry->next) Index: Oid.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/Oid.c,v retrieving revision 1.1.4.4 diff -u -r1.1.4.4 Oid.c --- a/Oid.c 21 Apr 2004 10:03:35 -0000 1.1.4.4 +++ b/Oid.c 25 Apr 2004 21:40:29 -0000 @@ -750,7 +750,7 @@ XpOid XpOidLinkedListNextOid(XpOidLinkedList* me) { - if(me->current ? me->current = me->current->next : xFalse) + if(me->current ? (me->current = me->current->next) : xFalse) return me->current->oid; else return xpoid_none; @@ -1651,8 +1651,6 @@ const XpOidMediumSS* msss) { int i_mss, i_ds, i_itm; - XpOidMediumDiscreteSizeList* ds_list; - int tray_count; XpOid current_tray, current_medium; XpOidMediumDiscreteSizeList* unspecified_tray_ds; XpOidMediumDiscreteSizeList* tray_ds; @@ -1711,7 +1709,7 @@ * if the tray was not matched, use the unspecified tray size * list */ - if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL) + if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL) { if(unspecified_tray_ds == (XpOidMediumDiscreteSizeList*)NULL) { /* @@ -1723,6 +1721,7 @@ } else tray_ds = unspecified_tray_ds; + } /* * loop through the discrete sizes list, looking for a size that * matches the medium for the current input tray @@ -2114,6 +2113,8 @@ return NOTIFY_EMAIL_STR; break; } + + return (const char *)NULL; } /* @@ -2237,7 +2238,7 @@ const char* first_nonws_ptr; const char* format; const char* variant; - const char* version; + const char* version = NULL; int format_len; int variant_len; int version_len; @@ -2549,11 +2550,12 @@ /* * variants must both be NULL or match */ - if(fmt->variant == (char*)NULL) + if(fmt->variant == (char*)NULL) { if(list->list[i].variant == (char*)NULL) return xTrue; else continue; + } if(list->list[i].variant == (char*)NULL) continue; if(strcmp(fmt->variant, list->list[i].variant) != 0) @@ -2561,11 +2563,12 @@ /* * versions must both be NULL or match */ - if(fmt->version == (char*)NULL) + if(fmt->version == (char*)NULL) { if(list->list[i].version == (char*)NULL) return xTrue; else continue; + } if(list->list[i].version == (char*)NULL) continue; if(strcmp(fmt->version, list->list[i].version) == 0) Index: attributes.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/attributes.c,v retrieving revision 1.1.4.5 diff -u -r1.1.4.5 attributes.c --- a/attributes.c 21 Apr 2004 10:03:35 -0000 1.1.4.5 +++ b/attributes.c 25 Apr 2004 21:40:29 -0000 @@ -142,7 +142,7 @@ static char *XpGetConfigDirBase() { - char **configDir; + char *configDir; /* * If the XPCONFIGDIR environment variable is not set, then use the @@ -319,7 +319,7 @@ if(systemAttributes.printers != (XrmDatabase)NULL) { - char *dirName, *fileName; + char *fileName; XrmDatabase modelDB = (XrmDatabase)NULL; XrmName xrm_name[5], xrm_class[2]; XrmRepresentation rep_type; @@ -619,7 +619,6 @@ { ContextAttrPtr pCtxtAttrs; XrmDatabase db = (XrmDatabase)NULL; - char *retVal; XrmName xrm_name[3]; XrmRepresentation rep_type; XrmValue value; @@ -811,7 +810,7 @@ char *s, c; if (*type != XrmQString) - return; + return False; for (firstNameSeen = False; *quarks; bindings++, quarks++) { if (*bindings == XrmBindLoosely) { @@ -851,7 +850,7 @@ } PutByte(pEnumStr, '\n'); pEnumStr->stringDb[pEnumStr->nextPos] = (char)'\0'; - return False; + return True; } /* @@ -870,7 +869,6 @@ { ContextAttrPtr pCtxtAttrs; XrmDatabase db = (XrmDatabase)NULL; - char *retVal; StringDbStruct enumStruct; XrmQuark empty = NULLQUARK; @@ -1079,34 +1077,6 @@ } /* - * ExecuteCommand takes two pointers - the command to execute, - * and the "argv" style NULL-terminated vector of arguments for the command. - * We wait for the command to terminate before continuing to ensure that - * we don't delete the job file before the spooler has made a copy. - */ -static void -ExecCommand(pCommand, argVector) - char *pCommand; - char **argVector; -{ - pid_t childPid; - int status; - - if((childPid = fork()) == 0) - { - /* return BadAlloc? */ - if (execv(pCommand, argVector) == -1) { - FatalError("unable to exec '%s'", pCommand); - } - } - else - { - (void) waitpid(childPid, &status, 0); - } - return; -} - -/* * SendFileToCommand takes three character pointers - the file name, * the command to execute, * and the "argv" style NULL-terminated vector of arguments for the command. @@ -1181,8 +1151,6 @@ } else { - int res; - (void) close(pipefd[0]); outPipe = fdopen(pipefd[1], "w"); @@ -1418,8 +1386,8 @@ char ***pVector, XpContextPtr pContext) { - char *cmdName, *curTok; - int i, numChars; + char *cmdName; + int numChars; if(command == (char *)NULL) return (char *)NULL; @@ -1445,7 +1413,7 @@ char *fileName; XpContextPtr pContext; { - char **vector, *cmdNam, *cmdOpt, *command, *userName; + char **vector, *cmdNam, *command, *userName; int i; command = XpGetOneAttribute(pContext, XPPrinterAttr, "xp-spooler-command"); @@ -1497,6 +1465,8 @@ FreeVector(vector); xfree(cmdNam); + + return Success; } /* @@ -1569,7 +1539,6 @@ { char *defMedium, *defTray; char *t, *m; - char *pS, *pE, *pLast; defMedium = XpGetOneAttribute( pCon, XPPageAttr, "default-medium" ); Index: ddxInit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ddxInit.c,v retrieving revision 1.1.4.4 diff -u -r1.1.4.4 ddxInit.c --- a/ddxInit.c 21 Apr 2004 10:03:35 -0000 1.1.4.4 +++ b/ddxInit.c 25 Apr 2004 21:40:29 -0000 @@ -72,8 +72,6 @@ char **argv) { - int i; - pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; @@ -173,7 +171,7 @@ int argc, char **argv) { - DevicePtr ptr, kbd; + DeviceIntPtr ptr, kbd; ptr = AddInputDevice((DeviceProc)PointerProc, TRUE); kbd = AddInputDevice((DeviceProc)KeyboardProc, TRUE); @@ -229,6 +227,8 @@ } #endif +extern void XprintInitGlobals(void); + /* ddxInitGlobals - called by |InitGlobals| from os/util.c */ void ddxInitGlobals(void) { @@ -242,6 +242,10 @@ * *****************************************/ +#ifdef PRINT_ONLY_SERVER +extern void XprintUseMsg(void); +#endif + void ddxUseMsg(void) { /* Enable |XprintUseMsg()| only if |XprintOptions()| is called Index: ps/Ps.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/Ps.h,v retrieving revision 1.1.4.4 diff -u -r1.1.4.4 Ps.h --- a/ps/Ps.h 21 Apr 2004 10:03:37 -0000 1.1.4.4 +++ b/ps/Ps.h 25 Apr 2004 21:40:29 -0000 @@ -351,7 +351,6 @@ extern Bool InitializePsDriver(int ndx, ScreenPtr pScreen, int argc, char **argv); -static Bool PsDestroyContext(XpContextPtr pCon); extern XpContextPtr PsGetContextFromWindow(WindowPtr win); /* @@ -375,9 +374,6 @@ */ extern Bool PsCreateGC(GCPtr pGC); -static int PsGetDrawablePrivateStuff(DrawablePtr pDrawable, GC *gc, - unsigned long *valid, PsOutPtr *psOut, - ColormapPtr *cMap); extern PsContextPrivPtr PsGetPsContextPriv( DrawablePtr pDrawable ); extern int PsUpdateDrawableGC(GCPtr pGC, DrawablePtr pDrawable, PsOutPtr *psOut, ColormapPtr *cMap); Index: ps/PsColor.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsColor.c,v retrieving revision 1.1.4.3 diff -u -r1.1.4.3 PsColor.c --- a/ps/PsColor.c 21 Apr 2004 10:03:37 -0000 1.1.4.3 +++ b/ps/PsColor.c 25 Apr 2004 21:40:29 -0000 @@ -85,7 +85,6 @@ int i; unsigned short rgb; VisualPtr pVisual = pColor->pVisual; - Pixel pix; if( pVisual->class==TrueColor ) { Index: ps/PsFonts.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsFonts.c,v retrieving revision 1.1.4.4 diff -u -r1.1.4.4 PsFonts.c --- a/ps/PsFonts.c 21 Apr 2004 10:03:37 -0000 1.1.4.4 +++ b/ps/PsFonts.c 25 Apr 2004 21:40:29 -0000 @@ -282,9 +282,8 @@ 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) */ @@ -588,7 +587,6 @@ { char *dlfnam; PsFontTypeInfoRec *rec; - char *psname; if (!(dlfnam = PsGetFontName(pFont))) return NULL; @@ -599,7 +597,7 @@ rec->next = NULL; - if (rec->filename = getFontFilename(pFont)) + if ((rec->filename = getFontFilename(pFont))) { rec->font_type = getFontFileType(rec->filename); } Index: ps/PsPixmap.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsPixmap.c,v retrieving revision 1.1.4.3 diff -u -r1.1.4.3 PsPixmap.c --- a/ps/PsPixmap.c 21 Apr 2004 10:03:37 -0000 1.1.4.3 +++ b/ps/PsPixmap.c 25 Apr 2004 21:40:30 -0000 @@ -79,10 +79,6 @@ #include "Ps.h" -#define BitsPerPixel(d) (\ - (1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ - (PixmapWidthPaddingInfo[d].padRoundUp+1)) - PixmapPtr PsCreatePixmap( ScreenPtr pScreen, Index: ps/PsPrint.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsPrint.c,v retrieving revision 1.1.4.3 diff -u -r1.1.4.3 PsPrint.c --- a/ps/PsPrint.c 21 Apr 2004 10:03:37 -0000 1.1.4.3 +++ b/ps/PsPrint.c 25 Apr 2004 21:40:30 -0000 @@ -288,13 +288,10 @@ { 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 Index: ps/PsText.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsText.c,v retrieving revision 1.1.4.4 diff -u -r1.1.4.4 PsText.c --- a/ps/PsText.c 21 Apr 2004 10:03:37 -0000 1.1.4.4 +++ b/ps/PsText.c 25 Apr 2004 21:40:30 -0000 @@ -325,11 +325,7 @@ { PsOutPtr psOut; ColormapPtr cMap; - unsigned short c, - c_hiByte, - c_lowByte, - fontPage; - int i; + unsigned short fontPage = 0; if( PsUpdateDrawableGC(pGC, pDrawable, &psOut, &cMap)==FALSE ) return x; @@ -492,7 +488,7 @@ pointer pGlyphBase) { int width, height; - PixmapPtr pPixmap; + PixmapPtr pPixmap = NULL; int nbyLine; /* bytes per line of padded pixmap */ FontPtr pfont; GCPtr pGCtmp;