Skip to contentSkip to conversation

master - format_text: Replace PRI with FMT.

PATCH Alasdair Kergon 1 participant 1 message Dec 11, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=49d486319fa6cb48e693c364ee6d72e4b6c364d2
Commit:        49d486319fa6cb48e693c364ee6d72e4b6c364d2
Parent:        75d4d8e9a42a4709ed40348395b1e75dff4197e8
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Mon Dec 11 15:32:53 2017 +0000
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Mon Dec 11 15:39:25 2017 +0000

format_text: Replace PRI with FMT.

---
 lib/format_text/archiver.c    |    2 +-
 lib/format_text/export.c      |   16 +++++-----
 lib/format_text/format-text.c |   58 ++++++++++++++++++++--------------------
 lib/format_text/text_label.c  |    6 ++--
 4 files changed, 41 insertions(+), 41 deletions(-)
lib/format_text/archiver.c +1 -1
index 3e519ca..1eb6654 100644
@@ -413,7 +413,7 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg,
 			new_pvl->pv = pv;
 			dm_list_add(&new_pvs, &new_pvl->list);
 
-			log_verbose("Set up physical volume for \"%s\" with %" PRIu64
+			log_verbose("Set up physical volume for \"%s\" with " FMTu64
 				    " available sectors.", pv_dev_name(pv), pv_size(pv));
 		}
 
lib/format_text/export.c +8 -8
index 9fede20..e535237 100644
@@ -121,7 +121,7 @@ static int _extend_buffer(struct formatter *f)
 {
 	char *newbuf;
 
-	log_debug_metadata("Doubling metadata output buffer to %" PRIu32,
+	log_debug_metadata("Doubling metadata output buffer to " FMTu32,
 			   f->data.buf.size * 2);
 	if (!(newbuf = dm_realloc(f->data.buf.start,
 				   f->data.buf.size * 2))) {
@@ -561,15 +561,15 @@ static int _print_pvs(struct formatter *f, struct volume_group *vg)
 		if (!_out_list(f, &pv->tags, "tags"))
 			return_0;
 
-		outsize(f, pv->size, "dev_size = %" PRIu64, pv->size);
+		outsize(f, pv->size, "dev_size = " FMTu64, pv->size);
 
-		outf(f, "pe_start = %" PRIu64, pv->pe_start);
+		outf(f, "pe_start = " FMTu64, pv->pe_start);
 		outsize(f, vg->extent_size * (uint64_t) pv->pe_count,
 			"pe_count = %u", pv->pe_count);
 
 		if (pv->ba_start && pv->ba_size) {
-			outf(f, "ba_start = %" PRIu64, pv->ba_start);
-			outsize(f, pv->ba_size, "ba_size = %" PRIu64, pv->ba_size);
+			outf(f, "ba_start = " FMTu64, pv->ba_start);
+			outsize(f, pv->ba_size, "ba_size = " FMTu64, pv->ba_size);
 		}
 
 		_dec_indent(f);
@@ -631,7 +631,7 @@ int out_areas(struct formatter *f, const struct lv_segment *seg,
 		switch (seg_type(seg, s)) {
 		case AREA_PV:
 			if (!(pv = seg_pv(seg, s))) {
-				log_error(INTERNAL_ERROR "Missing PV for area %" PRIu32 " of %s segment of LV %s.",
+				log_error(INTERNAL_ERROR "Missing PV for area " FMTu32 " of %s segment of LV %s.",
 					  s, type, display_lvname(seg->lv));
 				return 0;
 			}
@@ -670,7 +670,7 @@ int out_areas(struct formatter *f, const struct lv_segment *seg,
 
 			break;
 		case AREA_UNASSIGNED:
-			log_error(INTERNAL_ERROR "Invalid type for area %" PRIu32 " of %s segment of LV %s.",
+			log_error(INTERNAL_ERROR "Invalid type for area " FMTu32 " of %s segment of LV %s.",
 				  s, type, display_lvname(seg->lv));
 			return 0;
 		}
@@ -694,7 +694,7 @@ static int _print_timestamp(struct formatter *f,
 			      "%Y-%m-%d %T %z", local_tm))
 			buf[0] = 0;
 
-		outfc(f, buf, "%s = %" PRIu64, name, (uint64_t) ts);
+		outfc(f, buf, "%s = " FMTu64, name, (uint64_t) ts);
 	}
 
 	return 1;
lib/format_text/format-text.c +29 -29

159 lines not on this page · raw message

lib/format_text/text_label.c +3 -3
index c567709..7058f70 100644
@@ -148,7 +148,7 @@ static int _text_write(struct label *label, void *buf)
 		 !xlate64(pvhdr->disk_areas_xl[mda2].size))
 		mda2 = 0;
 
-	log_debug_metadata("%s: Preparing PV label header %s size %" PRIu64 " with"
+	log_debug_metadata("%s: Preparing PV label header %s size " FMTu64 " with"
 			   "%s%.*" PRIu64 "%s%.*" PRIu64 "%s"
 			   "%s%.*" PRIu64 "%s%.*" PRIu64 "%s"
 			   "%s%.*" PRIu64 "%s%.*" PRIu64 "%s"
@@ -352,7 +352,7 @@ static int _update_mda(struct metadata_area *mda, void *baton)
 	mda_set_ignored(mda, rlocn_is_ignored(mdah->raw_locns));
 
 	if (mda_is_ignored(mda)) {
-		log_debug_metadata("Ignoring mda on device %s at offset %"PRIu64,
+		log_debug_metadata("Ignoring mda on device %s at offset " FMTu64,
 				   dev_name(mdac->area.dev),
 				   mdac->area.start);
 		if (!dev_close(mdac->area.dev))
@@ -428,7 +428,7 @@ static int _text_read(struct labeller *l, struct device *dev, void *buf,
 	if (!(ext_version = xlate32(pvhdr_ext->version)))
 		goto out;
 
-	log_debug_metadata("%s: PV header extension version %" PRIu32 " found",
+	log_debug_metadata("%s: PV header extension version " FMTu32 " found",
 			   dev_name(dev), ext_version);
 
 	/* Extension version */