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>
}
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;
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;
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);
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;
}
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;