summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-07-05 20:13:42 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-07-06 04:28:46 -0400
commit10b53d1fa37615e81d1e3b6e4d2d2e25e4342c15 (patch)
treeafe8fc9518ccf222a06e8dbbbef52dbfa2ef3acb
parent6fc03611ed2b103b6b5a2f0c6b610087879325e4 (diff)
downloadxorg-lib-libXft-10b53d1fa37615e81d1e3b6e4d2d2e25e4342c15.tar.gz
errata (cppcheck, clang --analyze, manpage credit)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--man/Xft.man2
-rw-r--r--src/xftcore.c2
-rw-r--r--src/xftdpy.c3
-rw-r--r--src/xftfreetype.c3
-rw-r--r--src/xftglyphs.c5
-rw-r--r--src/xftxlfd.c6
6 files changed, 8 insertions, 13 deletions
diff --git a/man/Xft.man b/man/Xft.man
index 01e5649..879fe24 100644
--- a/man/Xft.man
+++ b/man/Xft.man
@@ -1814,6 +1814,8 @@ placed in the the list of returned patterns when listing fonts.
.\" .SS "Xft 1.x Functions"
.SH AUTHOR
Keith Packard
+.br
+Thomas E. Dickey (performance improvements)
.SH "SEE ALSO"
.I Fontconfig Developers Reference
.br
diff --git a/src/xftcore.c b/src/xftcore.c
index 1c47270..b93dc58 100644
--- a/src/xftcore.c
+++ b/src/xftcore.c
@@ -436,7 +436,7 @@ static CARD32
fbOver24 (CARD32 x, CARD32 y)
{
CARD16 a = (CARD16)(~x >> 24);
- CARD16 t;
+ CARD16 t = 0;
CARD32 m,n,o;
m = XftOverU(x,y,0,a,t);
diff --git a/src/xftdpy.c b/src/xftdpy.c
index bde7c65..47e8c33 100644
--- a/src/xftdpy.c
+++ b/src/xftdpy.c
@@ -53,7 +53,8 @@ _XftCloseDisplay (Display *dpy, XExtCodes *codes _X_UNUSED)
for (prev = &_XftDisplayInfo; (info = *prev); prev = &(*prev)->next)
if (info->display == dpy)
break;
- *prev = info->next;
+ if (info != NULL)
+ *prev = info->next;
free (info);
return 0;
diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index 95b80e4..4bba26b 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -133,7 +133,7 @@ _XftUncacheFiles (void)
XftFtFile *f;
while ((n = _XftNumFiles ()) > XftMaxFreeTypeFiles)
{
- f = _XftNthFile (rand () % n);
+ f = _XftNthFile (n ? (rand () % n) : 0);
if (f)
{
if (XftDebug() & XFT_DBG_REF)
@@ -870,7 +870,6 @@ XftFontOpenInfo (Display *dpy,
}
else
{
- num_unicode = 0;
hash_value = 0;
rehash_value = 0;
}
diff --git a/src/xftglyphs.c b/src/xftglyphs.c
index 10ab45e..b27962b 100644
--- a/src/xftglyphs.c
+++ b/src/xftglyphs.c
@@ -543,9 +543,6 @@ XftFontLoadGlyphs (Display *dpy,
bottom = (int)FLOOR( glyphslot->metrics.horiBearingY - glyphslot->metrics.height );
}
- width = TRUNC(right - left);
- height = TRUNC( top - bottom );
-
/*
* Clip charcell glyphs to the bounding box
* XXX transformed?
@@ -563,7 +560,6 @@ XftFontLoadGlyphs (Display *dpy,
adjust = top;
top -= adjust;
bottom -= adjust;
- height = font->public.max_advance_width;
}
}
else
@@ -577,7 +573,6 @@ XftFontLoadGlyphs (Display *dpy,
adjust = left;
left -= adjust;
right -= adjust;
- width = font->public.max_advance_width;
}
}
}
diff --git a/src/xftxlfd.c b/src/xftxlfd.c
index 78f8491..afd9da0 100644
--- a/src/xftxlfd.c
+++ b/src/xftxlfd.c
@@ -89,8 +89,6 @@ XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable _X_UNUSED, FcBool co
const char *family;
const char *weight_name;
const char *slant;
- const char *registry;
- const char *encoding;
char *save;
int pixel;
int point;
@@ -113,9 +111,9 @@ XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable _X_UNUSED, FcBool co
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;
+ if (!(xlfd = strchr (/* registry = */ ++xlfd, '-'))) return NULL;
/* make sure no fields follow this one */
- if ((xlfd = strchr (encoding = ++xlfd, '-'))) return NULL;
+ if ((/* xlfd = */ strchr (/* encoding = */ ++xlfd, '-'))) return NULL;
if (!pixel)
return NULL;