source: trunk/testcase/570c.c@ 596

Last change on this file since 596 was 595, checked in by bird, 22 years ago

More, better.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
RevLine 
[594]1typedef struct some_struct_pointer * PTYPE;
2
3/*
4 * Function and method declarations.
5 * Checks mangling.
6 */
7/* No underscore, No mangling. */
8void _System Void(void);
9void * _System PVoid(void);
10int _System Int(void);
11PTYPE _System PType(void);
12
13/*
14 * Typedefs.
15 * Checks that there is not warnings on these.
16 */
17typedef void _System Typedef1Void(void);
18typedef void * _System Typedef1PVoid(void);
19typedef int _System Typedef1Int(void);
20typedef PTYPE _System Typedef1PType(void);
21
22typedef void (_System Typedef2Void)(void);
23typedef void * (_System Typedef2PVoid)(void);
24typedef int (_System Typedef2Int)(void);
25typedef PTYPE (_System Typedef2PType)(void);
26
27typedef void (* _System PTypedef1Void)(void);
28typedef void * (* _System PTypedef1PVoid)(void);
29typedef int (* _System PTypedef1Int)(void);
30typedef PTYPE (* _System PTypedef1PType)(void);
31
[595]32/* Alternate writing which should have the same effect I think... */
[594]33typedef void (_System * PTypedef2Void)(void);
34typedef void * (_System * PTypedef2PVoid)(void);
35typedef int (_System * PTypedef2Int)(void);
36typedef PTYPE (_System * PTypedef2PType)(void);
37
38
39/*
40 * Structures.
41 */
42typedef struct VFT
43{
44 void (_System * PStructMemberVoid)(void* pvThis);
45 void * (_System * PStructMemberPVoid)(void* pvThis);
46 int (_System * PStructMemberInt)(void* pvThis);
47 PTYPE (_System * PStructMemberPType)(void* pvThis);
[595]48
49 /* Alternate writing which should have the same effect I think... */
50 void ( _System * PStructMember2Void)(void* pvThis);
51 void * ( _System * PStructMember2PVoid)(void* pvThis);
52 int ( _System * PStructMember2Int)(void* pvThis);
53 PTYPE ( _System * PStructMember2PType)(void* pvThis);
54
[594]55} VFT, *PVFT;
56
57
58int DoC(void)
59{
60 VFT vft = {0,0,0,0};
61
62 Void();
63 PVoid();
64 Int();
65 PType();
66
67 if (vft.PStructMemberVoid)
68 vft.PStructMemberVoid(&vft);
69 if (vft.PStructMemberPVoid)
70 vft.PStructMemberPVoid(&vft);
71 if (vft.PStructMemberInt)
72 vft.PStructMemberInt(&vft);
73 if (vft.PStructMemberPType)
74 vft.PStructMemberPType(&vft);
75
76 return 0;
77}
78
Note: See TracBrowser for help on using the repository browser.