From: Zdenek Kabelac Date: Fri, 18 Feb 2011 14:38:47 +0000 (+0000) Subject: API change - support more const arg X-Git-Tag: v2_02_91~1097 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=2f321615f22a9fef2eaa0258d62c49212f52a8b0;p=lvm2.git API change - support more const arg As dm_report_field_string() doesn't modify content of data pointer, it can be marked as const. It's slight API change - but doesn't require any change on the user side and supports wider range of arguments without const casting. (i.e. we may use as paramater const lv struct this way: &lv->name) --- diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 004b225d1..234989847 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.64 - =================================== + Change dm_report_field_string() API to accept const char *const *data. Version 1.02.63 - 9th February 2011 =================================== diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index 297b2c675..ac403e8b0 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -1123,7 +1123,7 @@ int dm_report_set_output_field_name_prefix(struct dm_report *rh, * They take care of allocating copies of the data. */ int dm_report_field_string(struct dm_report *rh, struct dm_report_field *field, - const char **data); + const char *const *data); int dm_report_field_int32(struct dm_report *rh, struct dm_report_field *field, const int32_t *data); int dm_report_field_uint32(struct dm_report *rh, struct dm_report_field *field, diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 4f47c46ea..021228414 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -102,7 +102,7 @@ static const struct dm_report_object_type *_find_type(struct dm_report *rh, */ int dm_report_field_string(struct dm_report *rh, - struct dm_report_field *field, const char **data) + struct dm_report_field *field, const char *const *data) { char *repstr;