summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/c/00154-casts.c
blob: fca4010be5c8f4099a5fde16292abb3f108765f9 (plain)
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
82
83
84
85
86
87
88
89

#define SOME_VAL1    ((MYINT) -1)
#define SOME_VAL2    (-2)
#define SOME_VAL3    -3
#define MULT(X, Y)    (X) *(Y)
#define SOME_JUNK    /*lint -e123 */ (const mytype *) -1

typedef (*my_fcn_ptr_t)(char *, int);
typedef (my_fcn_t)(char *, int);

void foo(void)
{
   uint crc = crc32_calc_full((const UINT8 *) "String", 6);

   crc = crc32_calc_full((const UINT8 *) &crc, sizeof(crc));

   a = (b) - 4;

   a = (UINT) -4;
   a = (UINT) +4;
   a = (UINT) * 4;
   a = (UINT) & 4;

   a = (uint32_t) -pb;
   a = (uint32_t) + pb;
   a = (uint32_t) *pb;
   a = (uint32_t) &pb;

   a = (Uint) - 4;
   a = (Uint) + 4;
   a = (Uint) * 4;
   a = (Uint) & 4;

   a = b * (int) flt;
   a = b * ((int) flt);

   a = b * (int) flt;
   a = b * (INT8) flt;
   a = b * (Uint) flt;

   a = *(int) &b;
   a = *(CHAR) &b;
   a = *(Uint) & b;

   a = (int) *pb;
   a = (CHAR) *pb;
   a = (Uint) * pb;

   a = (int) 'a';
   a = (UINT8) 'a';
   a = (Uint) 'a';

   a = (int) *'a';
   a = (UINT8) * 'a';
   a = (Uint) * 'a';

   a = (int) *5;
   a = (UINT) * 5;
   a = (Uint) * 5;

   a = (int) *ape;
   a = (UINT) *ape;
   a = (Uint) * ape;

   a = (int) ape;
   a = (UINT) ape;
   a = (Uint) ape;

   a = (int) sizeof(x);
   a = (INT16) sizeof(x);
   a = (Uint) sizeof(x);

   a = (int) foo(x);
   a = (CHAR) foo(x);
   a = (Uint) foo(x);

   a = (int) (x);
   a = (CHAR) (x);
   a = (Uint) (x);

   a = (int) *(x);
   a = (CHAR) *(x);
   a = (Uint) * (x);

   a = (unsigned int) (1 + 4);
   a = (int) (1 + 1);
   a = (void *) (&str);
}