summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-07-04 18:10:32 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-07-06 04:28:16 -0400
commit698e205b657f9192df07962e7823a2eae80e1c17 (patch)
tree7d76abcd9af82accaed3b549be3582785eafc89c
parent949295d665b030eb451fa590940293ada84c9bfe (diff)
downloadxorg-lib-libXft-698e205b657f9192df07962e7823a2eae80e1c17.tar.gz
cppcheck/gcc-stricter warnings about printf-formats and operator precedence
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--src/xftdpy.c8
-rw-r--r--src/xftglyphs.c19
2 files changed, 14 insertions, 13 deletions
diff --git a/src/xftdpy.c b/src/xftdpy.c
index f431ec1..bde7c65 100644
--- a/src/xftdpy.c
+++ b/src/xftdpy.c
@@ -171,7 +171,7 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
XFT_MAX_GLYPH_MEMORY, 0,
XFT_DPY_MAX_GLYPH_MEMORY);
if (XftDebug () & XFT_DBG_CACHE)
- printf ("global max cache memory %ld\n", info->max_glyph_memory);
+ printf ("global max cache memory %lu\n", info->max_glyph_memory);
info->num_unref_fonts = 0;
@@ -219,7 +219,7 @@ _XftDisplayValidateMemory (XftDisplayInfo *info)
glyph_memory += font->glyph_memory;
}
if (glyph_memory != info->glyph_memory)
- printf ("Display glyph cache incorrect has %ld bytes, should have %ld\n",
+ printf ("Display glyph cache incorrect has %lu bytes, should have %lu\n",
info->glyph_memory, glyph_memory);
}
@@ -236,7 +236,7 @@ _XftDisplayManageMemory (Display *dpy)
if (XftDebug () & XFT_DBG_CACHE)
{
if (info->glyph_memory > info->max_glyph_memory)
- printf ("Reduce global memory from %ld to %ld\n",
+ printf ("Reduce global memory from %lu to %lu\n",
info->glyph_memory, info->max_glyph_memory);
_XftDisplayValidateMemory (info);
}
@@ -288,7 +288,7 @@ XftDefaultSet (Display *dpy, FcPattern *defaults)
XFT_MAX_GLYPH_MEMORY, 0,
(int)info->max_glyph_memory);
if (XftDebug () & XFT_DBG_CACHE)
- printf ("update max cache memory %ld\n", info->max_glyph_memory);
+ printf ("update max cache memory %lu\n", info->max_glyph_memory);
if (!info->max_unref_fonts)
info->max_unref_fonts = XFT_DPY_MAX_UNREF_FONTS;
diff --git a/src/xftglyphs.c b/src/xftglyphs.c
index 40b514d..8db0929 100644
--- a/src/xftglyphs.c
+++ b/src/xftglyphs.c
@@ -49,7 +49,7 @@ _XftFontValidateMemory (Display *dpy _X_UNUSED, XftFont *public)
}
}
if (glyph_memory != font->glyph_memory)
- printf ("Font glyph cache incorrect has %ld bytes, should have %ld\n",
+ printf ("Font glyph cache incorrect has %lu bytes, should have %lu\n",
font->glyph_memory, glyph_memory);
}
@@ -666,7 +666,7 @@ XftFontLoadGlyphs (Display *dpy,
{
for (x = 0; x < width * 8; x++)
{
- printf ("%c", line[x>>3] & (1 << (x & 7)) ? '#' : ' ');
+ printf ("%c", (line[x>>3] & (1 << (x & 7))) ? '#' : ' ');
}
}
printf ("|\n");
@@ -775,7 +775,7 @@ XftFontLoadGlyphs (Display *dpy,
if (XftDebug() & XFT_DBG_CACHE)
_XftFontValidateMemory (dpy, pub);
if (XftDebug() & XFT_DBG_CACHEV)
- printf ("Caching glyph 0x%x size %ld\n", glyphindex,
+ printf ("Caching glyph 0x%x size %lu\n", glyphindex,
xftg->glyph_memory);
if (font->track_mem_usage) {
@@ -785,7 +785,8 @@ XftFontLoadGlyphs (Display *dpy,
xuse->older = glyphindex;
xuse->newer = glyphindex;
if (XftDebug() & XFT_DBG_USAGE)
- printf("alloc %p -> %d: %p USE %d.%d\n", font, glyphindex,
+ printf("alloc %p -> %d: %p USE %d.%d\n",
+ (void *) font, glyphindex,
(void *) xuse, xuse->older, xuse->newer);
} else {
XftGlyphUsage *xnew;
@@ -803,7 +804,7 @@ XftFontLoadGlyphs (Display *dpy,
xold->older = glyphindex;
if (XftDebug() & XFT_DBG_USAGE)
printf("alloc %p -> %d: %p USE %d.%d, %p NEW %d.%d %p OLD %d.%d\n",
- font, glyphindex,
+ (void *) font, glyphindex,
(void *) xuse, xuse->older, xuse->newer,
(void *) xnew, xnew->older, xnew->newer,
(void *) xold, xold->older, xold->newer);
@@ -843,7 +844,7 @@ XftFontUnloadGlyphs (Display *dpy,
if (xftg->glyph_memory)
{
if (XftDebug() & XFT_DBG_CACHEV)
- printf ("Uncaching glyph 0x%x size %ld\n",
+ printf ("Uncaching glyph 0x%x size %lu\n",
glyphindex, xftg->glyph_memory);
if (font->format)
{
@@ -873,7 +874,7 @@ XftFontUnloadGlyphs (Display *dpy,
if (XftDebug() & XFT_DBG_USAGE)
printf("free %p -> %p USE %d.%d\n",
- font, (void *) xuse, xuse->older, xuse->newer);
+ (void *) font, (void *) xuse, xuse->older, xuse->newer);
if (xuse->older != FT_UINT_MAX) {
xtmp = (XftGlyphUsage *) font->glyphs[xuse->older];
@@ -1014,7 +1015,7 @@ XftCharIndex (Display *dpy,
}
/*
- * Remove glyph(s) from the font to reduce memory-usage.
+ * Remove glyph(s) from the font to reduce memory-usage.
*/
_X_HIDDEN void
_XftFontUncacheGlyph (Display *dpy, XftFont *pub)
@@ -1087,7 +1088,7 @@ _XftFontManageMemory (Display *dpy, XftFont *pub)
if (XftDebug() & XFT_DBG_CACHE)
{
if (font->glyph_memory > font->max_glyph_memory)
- printf ("Reduce memory for font 0x%lx from %ld to %ld\n",
+ printf ("Reduce memory for font 0x%lx from %lu to %lu\n",
font->glyphset ? font->glyphset : (unsigned long) font,
font->glyph_memory, font->max_glyph_memory);
}