Bug 1863 - local variable used before set in PsPolyGlyphBlt()
Summary: local variable used before set in PsPolyGlyphBlt()
Alias: None
Product: xprint
Classification: Unclassified
Component: Server: DDX: PostScript (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Roland Mainz
QA Contact:
Depends on:
Reported: 2004-11-15 03:52 UTC by dcb314
Modified: 2011-09-13 14:10 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Description dcb314 2004-11-15 03:52:23 UTC
Hello there,

I just tried to compile X11R6.8.1 with the most excellent Intel C
8.1 compiler, on a Linux Fedora Core 3 box. The compiler said

PsText.c(527): remark #592: variable "pPixmap" is used before its value is set

The source code is in file


The source code is


Suggest init pPixmap before first use.
Comment 1 Roland Mainz 2004-11-24 14:36:46 UTC
Looking at the code:
-- snip --
  DrawablePtr   pDrawable,
  GCPtr         pGC,
  int           x,
  int           y,
  unsigned int  nGlyphs,
  CharInfoPtr  *pCharInfo,
  pointer       pGlyphBase)
    int width, height;
    PixmapPtr pPixmap;
    int nbyLine;                        /* bytes per line of padded pixmap */
    FontPtr pfont;
    GCPtr pGCtmp;
    register int i;
    register int j;
    unsigned char *pbits;               /* buffer for PutImage */
    register unsigned char *pb;         /* temp pointer into buffer */
    register CharInfoPtr pci;           /* currect char info */
    register unsigned char *pglyph;     /* pointer bits in glyph */
    int gWidth, gHeight;                /* width and height of glyph */
    register int nbyGlyphWidth;         /* bytes per scanline of glyph */
    int nbyPadGlyph;                    /* server padded line of glyph */
    int w, tmpx;
    XID gcvals[3];

    pfont = pGC->font;
    width = FONTMAXBOUNDS(pfont,rightSideBearing) -
    height = FONTMAXBOUNDS(pfont,ascent) +

    if ((width == 0) || (height == 0) )
        int i;
        w = 0;
        for (i=0; i < nGlyphs; i++) w += pCharInfo[i]->metrics.characterWidth;
    pGCtmp = GetScratchGC(1, pDrawable->pScreen);
    if (!pGCtmp)
-- snip --

It seems that the whole statement
|(*pDrawable->pScreen->DestroyPixmap)(pPixmap);| can be removed (same applies to
the |PsDestroyPixmap(pPixmap);| statement later in the code) ...

Just curious: For what purpose was the |pPixmap| being used ?
Comment 2 Corbin Simpson 2011-09-13 14:10:35 UTC
Closing WONTFIX because nobody cares about Xprint. Reopen if you plan to address this bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.