debug: use const void * for ul_debugobj()
We don't modify data it's pointing out and we should not modify it. Also remove casting to void * as gcc will do it automatically (before we had to cast it explicitly to avoid warning on discarding 'const' qualifier). Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
parent
6f9377ab81
commit
0e0943c15b
|
@ -105,7 +105,7 @@ ul_debug(const char *mesg, ...)
|
|||
}
|
||||
|
||||
static inline void __attribute__ ((__format__ (__printf__, 2, 3)))
|
||||
ul_debugobj(void *handler, const char *mesg, ...)
|
||||
ul_debugobj(const void *handler, const char *mesg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ struct fdisk_parttype *fdisk_label_parse_parttype(
|
|||
if (!lb->nparttypes)
|
||||
return NULL;
|
||||
|
||||
DBG(LABEL, ul_debugobj((void *) lb, "parsing '%s' (%s) partition type",
|
||||
DBG(LABEL, ul_debugobj(lb, "parsing '%s' (%s) partition type",
|
||||
str, lb->name));
|
||||
types = lb->parttypes;
|
||||
|
||||
|
@ -321,7 +321,7 @@ struct fdisk_parttype *fdisk_label_parse_parttype(
|
|||
code = strtol(str, &end, 16);
|
||||
|
||||
if (errno || *end != '\0') {
|
||||
DBG(LABEL, ul_debugobj((void *) lb, "parsing failed: %m"));
|
||||
DBG(LABEL, ul_debugobj(lb, "parsing failed: %m"));
|
||||
return NULL;
|
||||
}
|
||||
ret = fdisk_label_get_parttype_from_code(lb, code);
|
||||
|
|
|
@ -234,6 +234,6 @@ int scols_cell_copy_content(struct libscols_cell *dest,
|
|||
if (!rc)
|
||||
dest->userdata = src->userdata;
|
||||
|
||||
DBG(CELL, ul_debugobj((void *) src, "copy into %p", dest));
|
||||
DBG(CELL, ul_debugobj(src, "copy into %p", dest));
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ struct libscols_column *scols_copy_column(const struct libscols_column *cl)
|
|||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
DBG(COL, ul_debugobj((void *) cl, "copy to %p", ret));
|
||||
DBG(COL, ul_debugobj(cl, "copy to %p", ret));
|
||||
|
||||
if (scols_column_set_color(ret, cl->color))
|
||||
goto err;
|
||||
|
|
Loading…
Reference in New Issue