Use standard uint*_t instead of u_int*_t

Fixes some compilation issues on musl libc. uint*_t is already used so
this should not introduce any new issues.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/193
Signed-off-by: Sertonix <sertonix@posteo.net>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Sertonix
2025-10-28 08:43:45 +01:00
committed by Jan Höppner
parent 0ff130ed84
commit 0ea693d95c
8 changed files with 174 additions and 164 deletions
+10 -9
View File
@@ -8,6 +8,7 @@
*/
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/sysmacros.h>
@@ -211,9 +212,9 @@ static void setpos(fdasd_anchor_t *anc, int dsn, int pos)
anc->partno[dsn] = pos;
}
static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
static uint32_t get_usable_cylinders(fdasd_anchor_t *anc)
{
u_int32_t cyl;
uint32_t cyl;
/* large volume */
if (anc->f4->DS4DEVCT.DS4DSCYL == LV_COMPAT_CYL &&
@@ -221,7 +222,7 @@ static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
return anc->f4->DS4DCYL;
/* normal volume */
if (anc->f4->DS4DEVCT.DS4DEVFG & ALTERNATE_CYLINDERS_USED)
cyl = anc->f4->DS4DEVCT.DS4DSCYL - (u_int16_t)anc->f4->DS4DEVAC;
cyl = anc->f4->DS4DEVCT.DS4DSCYL - (uint16_t)anc->f4->DS4DEVAC;
else
cyl = anc->f4->DS4DEVCT.DS4DSCYL;
@@ -230,7 +231,7 @@ static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
static void get_addr_of_highest_f1_f8_label(fdasd_anchor_t *anc, cchhb_t *addr)
{
u_int8_t record;
uint8_t record;
/* We have to count the following labels:
* one format 4
* one format 5
@@ -2470,9 +2471,9 @@ static int fdasd_get_partition_data(fdasd_anchor_t *anc, extent_t *part_extent,
unsigned long start, stop, limit;
partition_info_t *part_tmp;
cchh_t llimit, ulimit;
u_int16_t hh, head;
u_int32_t cc, cyl;
u_int8_t b1, b2;
uint16_t hh, head;
uint32_t cc, cyl;
uint8_t b1, b2;
char mesg[48];
start = FIRST_USABLE_TRK;
@@ -2777,8 +2778,8 @@ static void fdasd_auto_partition(fdasd_anchor_t *anc)
{
partition_info_t *part_info = anc->first;
cchh_t llimit, ulimit;
u_int16_t head;
u_int32_t cyl;
uint16_t head;
uint32_t cyl;
extent_t ext;
cchhb_t hf1;
+6 -4
View File
@@ -10,6 +10,8 @@
#ifndef FDASD_H
#define FDASD_H
#include <stdint.h>
/*****************************************************************************
* SECTION: Definitions needed for DASD-API (see dasd.h) *
*****************************************************************************/
@@ -67,7 +69,7 @@ static struct fdasd_options options = {
};
typedef struct partition_info {
u_int8_t used;
uint8_t used;
unsigned long start_trk;
unsigned long end_trk;
unsigned long len_trk;
@@ -100,7 +102,7 @@ typedef struct fdasd_anchor {
int option_reuse;
int option_recreate;
int partno[USABLE_PARTITIONS];
u_int16_t dev_type;
uint16_t dev_type;
unsigned int used_partitions;
unsigned long label_pos;
unsigned int blksize;
@@ -113,8 +115,8 @@ typedef struct fdasd_anchor {
partition_info_t *last;
volume_label_t *vlabel;
config_data_t confdata[USABLE_PARTITIONS];
u_int32_t hw_cylinders;
u_int32_t formatted_cylinders;
uint32_t hw_cylinders;
uint32_t formatted_cylinders;
} fdasd_anchor_t;
enum offset {lower, upper};