diff options
author | tjr <tjr@FreeBSD.org> | 2002-05-17 06:12:25 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-05-17 06:12:25 +0000 |
commit | b0a96363c8436d22d5069a0d3c94794afc5c0229 (patch) | |
tree | ad080efa6a24fc2c951ac60222c19b76b54e48c8 /usr.bin/hexdump | |
parent | 07338940a0106f3c110e93b1068ebfbfb5892f2b (diff) | |
download | FreeBSD-src-b0a96363c8436d22d5069a0d3c94794afc5c0229.zip FreeBSD-src-b0a96363c8436d22d5069a0d3c94794afc5c0229.tar.gz |
Add support for printing long doubles.
PR: 36783
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r-- | usr.bin/hexdump/display.c | 5 | ||||
-rw-r--r-- | usr.bin/hexdump/hexdump.1 | 2 | ||||
-rw-r--r-- | usr.bin/hexdump/parse.c | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index fdfb174..9da5bf9 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -117,6 +117,7 @@ print(pr, bp) PR *pr; u_char *bp; { + long double ldbl; double f8; float f4; int16_t s2; @@ -149,6 +150,10 @@ print(pr, bp) bcopy(bp, &f8, sizeof(f8)); (void)printf(pr->fmt, f8); break; + case sizeof(long double): + bcopy(bp, &ldbl, sizeof(ldbl)); + (void)printf(pr->fmt, ldbl); + break; } break; case F_INT: diff --git a/usr.bin/hexdump/hexdump.1 b/usr.bin/hexdump/hexdump.1 index 84ae2f1..a004c1d 100644 --- a/usr.bin/hexdump/hexdump.1 +++ b/usr.bin/hexdump/hexdump.1 @@ -276,7 +276,7 @@ Four byte default, one, two and four byte counts supported. .Li \&%E , \&%e , \&%f , .Li \&%G , \&%g .Xc -Eight byte default, four byte counts supported. +Eight byte default, four and twelve byte counts supported. .El .Pp The amount of data interpreted by each format string is the sum of the diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index bd96462..da93e7b 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -313,6 +313,12 @@ isint: cs[2] = '\0'; case 4: pr->bcnt = 4; break; + case sizeof(long double): + cs[2] = '\0'; + cs[1] = cs[0]; + cs[0] = 'L'; + pr->bcnt = sizeof(long double); + break; default: p1[1] = '\0'; badcnt(p1); |