1
0
mirror of https://github.com/golang/go synced 2024-11-26 09:08:07 -07:00

runtime: add conversion specifier to printf for char values

R=r, golang-dev
CC=golang-dev
https://golang.org/cl/7327053
This commit is contained in:
Carl Shapiro 2013-02-19 18:05:44 -08:00
parent 66b69a1719
commit 7f9c02a10d
2 changed files with 11 additions and 0 deletions

View File

@ -84,6 +84,7 @@ vprintf(int8 *s, byte *base)
narg = 0;
switch(*p) {
case 't':
case 'c':
narg = arg + 1;
break;
case 'd': // 32-bit
@ -126,6 +127,9 @@ vprintf(int8 *s, byte *base)
case 'a':
runtime·printslice(*(Slice*)v);
break;
case 'c':
runtime·printbyte(*(int8*)v);
break;
case 'd':
runtime·printint(*(int32*)v);
break;
@ -202,6 +206,12 @@ runtime·printbool(bool v)
gwrite((byte*)"false", 5);
}
void
runtime·printbyte(int8 c)
{
gwrite(&c, 1);
}
void
runtime·printfloat(float64 v)
{

View File

@ -817,6 +817,7 @@ void* runtime·getcallerpc(void*);
* runtime go-called
*/
void runtime·printbool(bool);
void runtime·printbyte(int8);
void runtime·printfloat(float64);
void runtime·printint(int64);
void runtime·printiface(Iface);