Stop taking detour through unit_types[SECTORS] to find
authorkrw <krw@openbsd.org>
Sun, 12 Sep 2021 16:36:52 +0000 (16:36 +0000)
committerkrw <krw@openbsd.org>
Sun, 12 Sep 2021 16:36:52 +0000 (16:36 +0000)
commit1629ab0b877b9526b0b9b0f63eac0a3dd886e0a2
tree8d1ed88554d234587836908fed784c11a4918f93
parent92581b4cedb99299ecfac08eef7bc84be0ecd5ce
Stop taking detour through unit_types[SECTORS] to find
dl.d_secsize.

Leave unit_types[SECTORS].ut_conversion at 0, and test that to
determine if a size needs to be converted from a sectors value.

Use consistent dance to find the desired size value to print.

Logic is clearer, unit_types[] is now const, nobody but misc.c
knows about SECTORS.

No intentional functional change.
sbin/fdisk/disk.c
sbin/fdisk/gpt.c
sbin/fdisk/misc.c
sbin/fdisk/misc.h
sbin/fdisk/part.c