diff options
author | Igor Gnatenko | 2016-09-21 08:22:35 +0200 |
---|---|---|
committer | Igor Gnatenko | 2016-09-21 08:22:35 +0200 |
commit | 0e0943c15b173015c3ff9475085bd064204f9c74 (patch) | |
tree | 8ac5531bc2d5229d31184551a66655f36b8e2fae | |
parent | libsmartcols: make get_line/column_separator() return const (diff) | |
download | kernel-qcow2-util-linux-0e0943c15b173015c3ff9475085bd064204f9c74.tar.gz kernel-qcow2-util-linux-0e0943c15b173015c3ff9475085bd064204f9c74.tar.xz kernel-qcow2-util-linux-0e0943c15b173015c3ff9475085bd064204f9c74.zip |
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>
-rw-r--r-- | include/debug.h | 2 | ||||
-rw-r--r-- | libfdisk/src/parttype.c | 4 | ||||
-rw-r--r-- | libsmartcols/src/cell.c | 2 | ||||
-rw-r--r-- | libsmartcols/src/column.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/include/debug.h b/include/debug.h index 45c1caade..97c0e1f08 100644 --- a/include/debug.h +++ b/include/debug.h @@ -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; diff --git a/libfdisk/src/parttype.c b/libfdisk/src/parttype.c index 8c36fdf3b..d894cf90d 100644 --- a/libfdisk/src/parttype.c +++ b/libfdisk/src/parttype.c @@ -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); diff --git a/libsmartcols/src/cell.c b/libsmartcols/src/cell.c index f2525cc4c..b887940c9 100644 --- a/libsmartcols/src/cell.c +++ b/libsmartcols/src/cell.c @@ -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; } diff --git a/libsmartcols/src/column.c b/libsmartcols/src/column.c index 6a3b69bf1..cdc87e9b7 100644 --- a/libsmartcols/src/column.c +++ b/libsmartcols/src/column.c @@ -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; |