From: krw Date: Tue, 19 Apr 2022 17:53:15 +0000 (+0000) Subject: Bring GPT_print_partition() into line with other functions being passed X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eea9397a8b6ba6f19f8ca7b3142a84c8610bf1c6;p=openbsd Bring GPT_print_partition() into line with other functions being passed an index to the gp[] array by calling said parameter 'pn' and making it const unsigned int. No functional change. --- diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index 00e88676a20..7723a0882de 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.68 2022/04/19 17:36:36 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.69 2022/04/19 17:53:15 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller * Copyright (c) 2015 Kenneth R Westerback @@ -393,11 +393,11 @@ GPT_print_parthdr(const int verbosity) } void -GPT_print_part(const int n, const char *units, const int verbosity) +GPT_print_part(const unsigned int pn, const char *units, const int verbosity) { const struct unit_type *ut; struct uuid guid; - struct gpt_partition *partn = &gp[n]; + struct gpt_partition *partn = &gp[pn]; char *guidstr = NULL; double size; uint64_t sectors; @@ -406,8 +406,8 @@ GPT_print_part(const int n, const char *units, const int verbosity) uuid_dec_le(&partn->gp_type, &guid); sectors = letoh64(partn->gp_lba_end) - letoh64(partn->gp_lba_start) + 1; size = units_size(units, sectors, &ut); - printf("%c%3d: %-36s [%12lld: %12.0f%s]\n", - (letoh64(partn->gp_attrs) & GPTDOSACTIVE)?'*':' ', n, + printf("%c%3u: %-36s [%12lld: %12.0f%s]\n", + (letoh64(partn->gp_attrs) & GPTDOSACTIVE)?'*':' ', pn, PRT_uuid_to_typename(&guid), letoh64(partn->gp_lba_start), size, ut->ut_abbr);