Debian Codegraph @

gcc/testsuite/gcc.dg/sso/dump.h

raw
1 #ifdef __nvptx__
2 /* Force function call. NVPTX's IO is extremely limited. */
3 #undef putchar
4 #endif
5
6 void dump (void *p, unsigned int len)
7 {
8 const char digits[17] = "0123456789abcdef";
9 unsigned char *a = (unsigned char *)p;
10 int i;
11
12 for (i = 0; i < len; i++)
13 {
14 putchar (' ');
15 putchar (digits[a[i] / 16]);
16 putchar (digits[a[i] % 16]);
17 }
18 }
19
20 void put (const char s[])
21 {
22 int i;
23 for (i = 0; s[i]; i++)
24 putchar (s[i]);
25 }
26
27 void new_line (void)
28 {
29 putchar ('\n');
30 }