cppcheck style-fixes

Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
This commit is contained in:
Thomas E. Dickey 2021-05-03 20:25:43 -04:00
parent 13ca987eaf
commit f807ac9c78
No known key found for this signature in database
GPG key ID: 702353E0F7E48EDB
4 changed files with 7 additions and 11 deletions

View file

@ -72,7 +72,7 @@ _XcursorCloseDisplay (Display *dpy, XExtCodes *codes)
static int
_XcursorDefaultParseBool (char *v)
{
char c0, c1;
char c0;
c0 = *v;
if (isupper ((int)c0))
@ -83,7 +83,7 @@ _XcursorDefaultParseBool (char *v)
return 0;
if (c0 == 'o')
{
c1 = v[1];
char c1 = v[1];
if (isupper ((int)c1))
c1 = (char) tolower (c1);
if (c1 == 'n')

View file

@ -655,7 +655,6 @@ XcursorXcFileLoadImages (XcursorFile *file, int size)
int nsize;
XcursorImages *images;
int n;
int toc;
if (!file || size < 0)
return NULL;
@ -676,7 +675,7 @@ XcursorXcFileLoadImages (XcursorFile *file, int size)
}
for (n = 0; n < nsize; n++)
{
toc = _XcursorFindImageToc (fileHeader, bestSize, n);
int toc = _XcursorFindImageToc (fileHeader, bestSize, n);
if (toc < 0)
break;
images->images[images->nimage] = _XcursorReadImage (file, fileHeader,

View file

@ -180,7 +180,6 @@ _XcursorThemeInherits (const char *full)
if (!strncmp (line, "Inherits", 8))
{
char *l = line + 8;
char *r;
while (*l == ' ') l++;
if (*l != '=') continue;
l++;
@ -188,7 +187,7 @@ _XcursorThemeInherits (const char *full)
result = malloc (strlen (l) + 1);
if (result)
{
r = result;
char *r = result;
while (*l)
{
while (XcursorSep(*l) || XcursorWhite (*l)) l++;
@ -561,15 +560,13 @@ int
XcursorLibraryShape (const char *library)
{
int low, high;
int mid;
int c;
low = 0;
high = NUM_STANDARD_NAMES - 1;
while (low < high - 1)
{
mid = (low + high) >> 1;
c = strcmp (library, STANDARD_NAME (mid));
int mid = (low + high) >> 1;
int c = strcmp (library, STANDARD_NAME (mid));
if (c == 0)
return (mid << 1);
if (c > 0)

View file

@ -32,7 +32,6 @@ _XcursorFontIsCursor (Display *dpy, Font font)
XcursorDisplayInfo *info;
XcursorBool ret;
XFontStruct *fs;
int n;
Atom cursor;
if (!dpy || !font)
@ -57,6 +56,7 @@ _XcursorFontIsCursor (Display *dpy, Font font)
fs = XQueryFont (dpy, font);
if (fs)
{
int n;
cursor = XInternAtom (dpy, "cursor", False);
for (n = 0; n < fs->n_properties; n++)
if (fs->properties[n].name == XA_FONT)