From: Karel Zak Date: Tue, 3 Mar 2009 15:00:39 +0000 (+0100) Subject: blkid: use "char **" rather than "unsigned char **" X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d042d0d26af5a1ef2a83ae3d2dfa5b276cb4403;p=util-linux blkid: use "char **" rather than "unsigned char **" Use "char" to be consistent with the old high level API. Signed-off-by: Karel Zak --- diff --git a/libs/blkid/bin/blkid.c b/libs/blkid/bin/blkid.c index 868897ac..488b9b9d 100644 --- a/libs/blkid/bin/blkid.c +++ b/libs/blkid/bin/blkid.c @@ -323,7 +323,7 @@ static void print_tags(blkid_dev dev, char *show[], int numtag, int output) static int lowprobe_device(blkid_probe pr, const char *devname, int output, blkid_loff_t offset, blkid_loff_t size) { - unsigned char *data; + const char *data; const char *name; int nvals = 0, n; size_t len; diff --git a/libs/blkid/src/blkid.h b/libs/blkid/src/blkid.h index 06eba12b..ea5b3eb3 100644 --- a/libs/blkid/src/blkid.h +++ b/libs/blkid/src/blkid.h @@ -159,9 +159,9 @@ extern int blkid_do_safeprobe(blkid_probe pr); extern int blkid_probe_numof_values(blkid_probe pr); extern int blkid_probe_get_value(blkid_probe pr, int num, const char **name, - unsigned char **data, size_t *len); + const char **data, size_t *len); extern int blkid_probe_lookup_value(blkid_probe pr, const char *name, - unsigned char **data, size_t *len); + const char **data, size_t *len); extern int blkid_probe_has_value(blkid_probe pr, const char *name); #ifdef __cplusplus diff --git a/libs/blkid/src/evaluate.c b/libs/blkid/src/evaluate.c index a3aaf151..e2acee7c 100644 --- a/libs/blkid/src/evaluate.c +++ b/libs/blkid/src/evaluate.c @@ -44,7 +44,7 @@ static int verify_tag(const char *devname, const char *name, const char *value) blkid_probe pr; int fd = -1, rc = -1; size_t len; - unsigned char *data; + const char *data; pr = blkid_new_probe(); if (!pr) diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 449ee819..0fd3c101 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -860,7 +860,7 @@ int blkid_probe_set_uuid(blkid_probe pr, unsigned char *uuid) } int blkid_probe_get_value(blkid_probe pr, int num, const char **name, - unsigned char **data, size_t *len) + const char **data, size_t *len) { struct blkid_prval *v; @@ -871,7 +871,7 @@ int blkid_probe_get_value(blkid_probe pr, int num, const char **name, if (name) *name = v->name; if (data) - *data = v->data; + *data = (char *) v->data; if (len) *len = v->len; @@ -880,7 +880,7 @@ int blkid_probe_get_value(blkid_probe pr, int num, const char **name, } int blkid_probe_lookup_value(blkid_probe pr, const char *name, - unsigned char **data, size_t *len) + const char **data, size_t *len) { int i; @@ -892,7 +892,7 @@ int blkid_probe_lookup_value(blkid_probe pr, const char *name, if (v->name && strcmp(name, v->name) == 0) { if (data) - *data = v->data; + *data = (char *) v->data; if (len) *len = v->len; DBG(DEBUG_LOWPROBE, printf("returning %s value\n", v->name)); diff --git a/libs/blkid/src/verify.c b/libs/blkid/src/verify.c index 7f795a42..40ab4c67 100644 --- a/libs/blkid/src/verify.c +++ b/libs/blkid/src/verify.c @@ -22,7 +22,7 @@ static void blkid_probe_to_tags(blkid_probe pr, blkid_dev dev) { - unsigned char *data; + const char *data; const char *name; int nvals, n; size_t len; @@ -31,7 +31,7 @@ static void blkid_probe_to_tags(blkid_probe pr, blkid_dev dev) for (n = 0; n < nvals; n++) { if (blkid_probe_get_value(pr, n, &name, &data, &len) == 0) - blkid_set_tag(dev, name, (char *) data, len); + blkid_set_tag(dev, name, data, len); } }