Commit 7f9c02a1 authored by Carl Shapiro's avatar Carl Shapiro

runtime: add conversion specifier to printf for char values

R=r, golang-dev
CC=golang-dev
https://golang.org/cl/7327053
parent 66b69a17
...@@ -84,6 +84,7 @@ vprintf(int8 *s, byte *base) ...@@ -84,6 +84,7 @@ vprintf(int8 *s, byte *base)
narg = 0; narg = 0;
switch(*p) { switch(*p) {
case 't': case 't':
case 'c':
narg = arg + 1; narg = arg + 1;
break; break;
case 'd': // 32-bit case 'd': // 32-bit
...@@ -126,6 +127,9 @@ vprintf(int8 *s, byte *base) ...@@ -126,6 +127,9 @@ vprintf(int8 *s, byte *base)
case 'a': case 'a':
runtime·printslice(*(Slice*)v); runtime·printslice(*(Slice*)v);
break; break;
case 'c':
runtime·printbyte(*(int8*)v);
break;
case 'd': case 'd':
runtime·printint(*(int32*)v); runtime·printint(*(int32*)v);
break; break;
...@@ -202,6 +206,12 @@ runtime·printbool(bool v) ...@@ -202,6 +206,12 @@ runtime·printbool(bool v)
gwrite((byte*)"false", 5); gwrite((byte*)"false", 5);
} }
void
runtime·printbyte(int8 c)
{
gwrite(&c, 1);
}
void void
runtime·printfloat(float64 v) runtime·printfloat(float64 v)
{ {
......
...@@ -817,6 +817,7 @@ void* runtime·getcallerpc(void*); ...@@ -817,6 +817,7 @@ void* runtime·getcallerpc(void*);
* runtime go-called * runtime go-called
*/ */
void runtime·printbool(bool); void runtime·printbool(bool);
void runtime·printbyte(int8);
void runtime·printfloat(float64); void runtime·printfloat(float64);
void runtime·printint(int64); void runtime·printint(int64);
void runtime·printiface(Iface); void runtime·printiface(Iface);
......
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