summaryrefslogtreecommitdiff
path: root/xkbpath.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 15:18:26 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-03 11:02:11 -0800
commit6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c (patch)
tree45171678d6b1fbfe936bb2586933d3e03c93500a /xkbpath.c
parent299c9762b1dbe53f3297c54e5526aeae767d1a10 (diff)
Mark more pointers as const
Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xkbpath.c')
-rw-r--r--xkbpath.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xkbpath.c b/xkbpath.c
index 3c44d9c..ef8d68c 100644
--- a/xkbpath.c
+++ b/xkbpath.c
@@ -284,7 +284,7 @@ XkbDirectoryForInclude(unsigned type)
typedef struct _FileCacheEntry
{
- char *name;
+ const char *name;
unsigned type;
char *path;
void *data;
@@ -306,7 +306,7 @@ static FileCacheEntry *fileCache;
* @return The data from the overwritten file or NULL.
*/
void *
-XkbAddFileToCache(char *name, unsigned type, char *path, void *data)
+XkbAddFileToCache(const char *name, unsigned type, char *path, void *data)
{
FileCacheEntry *entry;
@@ -346,7 +346,7 @@ XkbAddFileToCache(char *name, unsigned type, char *path, void *data)
* @return the data from the cache entry or NULL if no matching entry was found.
*/
void *
-XkbFindFileInCache(char *name, unsigned type, char **pathRtrn)
+XkbFindFileInCache(const char *name, unsigned type, char **pathRtrn)
{
FileCacheEntry *entry;
@@ -374,11 +374,12 @@ XkbFindFileInCache(char *name, unsigned type, char **pathRtrn)
* pathRtrn is undefined.
*/
FILE *
-XkbFindFileInPath(char *name, unsigned type, char **pathRtrn)
+XkbFindFileInPath(const char *name, unsigned type, char **pathRtrn)
{
FILE *file = NULL;
int nameLen, typeLen;
- char buf[PATH_MAX], *typeDir;
+ char buf[PATH_MAX];
+ const char *typeDir;
typeDir = XkbDirectoryForInclude(type);
nameLen = strlen(name);