Debian Codegraph @

tests/indent/c.c

raw symbols SCIP
1 #include <stdio.h>
2
3 struct Point {
4 int x;
5 int y;
6 };
7
8 enum Color { RED, GREEN, BLUE };
9
10 int compute(int a, int b) {
11 int values[3] = {1, 2, 3};
12 for (int i = 0; i < 3; i++) {
13 if (values[i] > a) {
14 printf("%d\n", values[i]);
15 } else {
16 a += values[i];
17 }
18 }
19 while (a > 0)
20 a--;
21 if (a > 5)
22 a -= 5;
23 for (int i = 0; i < b; i++)
24 a += i;
25 do
26 a++;
27 while (a < 100);
28 switch (b) {
29 case 1:
30 return a;
31 case 2:
32 return b;
33 default:
34 return 0;
35 }
36 }
37
38 int long_function_name(int the_first_argument, int the_second_argument,
39 int the_third_argument, int the_fourth_argument) {
40 return compute(the_first_argument + the_second_argument,
41 the_third_argument + the_fourth_argument);
42 }
43
44 union Value {
45 int i;
46 float f;
47 };
48
49 void process(int *data, int len) {
50 int matrix[2][2] = {
51 {1, 2},
52 {3, 4},
53 };
54
55 int i = 0;
56 do {
57 data[i] = i;
58 i++;
59 } while (i < len);
60
61 for (i = 0; i < len; i++) {
62 switch (data[i]) {
63 case 0:
64 continue;
65 default:
66 break;
67 }
68 }
69
70 if (len < 0)
71 goto done;
72
73 done:
74 return;
75 }