Changeset 1232 for trunk/testcase


Ignore:
Timestamp:
Feb 12, 2004, 4:21:45 PM (22 years ago)
Author:
bird
Message:

Extended to third calling convention syntax.

Location:
trunk/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/testcase/572c.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1231 r1232  
    3737typedef int     (_Optlink   Typedef2Int)(int a, int b, int c, int d);
    3838typedef PTYPE   (_Optlink   Typedef2PType)(int a, int b, int c, int d);
     39
     40
     41
     42
     43
     44
    3945
    4046typedef void    (* _Optlink PTypedef1Void)(int a, int b, int c, int d);
     
    4854typedef int     (_Optlink * PTypedef2Int)(int a, int b, int c, int d);
    4955typedef PTYPE   (_Optlink * PTypedef2PType)(int a, int b, int c, int d);
    50 
     56#ifdef __EMX__
     57/* Alternate writing which should have the same effect I think... */
     58typedef void    _Optlink (* PTypedef3Void)(int a, int b, int c, int d);
     59typedef void *  _Optlink (* PTypedef3PVoid)(int a, int b, int c, int d);
     60typedef int     _Optlink (* PTypedef3Int)(int a, int b, int c, int d);
     61typedef PTYPE   _Optlink (* PTypedef3PType)(int a, int b, int c, int d);
     62#endif
    5163
    5264/*
     
    6678    PTYPE   (_Optlink * PStructMember2PType)(int a, int b, int c, int d);
    6779
     80
     81
     82
     83
     84
     85
     86
    6887} VFT, *PVFT;
    6988
     
    82101int     (_Optlink * PVar2Int)(int a, int b, int c, int d);
    83102PTYPE   (_Optlink * PVar2PType)(int a, int b, int c, int d);
     103
     104
     105
     106
     107
     108
     109
    84110
    85111
     
    96122    int     (_Optlink * pfn2Int)(int a, int b, int c, int d),
    97123    PTYPE   (_Optlink * pfn2PType)(int a, int b, int c, int d)
     124
     125
     126
     127
     128
     129
     130
    98131    )
    99132{
     
    107140    pfn2Int(1,2,3,4);
    108141    pfn2PType(1,2,3,4);
     142
     143
     144
     145
     146
     147
     148
    109149    return 0;
    110150}
     151
     152
     153
     154
     155
     156
     157
    111158
    112159
     
    114161{
    115162    static VFT vft = {CVoid, CPVoid, CInt, CPType,
     163
     164
     165
    116166                      CVoid, CPVoid, CInt, CPType};
    117167
     
    125175    static Typedef2Int        * pfnTypedef2Int    = CInt;
    126176    static Typedef2PType      * pfnTypedef2PType  = CPType;
     177
     178
     179
     180
     181
     182
    127183
    128184    static PTypedef1Void        pfnPTypedef1Void  = CVoid;
     
    136192    static PTypedef2PType       pfnPTypedef2PType = CPType;
    137193
     194
     195
     196
     197
     198
     199
     200
    138201    PVar1Void   = CVoid;
    139202    PVar1PVoid  = CPVoid;
     
    146209    PVar2PType  = CPType;
    147210
     211
     212
     213
     214
     215
     216
    148217
    149218    /* extern functions */
     
    164233    pfnTypedef2PType(1,2,3,4);
    165234
     235
     236
     237
     238
     239
     240
     241
    166242    pfnPTypedef1Void(1,2,3,4);
    167243    pfnPTypedef1PVoid(1,2,3,4);
     
    174250    pfnPTypedef2PType(1,2,3,4);
    175251
     252
     253
     254
     255
     256
     257
    176258
    177259    /* structs */
     
    186268    vft.PStructMember2PType(1,2,3,4);
    187269
     270
     271
     272
     273
     274
     275
     276
    188277    /* variables */
    189278    PVar1Void(1,2,3,4);
     
    199288    /* parameters */
    200289    ParamArgs(CVoid, CPVoid, CInt, CPType,
     290
     291
     292
    201293              CVoid, CPVoid, CInt, CPType);
    202294
  • trunk/testcase/572main.cpp

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1231 r1232  
    7070typedef int     (_Optlink   Typedef2Int)(int a, int b, int c, int d);
    7171typedef PTYPE   (_Optlink   Typedef2PType)(int a, int b, int c, int d);
     72
     73
     74
     75
     76
     77
    7278
    7379typedef void    (* _Optlink PTypedef1Void)(int a, int b, int c, int d);
     
    8187typedef int     (_Optlink * PTypedef2Int)(int a, int b, int c, int d);
    8288typedef PTYPE   (_Optlink * PTypedef2PType)(int a, int b, int c, int d);
     89
     90
     91
     92
     93
     94
     95
    8396
    8497
     
    99112    int     (_Optlink * PStructMember2Int)(int a, int b, int c, int d);
    100113    PTYPE   (_Optlink * PStructMember2PType)(int a, int b, int c, int d);
     114
     115
     116
     117
     118
     119
     120
    101121
    102122} VFT, *PVFT;
     
    116136int     (_Optlink * PVar2Int)(int a, int b, int c, int d);
    117137PTYPE   (_Optlink * PVar2PType)(int a, int b, int c, int d);
     138
     139
     140
     141
     142
     143
    118144
    119145
     
    130156    int     (_Optlink * pfn2Int)(int a, int b, int c, int d),
    131157    PTYPE   (_Optlink * pfn2PType)(int a, int b, int c, int d)
     158
     159
     160
     161
     162
     163
     164
    132165    )
    133166{
     
    141174    pfn2Int(1,2,3,4);
    142175    pfn2PType(1,2,3,4);
     176
     177
     178
     179
     180
     181
    143182    return 0;
    144183}
     184
     185
     186
     187
     188
     189
     190
    145191
    146192
     
    149195{
    150196    static VFT vft = {Void, PVoid, Int, PType,
     197
     198
     199
    151200                      Void, PVoid, Int, PType};
    152201
     
    160209    static Typedef2Int        * pfnTypedef2Int    = Int;
    161210    static Typedef2PType      * pfnTypedef2PType  = PType;
     211
     212
     213
     214
     215
     216
    162217
    163218    static PTypedef1Void        pfnPTypedef1Void  = Void;
     
    170225    static PTypedef2Int         pfnPTypedef2Int   = Int;
    171226    static PTypedef2PType       pfnPTypedef2PType = PType;
     227
     228
     229
     230
     231
     232
    172233
    173234    PVar1Void   = Void;
     
    180241    PVar2Int    = Int;
    181242    PVar2PType  = PType;
    182 
     243#ifdef __EMX__
     244    PVar3Void   = Void;
     245    PVar3PVoid  = PVoid;
     246    PVar3Int    = Int;
     247    PVar3PType  = PType;
     248#endif
    183249
    184250    /* extern functions */
     
    215281    pfnTypedef2Int(1,2,3,4);
    216282    pfnTypedef2PType(1,2,3,4);
     283
     284
     285
     286
     287
     288
    217289
    218290    pfnPTypedef1Void(1,2,3,4);
     
    225297    pfnPTypedef2Int(1,2,3,4);
    226298    pfnPTypedef2PType(1,2,3,4);
     299
     300
     301
     302
     303
     304
    227305
    228306
     
    237315    vft.PStructMember2Int(1,2,3,4);
    238316    vft.PStructMember2PType(1,2,3,4);
     317
     318
     319
     320
     321
     322
    239323
    240324    /* variables */
     
    251335    /* parameters */
    252336    ParamArgs(Void, PVoid, Int, PType,
     337
     338
     339
    253340              Void, PVoid, Int, PType);
    254341
Note: See TracChangeset for help on using the changeset viewer.