More warning fixes.

This commit is contained in:
dg 2023-01-08 11:27:36 +00:00
parent 0fe814b530
commit 42b8c481e3
2 changed files with 4 additions and 4 deletions

View file

@ -39,7 +39,7 @@ void stringlist_free(struct stringlist* list, int freedata)
struct stringfragment* next = f->next; struct stringfragment* next = f->next;
if (freedata) if (freedata)
{ {
free(f->data); free((void*) f->data);
f->data = NULL; f->data = NULL;
} }
free(f); 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; struct stringfragment* f = list->first;
int i = 0; int i = 0;

View file

@ -3,7 +3,7 @@
struct stringfragment struct stringfragment
{ {
char* data; const char* data;
struct stringfragment* next; 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_free(struct stringlist* list, int freedata);
extern void stringlist_init(struct stringlist* list); extern void stringlist_init(struct stringlist* list);
extern int stringlist_count(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 #endif