diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-01-07 04:39:09 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-01-07 04:39:09 +0100 |
commit | 3e38194d72b2b017b85bf85f11ef4e580d44be4f (patch) | |
tree | d7eba462a903793200bce8aa0b8bc10836244eb5 /sys/src/libc | |
parent | 59245c73f0645e4e2ca1b01b3e3551dbbc5273d9 (diff) |
introduce signed intptr and %z format modifier for formating uintptr and intptr
Diffstat (limited to 'sys/src/libc')
-rw-r--r-- | sys/src/libc/fmt/dofmt.c | 5 | ||||
-rw-r--r-- | sys/src/libc/fmt/fmt.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/src/libc/fmt/dofmt.c b/sys/src/libc/fmt/dofmt.c index 95852f5c2..bb6ee99a5 100644 --- a/sys/src/libc/fmt/dofmt.c +++ b/sys/src/libc/fmt/dofmt.c @@ -504,6 +504,11 @@ _flagfmt(Fmt *f) f->flags |= FmtVLong; f->flags |= FmtLong; break; + case 'z': + f->flags |= FmtLong; + if(sizeof(uintptr) == sizeof(uvlong)) + f->flags |= FmtVLong; + break; } return 1; } diff --git a/sys/src/libc/fmt/fmt.c b/sys/src/libc/fmt/fmt.c index a1dee68d5..84f4004b5 100644 --- a/sys/src/libc/fmt/fmt.c +++ b/sys/src/libc/fmt/fmt.c @@ -48,6 +48,7 @@ static Convfmt knownfmt[] = { 's', _strfmt, 'u', _flagfmt, 'x', _ifmt, + 'z', _flagfmt, 0, nil, }; |