| 1 |
/* { dg-require-effective-target indirect_calls } */ |
| 2 |
|
| 3 |
extern void *ff(void*,int); |
| 4 |
|
| 5 |
struct lpgl { struct lpgl *next; }; |
| 6 |
struct lpgd { struct lpgl *first; }; |
| 7 |
|
| 8 |
typedef int (*xfn)( ); |
| 9 |
static void xDP_IF_EnumGroupsInGroup ( void *a, int b, xfn fn) |
| 10 |
{ |
| 11 |
struct lpgd *lpGData; |
| 12 |
struct lpgl *lpGList; |
| 13 |
|
| 14 |
if( ( lpGData = ff( a, b ) ) == ((void *)0) ) |
| 15 |
return; |
| 16 |
|
| 17 |
if( lpGData->first == ((void *)0) ) |
| 18 |
return; |
| 19 |
lpGList = lpGData->first; |
| 20 |
|
| 21 |
for( ;; ) { |
| 22 |
if( !(*fn)( ) ) |
| 23 |
return; |
| 24 |
if( lpGList->next == ((void *)0) ) |
| 25 |
break; |
| 26 |
lpGList = lpGList->next; |
| 27 |
} |
| 28 |
return; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
static int |
| 33 |
xcbDeletePlayerFromAllGroups() { |
| 34 |
xDP_IF_EnumGroupsInGroup(0, 0, 0); |
| 35 |
return 1; |
| 36 |
} |
| 37 |
|
| 38 |
void xDP_IF_EnumGroups( xfn fn) { |
| 39 |
xDP_IF_EnumGroupsInGroup( 0, 0, fn); |
| 40 |
} |
| 41 |
|
| 42 |
static void xDP_IF_DestroyPlayer () { |
| 43 |
xDP_IF_EnumGroups( xcbDeletePlayerFromAllGroups); |
| 44 |
} |
| 45 |
|
| 46 |
void* foo=xDP_IF_DestroyPlayer; |