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.
merge-requests/1/head
Olaf Meeuwissen 2015-11-11 22:30:10 +09:00
rodzic e65fd1b4cb
commit d2576bbb94
1 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -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 SANE_Status cs3_scan(cs3_t * s, cs3_scan_t type);
static void *cs3_xmalloc(size_t size); static void *cs3_xmalloc(size_t size);
static void *cs3_xrealloc(void *p, 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__); DBG(10, "%s\n", __func__);
for (i = 0; i < n_device_list; i++) { for (i = 0; i < n_device_list; i++) {
cs3_xfree(device_list[i]->name); cs3_xfree((void *)device_list[i]->name);
cs3_xfree(device_list[i]->vendor); cs3_xfree((void *)device_list[i]->vendor);
cs3_xfree(device_list[i]->model); cs3_xfree((void *)device_list[i]->model);
cs3_xfree(device_list[i]); cs3_xfree(device_list[i]);
} }
cs3_xfree(device_list); 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"; device_list[n_device_list]->type = "film scanner";
if (alloc_failed) { if (alloc_failed) {
cs3_xfree(device_list[n_device_list]->name); cs3_xfree((void *)device_list[n_device_list]->name);
cs3_xfree(device_list[n_device_list]->vendor); cs3_xfree((void *)device_list[n_device_list]->vendor);
cs3_xfree(device_list[n_device_list]->model); cs3_xfree((void *)device_list[n_device_list]->model);
cs3_xfree(device_list[n_device_list]); cs3_xfree(device_list[n_device_list]);
} else } else
n_device_list++; n_device_list++;
@ -3181,7 +3181,7 @@ cs3_xrealloc(void *p, size_t size)
} }
static void static void
cs3_xfree(const void *p) cs3_xfree(void *p)
{ {
if (p) if (p)
free(p); free(p);