summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-15 21:46:15 +0900
committerKeith Packard <keithp@keithp.com>2014-01-29 15:20:03 -0800
commita96cc1f032a059da89319ceccb6659c8edd446fb (patch)
tree8e4aa6f868bc037f4fc036fb41f7f7844315c3f2 /src/util
parent2a3429413df27224ceeddd22500ce43b5431d698 (diff)
Warning fixes.
Many const char issues. One extra 'i' declared in ScaleFont; we can just use the same 'i' as exists at the top level scope. Also ignore bad-function-cast in ftfuncs.c and bitscale.c because we're casting the return value from floor or ceil from double to int. As floor and ceil are kinda designed to generate integer results, it's pretty clear that we're doing what we want and that the compiler is generating noise. I'm not sure why bad-function-cast is ever a good warning to turn on, but I'll leave that for another day. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/patcache.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/patcache.c b/src/util/patcache.c
index 9c05fa1..2101015 100644
--- a/src/util/patcache.c
+++ b/src/util/patcache.c
@@ -50,7 +50,7 @@ typedef unsigned char EntryPtr;
typedef struct _FontPatternCacheEntry {
struct _FontPatternCacheEntry *next, **prev;
short patlen;
- char *pattern;
+ const char *pattern;
int hash;
FontPtr pFont; /* associated font */
} FontPatternCacheEntryRec, *FontPatternCacheEntryPtr;
@@ -74,7 +74,7 @@ EmptyFontPatternCache (FontPatternCachePtr cache)
cache->entries[i].next = &cache->entries[i+1];
cache->entries[i].prev = 0;
cache->entries[i].pFont = 0;
- free (cache->entries[i].pattern);
+ free ((void *) cache->entries[i].pattern);
cache->entries[i].pattern = 0;
cache->entries[i].patlen = 0;
}
@@ -107,7 +107,7 @@ FreeFontPatternCache (FontPatternCachePtr cache)
int i;
for (i = 0; i < NENTRIES; i++)
- free (cache->entries[i].pattern);
+ free ((void *) cache->entries[i].pattern);
free (cache);
}
@@ -128,7 +128,7 @@ Hash (const char *string, int len)
/* add entry */
void
CacheFontPattern (FontPatternCachePtr cache,
- char *pattern,
+ const char *pattern,
int patlen,
FontPtr pFont)
{
@@ -154,7 +154,7 @@ CacheFontPattern (FontPatternCachePtr cache,
if (e->next)
e->next->prev = e->prev;
*e->prev = e->next;
- free (e->pattern);
+ free ((void *) e->pattern);
}
/* set pattern */
memcpy (newpat, pattern, patlen);
@@ -174,7 +174,7 @@ CacheFontPattern (FontPatternCachePtr cache,
/* find matching entry */
FontPtr
FindCachedFontPattern (FontPatternCachePtr cache,
- char *pattern,
+ const char *pattern,
int patlen)
{
int hash;
@@ -211,7 +211,7 @@ RemoveCachedFontPattern (FontPatternCachePtr cache,
*e->prev = e->next;
e->next = cache->free;
cache->free = e;
- free (e->pattern);
+ free ((void *) e->pattern);
e->pattern = 0;
}
}