blob: 2ff7c0a93bd271a346edf09d4942244140f36813 [file] [log] [blame]
Vikram S. Adve0b12f2b2001-11-05 00:48:27 +00001#include <stdio.h>
2#include <sys/types.h>
3
4void
5printSByte(char c)
6{
7 putchar(c);
8}
9
10void
11printUByte(unsigned char c)
12{
13 putchar(c);
14}
15
16void
17printShort(short i)
18{
19 printf("%d", i);
20}
21
22void
23printUShort(unsigned short i)
24{
25 printf("%d", i);
26}
27
28void
29printInt(int i)
30{
31 printf("%d", i);
32}
33
34void
35printUInt(unsigned int i)
36{
37 printf("%d", i);
38}
39
40void
41printLong(int64_t l)
42{
43 printf("%d", l);
44}
45
46void
47printULong(uint64_t l)
48{
49 printf("%d", l);
50}
51
52void
53printString(const char* str)
54{
55 printf("%s", str);
56}
57
58void
59printFloat(float f)
60{
61 printf("%g", f);
62}
63
64void
65printDouble(double d)
66{
67 printf("%g", d);
68}
69
70void
71printPointer(void* p)
72{
73 printf("0x%x", p);
74}
75
76#undef TEST_RUNTIME
77#ifdef TEST_RUNTIME
78int
79main(int argc, char** argv)
80{
81 int i;
82 printString("argc = ");
83 printLong(argc);
84 printString(" = (as float) ");
85 printFloat(argc * 1.0);
86 printString(" = (as double) ");
87 printDouble(argc * 1.0);
88 for (i=0; i < argc; i++)
89 {
90 printString("\nargv[");
91 printLong(i);
92 printString("] = ");
93 printString(argv[i]);
94 printString("\t@ ");
95 printPointer(argv[i]);
96 }
97 printString("\n");
98}
99#endif