1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
#include <string.h>
#include <stdio.h>
void func_ignore(int a, int b, int c)
{
printf("%d\n", a + b + c);
}
void func_intptr(int *i)
{
printf("%d\n", *i);
}
void func_intptr_ret(int *i)
{
*i = 42;
}
int func_strlen(char* p)
{
strcpy(p, "Hello world");
return strlen(p);
}
void func_strfixed(char* p)
{
strcpy(p, "Hello world");
}
void func_ppp(int*** ppp)
{
printf("%d\n", ***ppp);
}
void func_stringp(char** sP)
{
printf("%s\n", *sP);
}
void func_enum(int x)
{
printf("enum: %d\n", x);
}
void func_short(short x1, short x2)
{
printf("short: %hd %hd\n", x1, x2);
}
void func_ushort(unsigned short x1, unsigned short x2)
{
printf("ushort: %hu %hu\n", x1, x2);
}
void func_float(float f1, float f2)
{
printf("%f %f\n", f1, f2);
}
void func_typedef(int x)
{
printf("typedef'd enum: %d\n", x);
}
void func_arrayi(int* a, int N)
{
int i;
printf("array[int]: ");
for (i = 0; i < N; i++)
printf("%d ", a[i]);
printf("\n");
}
void func_arrayf(float* a, int N)
{
int i;
printf("array[float]: ");
for (i = 0; i < N; i++)
printf("%f ", a[i]);
printf("\n");
}
|