summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-05-29 17:51:07 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-06-03 15:51:07 -0400
commit768f43c04b5587d3b49ccd2d2f0133630c6a093b (patch)
tree09ac535e8969abbe443ab5b1f68bfe7448b75e2f /src
parent4dadf0ed93624a09b4a2f7403b79103b50681391 (diff)
cleanup warnings about discarding const
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-rw-r--r--src/xftdraw.c4
-rw-r--r--src/xftfont.c2
-rw-r--r--src/xftfreetype.c12
-rw-r--r--src/xftname.c2
-rw-r--r--src/xftstr.c2
-rw-r--r--src/xftxlfd.c2
6 files changed, 12 insertions, 12 deletions
diff --git a/src/xftdraw.c b/src/xftdraw.c
index 1fe6d4d..ef9dbc2 100644
--- a/src/xftdraw.c
+++ b/src/xftdraw.c
@@ -324,8 +324,8 @@ XftDrawSrcPicture (XftDraw *draw, _Xconst XftColor *color)
{
if (info->colors[i].pict &&
info->colors[i].screen == draw->screen &&
- !memcmp ((void *) &color->color,
- (void *) &info->colors[i].color,
+ !memcmp ((const void *) &color->color,
+ (const void *) &info->colors[i].color,
sizeof (XRenderColor)))
return info->colors[i].pict;
}
diff --git a/src/xftfont.c b/src/xftfont.c
index d361498..7a944e3 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -120,7 +120,7 @@ XftFontOpenName (Display *dpy, int screen, const char *name)
FcResult result;
XftFont *font;
- pat = FcNameParse ((FcChar8 *) name);
+ pat = FcNameParse ((const FcChar8 *) name);
if (XftDebug () & XFT_DBG_OPEN)
{
printf ("XftFontOpenName \"%s\": ", name);
diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index 53cd5a4..2db163b 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -45,7 +45,7 @@ _XftGetFile (const FcChar8 *file, int id)
for (f = _XftFtFiles; f; f = f->next)
{
- if (!strcmp (f->file, (char *) file) && f->id == id)
+ if (!strcmp (f->file, (const char *) file) && f->id == id)
{
++f->ref;
if (XftDebug () & XFT_DBG_REF)
@@ -54,11 +54,11 @@ _XftGetFile (const FcChar8 *file, int id)
return f;
}
}
- f = malloc (sizeof (XftFtFile) + strlen ((char *) file) + 1);
+ f = malloc (sizeof (XftFtFile) + strlen ((const char *) file) + 1);
if (!f)
return NULL;
- XftMemAlloc (XFT_MEM_FILE, (int)(sizeof (XftFtFile) + strlen ((char *) file) + 1));
+ XftMemAlloc (XFT_MEM_FILE, (int)(sizeof (XftFtFile) + strlen ((const char *) file) + 1));
if (XftDebug () & XFT_DBG_REF)
printf ("FontFile %s/%d matches new\n",
file, id);
@@ -68,7 +68,7 @@ _XftGetFile (const FcChar8 *file, int id)
f->ref = 1;
f->file = (char *) (f+1);
- strcpy (f->file, (char *) file);
+ strcpy (f->file, (const char *) file);
f->id = id;
f->lock = 0;
@@ -432,7 +432,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
if (XftDebug() & XFT_DBG_OPEN)
printf ("XftFontInfoFill: %s: %d (%g pixels)\n",
- (filename ? filename : (FcChar8 *) "<none>"), id, dsize);
+ (filename ? filename : (const FcChar8 *) "<none>"), id, dsize);
/*
* Get antialias value
*/
@@ -757,7 +757,7 @@ XftFontInfoHash (_Xconst XftFontInfo *fi)
_X_EXPORT FcBool
XftFontInfoEqual (_Xconst XftFontInfo *a, _Xconst XftFontInfo *b)
{
- return memcmp ((void *) a, (void *) b, sizeof (XftFontInfo)) == 0;
+ return memcmp ((const void *) a, (const void *) b, sizeof (XftFontInfo)) == 0;
}
_X_EXPORT XftFont *
diff --git a/src/xftname.c b/src/xftname.c
index e120199..c5c20dc 100644
--- a/src/xftname.c
+++ b/src/xftname.c
@@ -25,7 +25,7 @@
_X_EXPORT FcPattern
*XftNameParse (const char *name)
{
- return FcNameParse ((FcChar8 *) name);
+ return FcNameParse ((const FcChar8 *) name);
}
_X_EXPORT FcBool
diff --git a/src/xftstr.c b/src/xftstr.c
index a5733f4..50d8081 100644
--- a/src/xftstr.c
+++ b/src/xftstr.c
@@ -27,7 +27,7 @@ _XftMatchSymbolic (XftSymbolic *s, int n, const char *name, int def)
{
while (n--)
{
- if (!FcStrCmpIgnoreCase ((FcChar8 *) s->name, (FcChar8 *) name))
+ if (!FcStrCmpIgnoreCase ((const FcChar8 *) s->name, (const FcChar8 *) name))
return s->value;
s++;
}
diff --git a/src/xftxlfd.c b/src/xftxlfd.c
index bf605c2..78f8491 100644
--- a/src/xftxlfd.c
+++ b/src/xftxlfd.c
@@ -131,7 +131,7 @@ XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable _X_UNUSED, FcBool co
return NULL;
}
- if (!FcPatternAddString (pat, XFT_XLFD, (FcChar8 *) xlfd_orig)) goto bail;
+ if (!FcPatternAddString (pat, XFT_XLFD, (const FcChar8 *) xlfd_orig)) goto bail;
XftSplitStr (foundry, save);
if (save[0] && strcmp (save, "*") != 0)