Commit 0a4fc122 authored by Russ Cox's avatar Russ Cox

lib9: restore printing of signed integers

A casualty of https://golang.org/cl/10195044.

If x is an 32-bit int and u is a 64-bit ulong,
        u = (uint)x // converts to uint before extension, so zero fills
        u = (ulong)x // sign-extends

TBR=iant, r
CC=golang-dev
https://golang.org/cl/10814043
parent c1fc8d52
......@@ -387,17 +387,17 @@ __ifmt(Fmt *f)
if(fl & FmtUnsigned)
u = (uchar)va_arg(f->args, int);
else
u = (uchar)(char)va_arg(f->args, int);
u = (ulong)(char)va_arg(f->args, int);
}else if(fl & FmtShort){
if(fl & FmtUnsigned)
u = (ushort)va_arg(f->args, int);
else
u = (ushort)(short)va_arg(f->args, int);
u = (ulong)(short)va_arg(f->args, int);
}else{
if(fl & FmtUnsigned)
u = va_arg(f->args, uint);
else
u = (uint)va_arg(f->args, int);
u = (ulong)va_arg(f->args, int);
}
conv = "0123456789abcdef";
grouping = "\4"; /* for hex, octal etc. (undefined by spec but nice) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment