Janitor: Correct make distcheck and sparse warnings.

  Use only one toplevel .gitignore file.

  It was tempting to also modify the code to not, first check if
xrender is >= 0.8.2, and then, if failing, check for libXrender
functions with different build options, but left as is, as it
could be somehow useful at least as an example of being backwards
compatible.
parent cb80b449
.deps
.libs
Makefile
Makefile.in
aclocal.m4
......@@ -20,3 +22,11 @@ stamp-h1
xft-config
xft.pc
*~
*.o
*.la
*.lo
*.1
*.3
libXft-*.tar.*
ChangeLog
tags
......@@ -28,14 +28,12 @@ pkgconfig_DATA = xft.pc
CLEANFILES = xft-config
EXTRA_DIST = xft-config.in xft.pc.in autogen.sh
EXTRA_DIST += ChangeLog
EXTRA_DIST = xft-config.in xft.pc.in ChangeLog
MAINTAINERCLEANFILES = ChangeLog
.PHONY: ChangeLog
ChangeLog:
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
$(CHANGELOG_CMD)
dist-hook: ChangeLog
......@@ -36,11 +36,15 @@ AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.2)
AM_CONFIG_HEADER(config.h)
# checks for progs
AC_PROG_CC
AC_PROG_LIBTOOL
XORG_CWARNFLAGS
#
# Check for Xrender
......@@ -128,16 +132,8 @@ if test "$VERSION" = "" ; then
VERSION=$PACKAGE_VERSION;
fi
WARN_CFLAGS=""
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
fi
AC_SUBST(WARN_CFLAGS)
XORG_RELEASE_VERSION
XORG_CHANGELOG
AC_OUTPUT([Makefile
xft.pc
......
Makefile
Makefile.in
Xft.3
xft-config.1
.deps
.libs
Makefile
Makefile.in
*.la
*.lo
AM_CFLAGS = $(FONTCONFIG_CFLAGS) $(FREETYPE_CFLAGS) $(XRENDER_CFLAGS) \
$(WARN_CFLAGS) -I$(top_srcdir)/include/X11/Xft
$(CWARNFLAGS) -I$(top_srcdir)/include/X11/Xft
lib_LTLIBRARIES = libXft.la
......
......@@ -997,7 +997,7 @@ XftGlyphCore (XftDraw *draw,
else
{
draw->core.use_pixmap--;
image = 0;
image = NULL;
}
if (!image && (depth = XftDrawDepth (draw)))
{
......@@ -1153,7 +1153,7 @@ XftGlyphSpecCore (XftDraw *draw,
else
{
draw->core.use_pixmap--;
image = 0;
image = NULL;
}
if (!image && (depth = XftDrawDepth (draw)))
{
......@@ -1304,7 +1304,7 @@ XftGlyphFontSpecCore (XftDraw *draw,
else
{
draw->core.use_pixmap--;
image = 0;
image = NULL;
}
if (!image && (depth = XftDrawDepth (draw)))
{
......
......@@ -83,7 +83,7 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
}
}
if (!createIfNecessary)
return 0;
return NULL;
info = (XftDisplayInfo *) malloc (sizeof (XftDisplayInfo));
if (!info)
......@@ -94,10 +94,10 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
(void) XESetCloseDisplay (dpy, info->codes->extension, _XftCloseDisplay);
info->display = dpy;
info->defaults = 0;
info->solidFormat = 0;
info->defaults = NULL;
info->solidFormat = NULL;
info->hasRender = (XRenderQueryExtension (dpy, &event_base, &error_base) &&
(XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != 0));
(XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != NULL));
info->use_free_glyphs = FcTrue;
if (info->hasRender)
{
......@@ -155,12 +155,12 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
info->colors[i].screen = -1;
info->colors[i].pict = 0;
}
info->fonts = 0;
info->fonts = NULL;
info->next = _XftDisplayInfo;
_XftDisplayInfo = info;
info->glyph_memory = 0;
info->glyph_memory = NULL;
info->max_glyph_memory = XftDefaultGetInteger (dpy,
XFT_MAX_GLYPH_MEMORY, 0,
XFT_DPY_MAX_GLYPH_MEMORY);
......@@ -185,7 +185,7 @@ bail0:
{
printf ("XftDisplayInfoGet failed to initialize, Xft unhappy\n");
}
return 0;
return NULL;
}
/*
......@@ -393,7 +393,7 @@ _XftDefaultInit (Display *dpy)
bail1:
FcPatternDestroy (pat);
bail0:
return 0;
return NULL;
}
static FcResult
......
......@@ -134,7 +134,7 @@ XftDrawCreate (Display *dpy,
draw = (XftDraw *) malloc (sizeof (XftDraw));
if (!draw)
return 0;
return NULL;
draw->dpy = dpy;
draw->drawable = drawable;
......@@ -144,7 +144,7 @@ XftDrawCreate (Display *dpy,
draw->visual = visual;
draw->colormap = colormap;
draw->render.pict = 0;
draw->core.gc = 0;
draw->core.gc = NULL;
draw->core.use_pixmap = 0;
draw->clip_type = XftClipTypeNone;
draw->subwindow_mode = ClipByChildren;
......@@ -160,16 +160,16 @@ XftDrawCreateBitmap (Display *dpy,
draw = (XftDraw *) malloc (sizeof (XftDraw));
if (!draw)
return 0;
return NULL;
draw->dpy = dpy;
draw->drawable = (Drawable) bitmap;
draw->screen = _XftDrawScreen (dpy, bitmap, 0);
draw->screen = _XftDrawScreen (dpy, bitmap, NULL);
draw->depth = 1;
draw->bits_per_pixel = 1;
draw->visual = 0;
draw->visual = NULL;
draw->colormap = 0;
draw->render.pict = 0;
draw->core.gc = 0;
draw->core.gc = NULL;
draw->core.use_pixmap = 0;
draw->clip_type = XftClipTypeNone;
draw->subwindow_mode = ClipByChildren;
......@@ -186,16 +186,16 @@ XftDrawCreateAlpha (Display *dpy,
draw = (XftDraw *) malloc (sizeof (XftDraw));
if (!draw)
return 0;
return NULL;
draw->dpy = dpy;
draw->drawable = (Drawable) pixmap;
draw->screen = _XftDrawScreen (dpy, pixmap, 0);
draw->screen = _XftDrawScreen (dpy, pixmap, NULL);
draw->depth = depth;
draw->bits_per_pixel = 0; /* don't find out until we need it */
draw->visual = 0;
draw->visual = NULL;
draw->colormap = 0;
draw->render.pict = 0;
draw->core.gc = 0;
draw->core.gc = NULL;
draw->core.use_pixmap = 0;
draw->clip_type = XftClipTypeNone;
draw->subwindow_mode = ClipByChildren;
......@@ -209,9 +209,9 @@ _XftDrawFormat (XftDraw *draw)
XftDisplayInfo *info = _XftDisplayInfoGet (draw->dpy, True);
if (!info || !info->hasRender)
return 0;
return NULL;
if (draw->visual == 0)
if (draw->visual == NULL)
{
XRenderPictFormat pf;
......@@ -244,7 +244,7 @@ XftDrawChange (XftDraw *draw,
if (draw->core.gc)
{
XFreeGC (draw->dpy, draw->core.gc);
draw->core.gc = 0;
draw->core.gc = NULL;
}
}
......@@ -818,7 +818,7 @@ _X_EXPORT Bool
XftDrawSetClip (XftDraw *draw,
Region r)
{
Region n = 0;
Region n = NULL;
/*
* Check for quick exits
......@@ -907,7 +907,7 @@ XftDrawSetClipRectangles (XftDraw *draw,
_Xconst XRectangle *rects,
int n)
{
XftClipRect *new = 0;
XftClipRect *new = NULL;
/*
* Check for quick exit
......
......@@ -53,7 +53,7 @@ XftGlyphExtents (Display *dpy,
XftFontLoadGlyphs (dpy, pub, FcFalse, missing, nmissing);
g = glyphs;
n = nglyphs;
xftg = 0;
xftg = NULL;
while (n)
{
glyph = *g++;
......
......@@ -31,19 +31,19 @@ XftFontMatch (Display *dpy,
FcPattern *new;
FcPattern *match;
if (!XftInit (0))
return 0;
if (!XftInit (NULL))
return NULL;
new = FcPatternDuplicate (pattern);
if (!new)
return 0;
return NULL;
if (XftDebug () & XFT_DBG_OPENV)
{
printf ("XftFontMatch pattern ");
FcPatternPrint (new);
}
FcConfigSubstitute (0, new, FcMatchPattern);
FcConfigSubstitute (NULL, new, FcMatchPattern);
if (XftDebug () & XFT_DBG_OPENV)
{
printf ("XftFontMatch after FcConfig substitutions ");
......@@ -55,8 +55,8 @@ XftFontMatch (Display *dpy,
printf ("XftFontMatch after X resource substitutions ");
FcPatternPrint (new);
}
match = FcFontMatch (0, new, result);
match = FcFontMatch (NULL, new, result);
if (XftDebug () & XFT_DBG_OPENV)
{
printf ("XftFontMatch result ");
......@@ -76,13 +76,13 @@ XftFontOpen (Display *dpy, int screen, ...)
XftFont *font;
va_start (va, screen);
pat = FcPatternVaBuild (0, va);
pat = FcPatternVaBuild (NULL, va);
va_end (va);
if (!pat)
{
if (XftDebug () & XFT_DBG_OPEN)
printf ("XftFontOpen: Invalid pattern argument\n");
return 0;
return NULL;
}
match = XftFontMatch (dpy, screen, pat, &result);
if (XftDebug () & XFT_DBG_OPEN)
......@@ -99,7 +99,7 @@ XftFontOpen (Display *dpy, int screen, ...)
}
FcPatternDestroy (pat);
if (!match)
return 0;
return NULL;
font = XftFontOpenPattern (dpy, match);
if (!font)
......@@ -131,7 +131,7 @@ XftFontOpenName (Display *dpy, int screen, const char *name)
}
if (!pat)
return 0;
return NULL;
match = XftFontMatch (dpy, screen, pat, &result);
if (XftDebug () & XFT_DBG_OPEN)
{
......@@ -145,7 +145,7 @@ XftFontOpenName (Display *dpy, int screen, const char *name)
}
FcPatternDestroy (pat);
if (!match)
return 0;
return NULL;
font = XftFontOpenPattern (dpy, match);
if (!font)
......@@ -177,7 +177,7 @@ XftFontOpenXlfd (Display *dpy, int screen, const char *xlfd)
}
if (!pat)
return 0;
return NULL;
match = XftFontMatch (dpy, screen, pat, &result);
if (XftDebug () & XFT_DBG_OPEN)
{
......@@ -191,7 +191,7 @@ XftFontOpenXlfd (Display *dpy, int screen, const char *xlfd)
}
FcPatternDestroy (pat);
if (!match)
return 0;
return NULL;
font = XftFontOpenPattern (dpy, match);
if (!font)
......
......@@ -33,7 +33,7 @@ _X_HIDDEN FT_Library _XftFTlibrary;
*/
static XftFtFile *_XftFtFiles;
_X_HIDDEN int XftMaxFreeTypeFiles = 5;
static int XftMaxFreeTypeFiles = 5;
static XftFtFile *
_XftGetFile (const FcChar8 *file, int id)
......@@ -41,7 +41,7 @@ _XftGetFile (const FcChar8 *file, int id)
XftFtFile *f;
if (!XftInitFtLibrary ())
return 0;
return NULL;
for (f = _XftFtFiles; f; f = f->next)
{
......@@ -56,7 +56,7 @@ _XftGetFile (const FcChar8 *file, int id)
}
f = malloc (sizeof (XftFtFile) + strlen ((char *) file) + 1);
if (!f)
return 0;
return NULL;
XftMemAlloc (XFT_MEM_FILE, sizeof (XftFtFile) + strlen ((char *) file) + 1);
if (XftDebug () & XFT_DBG_REF)
......@@ -72,7 +72,7 @@ _XftGetFile (const FcChar8 *file, int id)
f->id = id;
f->lock = 0;
f->face = 0;
f->face = NULL;
f->xsize = 0;
f->ysize = 0;
f->matrix.xx = f->matrix.xy = f->matrix.yx = f->matrix.yy = 0;
......@@ -86,13 +86,13 @@ _XftGetFaceFile (FT_Face face)
f = malloc (sizeof (XftFtFile));
if (!f)
return 0;
return NULL;
XftMemAlloc (XFT_MEM_FILE, sizeof(XftFtFile));
f->next = 0;
f->next = NULL;
f->ref = 1;
f->file = 0;
f->file = NULL;
f->id = 0;
f->lock = 0;
f->face = face;
......@@ -139,7 +139,7 @@ _XftUncacheFiles (void)
printf ("Discard file %s/%d from cache\n",
f->file, f->id);
FT_Done_Face (f->face);
f->face = 0;
f->face = NULL;
}
}
}
......@@ -255,7 +255,7 @@ _XftSetFace (XftFtFile *f, FT_F26Dot6 xsize, FT_F26Dot6 ysize, FT_Matrix *matrix
(double) matrix->xy / 0x10000,
(double) matrix->yx / 0x10000,
(double) matrix->yy / 0x10000);
FT_Set_Transform (face, matrix, 0);
FT_Set_Transform (face, matrix, NULL);
f->matrix = *matrix;
}
return True;
......@@ -357,7 +357,7 @@ XftLockFace (XftFont *public)
if (face && !_XftSetFace (fi->file, fi->xsize, fi->ysize, &fi->matrix))
{
_XftUnlockFile (fi->file);
face = 0;
face = NULL;
}
return face;
}
......@@ -402,7 +402,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
*/
switch (FcPatternGetString (pattern, FC_FILE, 0, &filename)) {
case FcResultNoMatch:
filename = 0;
filename = NULL;
break;
case FcResultMatch:
break;
......@@ -717,7 +717,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
bail1:
_XftReleaseFile (fi->file);
fi->file = 0;
fi->file = NULL;
bail0:
return FcFalse;
}
......@@ -735,12 +735,12 @@ XftFontInfoCreate (Display *dpy, _Xconst FcPattern *pattern)
XftFontInfo *fi = malloc (sizeof (XftFontInfo));
if (!fi)
return 0;
return NULL;
if (!XftFontInfoFill (dpy, pattern, fi))
{
free (fi);
fi = 0;
fi = NULL;
}
XftMemAlloc (XFT_MEM_FONT, sizeof (XftFontInfo));
return fi;
......@@ -788,7 +788,7 @@ XftFontOpenInfo (Display *dpy,
int num_glyphs;
if (!info)
return 0;
return NULL;
/*
* Find a matching previously opened font
*/
......@@ -831,7 +831,7 @@ XftFontOpenInfo (Display *dpy,
if (FcPatternGetCharSet (pattern, FC_CHARSET, 0, &charset) == FcResultMatch)
charset = FcCharSetCopy (charset);
else
charset = FcFreeTypeCharSet (face, FcConfigGetBlanks (0));
charset = FcFreeTypeCharSet (face, FcConfigGetBlanks (NULL));
antialias = fi->antialias;
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
......@@ -865,7 +865,7 @@ XftFontOpenInfo (Display *dpy,
goto bail2;
}
else
format = 0;
format = NULL;
if (charset)
{
......@@ -1018,7 +1018,7 @@ bail2:
bail1:
_XftUnlockFile (fi->file);
bail0:
return 0;
return NULL;
}
_X_EXPORT XftFont *
......@@ -1028,7 +1028,7 @@ XftFontOpenPattern (Display *dpy, FcPattern *pattern)
XftFont *font;
if (!XftFontInfoFill (dpy, pattern, &info))
return 0;
return NULL;
font = XftFontOpenInfo (dpy, pattern, &info);
XftFontInfoEmpty (dpy, &info);
......
......@@ -546,7 +546,7 @@ XftFontLoadGlyphs (Display *dpy,
memcpy (xftg->bitmap, bufBitmapRgba, sizergba);
}
else
xftg->bitmap = 0;
xftg->bitmap = NULL;
}
}
else
......@@ -592,7 +592,7 @@ XftFontLoadGlyphs (Display *dpy,
memcpy (xftg->bitmap, bufBitmap, size);
}
else
xftg->bitmap = 0;
xftg->bitmap = NULL;
}
}
font->glyph_memory += xftg->glyph_memory;
......@@ -655,7 +655,7 @@ XftFontUnloadGlyphs (Display *dpy,
}
free (xftg);
XftMemFree (XFT_MEM_GLYPH, sizeof (XftGlyph));
font->glyphs[glyphindex] = 0;
font->glyphs[glyphindex] = NULL;
}
if (font->glyphset && nused)
XRenderFreeGlyphs (dpy, font->glyphset, glyphBuf, nused);
......@@ -684,7 +684,7 @@ XftFontCheckGlyph (Display *dpy,
if (!xftg)
return FcFalse;
XftMemAlloc (XFT_MEM_GLYPH, sizeof (XftGlyph));
xftg->bitmap = 0;
xftg->bitmap = NULL;
xftg->glyph_memory = 0;
font->glyphs[glyph] = xftg;
}
......
......@@ -22,7 +22,7 @@
#include "xftint.h"
_X_HIDDEN Bool _XftConfigInitialized;
static Bool _XftConfigInitialized;
_X_EXPORT Bool
XftInit (_Xconst char *config)
......
......@@ -28,7 +28,7 @@ XftListFontsPatternObjects (Display *dpy,
FcPattern *pattern,
FcObjectSet *os)
{
return FcFontList (0, pattern, os);
return FcFontList (NULL, pattern, os);
}
_X_EXPORT FcFontSet *
......@@ -43,8 +43,8 @@ XftListFonts (Display *dpy,
const char *first;
va_start (va, screen);
FcPatternVapBuild (pattern, 0, va);
FcPatternVapBuild (pattern, NULL, va);
first = va_arg (va, const char *);
FcObjectSetVapBuild (os, first, va);
......
......@@ -31,7 +31,7 @@ static const FcObjectType _XftObjectTypes[] = {
#define NUM_OBJECT_TYPES (sizeof _XftObjectTypes / sizeof _XftObjectTypes[0])
_X_HIDDEN FcBool _XftNameInitialized;
static FcBool _XftNameInitialized;
_X_HIDDEN void
_XftNameInit (void)
......
......@@ -395,7 +395,7 @@ XftCharSpecRender (Display *dpy,
static XRenderPictFormat *
XftPreferFormat (Display *dpy, XRenderPictFormat *a, XRenderPictFormat *b)
{
XRenderPictFormat *prefer = 0;
XRenderPictFormat *prefer = NULL;
if (a == b)
prefer = a;
......@@ -501,7 +501,7 @@ XftGlyphFontSpecRender (Display *dpy,
* Compute the number of glyph elts needed
*/
nelt = 1;
firstFont = 0;
firstFont = NULL;
for (i = 0; i < nglyphs; i++)
{
XftFont *pub = glyphs[i].font;
......@@ -522,7 +522,7 @@ XftGlyphFontSpecRender (Display *dpy,
format = firstFont->format;
x = glyphs[i].x + glyph->metrics.xOff;
y = glyphs[i].y + glyph->metrics.yOff;
prevPublic = 0;
prevPublic = NULL;
while (++i < nglyphs)
{
XftFont *pub = glyphs[i].font;
......@@ -566,7 +566,7 @@ XftGlyphFontSpecRender (Display *dpy,
x = y = 0;
n = 0;
j = 0;
prevPublic = 0;
prevPublic = NULL;
for (i = 0; i < nglyphs; i++)
{
XftFont *pub = glyphs[i].font;
......
......@@ -100,35 +100,35 @@ XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable, FcBool complete)
double dpixel;
if (*xlfd != '-')
return 0;
if (!(xlfd = strchr (foundry = ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (family = ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (weight_name = ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (slant = ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (/* setwidth_name = */ ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (/* add_style_name = */ ++xlfd, '-'))) return 0;
if (!(xlfd = XftGetInt (++xlfd, &pixel))) return 0;
if (!(xlfd = XftGetInt (++xlfd, &point))) return 0;
if (!(xlfd = XftGetInt (++xlfd, &resx))) return 0;
if (!(xlfd = XftGetInt (++xlfd, &resy))) return 0;
if (!(xlfd = strchr (/* spacing = */ ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (/* average_width = */ ++xlfd, '-'))) return 0;
if (!(xlfd = strchr (registry = ++xlfd, '-'))) return 0;
return NULL;
if (!(xlfd = strchr (foundry = ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (family = ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (weight_name = ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (slant = ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (/* setwidth_name = */ ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (/* add_style_name = */ ++xlfd, '-'))) return NULL;
if (!(xlfd = XftGetInt (++xlfd, &pixel))) return NULL;
if (!(xlfd = XftGetInt (++xlfd, &point))) return NULL;
if (!(xlfd = XftGetInt (++xlfd, &resx))) return NULL;
if (!(xlfd = XftGetInt (++xlfd, &resy))) return NULL;
if (!(xlfd = strchr (/* spacing = */ ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (/* average_width = */ ++xlfd, '-'))) return NULL;
if (!(xlfd = strchr (registry = ++xlfd, '-'))) return NULL;
/* make sure no fields follow this one */
if ((xlfd = strchr (encoding = ++xlfd, '-'))) return 0;
if ((xlfd = strchr (encoding = ++xlfd, '-'))) return NULL;
if (!pixel)
return 0;
return NULL;
pat = FcPatternCreate ();
if (!pat)
return 0;
return NULL;
save = (char *) malloc (strlen (foundry) + 1);
if (!save) {
FcPatternDestroy (pat);
return 0;
return NULL;
}
if (!FcPatternAddString (pat, XFT_XLFD, (FcChar8 *) xlfd_orig)) goto bail;
......@@ -173,5 +173,5 @@ XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable, FcBool complete)
bail:
free (save);
FcPatternDestroy (pat);
return 0;
return NULL;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment