diff options
author | Josiah Worcester | 2011-06-09 00:52:43 +0200 |
---|---|---|
committer | Karel Zak | 2011-06-14 13:58:33 +0200 |
commit | 95961ee294a7ced0c5911b66d863a880e8f8b386 (patch) | |
tree | 889df1cf1542588da4c847445a19a534ab096284 /text-utils | |
parent | libmount: add mount support for loopdevs (diff) | |
download | kernel-qcow2-util-linux-95961ee294a7ced0c5911b66d863a880e8f8b386.tar.gz kernel-qcow2-util-linux-95961ee294a7ced0c5911b66d863a880e8f8b386.tar.xz kernel-qcow2-util-linux-95961ee294a7ced0c5911b66d863a880e8f8b386.zip |
fdisk, display, hexdump.h: Use standard C types instead of u_int, u_char, u_long, etc.
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/display.c | 32 | ||||
-rw-r--r-- | text-utils/hexdump.h | 4 |
2 files changed, 18 insertions, 18 deletions
diff --git a/text-utils/display.c b/text-utils/display.c index 01805a20f..c700b0279 100644 --- a/text-utils/display.c +++ b/text-utils/display.c @@ -55,11 +55,11 @@ static off_t address; /* address/offset in stream */ static off_t eaddress; /* end address */ static inline void -print(PR *pr, u_char *bp) { +print(PR *pr, unsigned char *bp) { switch(pr->flags) { case F_ADDRESS: - (void)printf(pr->fmt, (quad_t)address); + (void)printf(pr->fmt, (int64_t)address); break; case F_BPAD: (void)printf(pr->fmt, ""); @@ -90,23 +90,23 @@ print(PR *pr, u_char *bp) { { short sval; /* int16_t */ int ival; /* int32_t */ - long long Lval; /* int64_t, quad_t */ + long long Lval; /* int64_t, int64_t */ switch(pr->bcnt) { case 1: - (void)printf(pr->fmt, (quad_t)*bp); + (void)printf(pr->fmt, (int64_t)*bp); break; case 2: memmove(&sval, bp, sizeof(sval)); - (void)printf(pr->fmt, (quad_t)sval); + (void)printf(pr->fmt, (int64_t)sval); break; case 4: memmove(&ival, bp, sizeof(ival)); - (void)printf(pr->fmt, (quad_t)ival); + (void)printf(pr->fmt, (int64_t)ival); break; case 8: memmove(&Lval, bp, sizeof(Lval)); - (void)printf(pr->fmt, (quad_t)Lval); + (void)printf(pr->fmt, (int64_t)Lval); break; } break; @@ -127,23 +127,23 @@ print(PR *pr, u_char *bp) { { unsigned short sval; /* u_int16_t */ unsigned int ival; /* u_int32_t */ - unsigned long long Lval;/* u_int64_t, u_quad_t */ + unsigned long long Lval;/* u_int64_t, u_int64_t */ switch(pr->bcnt) { case 1: - (void)printf(pr->fmt, (u_quad_t)*bp); + (void)printf(pr->fmt, (uint64_t)*bp); break; case 2: memmove(&sval, bp, sizeof(sval)); - (void)printf(pr->fmt, (u_quad_t)sval); + (void)printf(pr->fmt, (uint64_t)sval); break; case 4: memmove(&ival, bp, sizeof(ival)); - (void)printf(pr->fmt, (u_quad_t)ival); + (void)printf(pr->fmt, (uint64_t)ival); break; case 8: memmove(&Lval, bp, sizeof(Lval)); - (void)printf(pr->fmt, (u_quad_t)Lval); + (void)printf(pr->fmt, (uint64_t)Lval); break; } break; @@ -174,9 +174,9 @@ void display(void) register FU *fu; register PR *pr; register int cnt; - register u_char *bp; + register unsigned char *bp; off_t saveaddress; - u_char savech = 0, *savebp; + unsigned char savech = 0, *savebp; while ((bp = get()) != NULL) for (fs = fshead, savebp = bp, saveaddress = address; fs; @@ -212,7 +212,7 @@ void display(void) for (pr = endfu->nextpr; pr; pr = pr->nextpr) switch(pr->flags) { case F_ADDRESS: - (void)printf(pr->fmt, (quad_t)eaddress); + (void)printf(pr->fmt, (int64_t)eaddress); break; case F_TEXT: (void)printf("%s", pr->fmt); @@ -261,7 +261,7 @@ get(void) eaddress = address + nread; return(curp); } - n = fread((char *)curp + nread, sizeof(u_char), + n = fread((char *)curp + nread, sizeof(unsigned char), length == -1 ? need : MIN(length, need), stdin); if (!n) { if (ferror(stdin)) diff --git a/text-utils/hexdump.h b/text-utils/hexdump.h index 3df8629a3..52a64bfe9 100644 --- a/text-utils/hexdump.h +++ b/text-utils/hexdump.h @@ -46,7 +46,7 @@ typedef struct _pr { #define F_U 0x100 /* %_u */ #define F_UINT 0x200 /* %[ouXx] */ #define F_TEXT 0x400 /* no conversions */ - u_int flags; /* flag values */ + unsigned int flags; /* flag values */ int bcnt; /* byte count */ char *cchar; /* conversion character */ char *fmt; /* printf format */ @@ -58,7 +58,7 @@ typedef struct _fu { struct _pr *nextpr; /* next print unit */ #define F_IGNORE 0x01 /* %_A */ #define F_SETREP 0x02 /* rep count set, not default */ - u_int flags; /* flag values */ + unsigned int flags; /* flag values */ int reps; /* repetition count */ int bcnt; /* byte count */ char *fmt; /* format string */ |