diff options
Diffstat (limited to 'src/runtime/print.go')
-rw-r--r-- | src/runtime/print.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/runtime/print.go b/src/runtime/print.go index dd60cdef3..75b652923 100644 --- a/src/runtime/print.go +++ b/src/runtime/print.go @@ -1,12 +1,9 @@ package runtime -// #include <stdio.h> -import "C" - func printstring(s string) { for i := 0; i < len(s); i++ { - C.putchar(C.int(s[i])) + putchar(s[i]) } } @@ -17,29 +14,30 @@ func printuint(n uint) { if prevdigits != 0 { printuint(prevdigits) } - C.putchar(C.int((n % 10) + '0')) + putchar(byte((n % 10) + '0')) } func printint(n int) { // Print integer in signed big-endian base-10 notation, for humans to // read. if n < 0 { - C.putchar('-') + putchar('-') n = -n } printuint(uint(n)) } func printbyte(c uint8) { - C.putchar(C.int(c)) + putchar(c) } func printspace() { - C.putchar(' ') + putchar(' ') } func printnl() { - C.putchar('\n') + putchar('\r') + putchar('\n') } func printitf(msg interface{}) { |