From 42b8c481e30241f668e5db3ba64af91e7a94a90c Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 8 Jan 2023 11:27:36 +0000 Subject: [PATCH] More warning fixes. --- modules/src/data/stringlist.c | 4 ++-- modules/src/data/stringlist.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/src/data/stringlist.c b/modules/src/data/stringlist.c index 39f125697..e947ea58f 100644 --- a/modules/src/data/stringlist.c +++ b/modules/src/data/stringlist.c @@ -39,7 +39,7 @@ void stringlist_free(struct stringlist* list, int freedata) struct stringfragment* next = f->next; if (freedata) { - free(f->data); + free((void*) f->data); f->data = NULL; } free(f); @@ -54,7 +54,7 @@ void stringlist_init(struct stringlist* list) } -char* stringlist_get(struct stringlist *list, int index) +const char* stringlist_get(struct stringlist *list, int index) { struct stringfragment* f = list->first; int i = 0; diff --git a/modules/src/data/stringlist.h b/modules/src/data/stringlist.h index b3c6ae8e6..b104314d8 100644 --- a/modules/src/data/stringlist.h +++ b/modules/src/data/stringlist.h @@ -3,7 +3,7 @@ struct stringfragment { - char* data; + const char* data; struct stringfragment* next; }; @@ -18,7 +18,7 @@ extern void stringlist_addall(struct stringlist* list, struct stringlist* src); extern void stringlist_free(struct stringlist* list, int freedata); extern void stringlist_init(struct stringlist* list); extern int stringlist_count(struct stringlist *list); -extern char* stringlist_get(struct stringlist *list, int index); +extern const char* stringlist_get(struct stringlist *list, int index); #endif