From d2576bbb948dd9d8e06f66dc4cede774c5518751 Mon Sep 17 00:00:00 2001 From: Olaf Meeuwissen Date: Wed, 11 Nov 2015 22:30:10 +0900 Subject: [PATCH] Fix "discards 'const' qualifier from pointer target type" warnings The cs3_xfree() functions is really just a checked call to free() so its signature has been changed to match that. The warnings that causes have been fixed in the same way and on the same grounds as the previous commit. --- backend/coolscan3.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/coolscan3.c b/backend/coolscan3.c index a1d6fe60a..42814d1f2 100644 --- a/backend/coolscan3.c +++ b/backend/coolscan3.c @@ -290,7 +290,7 @@ static SANE_Status cs3_convert_options(cs3_t * s); static SANE_Status cs3_scan(cs3_t * s, cs3_scan_t type); static void *cs3_xmalloc(size_t size); static void *cs3_xrealloc(void *p, size_t size); -static void cs3_xfree(const void *p); +static void cs3_xfree(void *p); /* ========================================================================= */ @@ -332,9 +332,9 @@ sane_exit(void) DBG(10, "%s\n", __func__); for (i = 0; i < n_device_list; i++) { - cs3_xfree(device_list[i]->name); - cs3_xfree(device_list[i]->vendor); - cs3_xfree(device_list[i]->model); + cs3_xfree((void *)device_list[i]->name); + cs3_xfree((void *)device_list[i]->vendor); + cs3_xfree((void *)device_list[i]->model); cs3_xfree(device_list[i]); } cs3_xfree(device_list); @@ -1969,9 +1969,9 @@ cs3_open(const char *device, cs3_interface_t interface, cs3_t ** sp) device_list[n_device_list]->type = "film scanner"; if (alloc_failed) { - cs3_xfree(device_list[n_device_list]->name); - cs3_xfree(device_list[n_device_list]->vendor); - cs3_xfree(device_list[n_device_list]->model); + cs3_xfree((void *)device_list[n_device_list]->name); + cs3_xfree((void *)device_list[n_device_list]->vendor); + cs3_xfree((void *)device_list[n_device_list]->model); cs3_xfree(device_list[n_device_list]); } else n_device_list++; @@ -3181,8 +3181,8 @@ cs3_xrealloc(void *p, size_t size) } static void -cs3_xfree(const void *p) +cs3_xfree(void *p) { if (p) - free(p); + free(p); }