2 * Structure order error
8 typedef struct dlnode_good
{
9 struct dlnode_good __xdata
* nxt
;
10 struct dlnode_good __xdata
* prv
;
13 typedef dlnode_good __xdata
* dlist_good
;
15 __xdata dlnode_good good
= { &good
, NULL
};
16 __xdata dlist_good gl
= &good
;
19 f0 (const dlist_good
* obj
)
21 return (*obj
) ? (*obj
)->nxt
: 0;
25 f1 (__xdata dlist_good
* obj
)
27 return (*obj
) ? (*obj
)->nxt
: 0;
31 f2 (dlnode_good __xdata
* const * obj
)
33 return (*obj
) ? (*obj
)->nxt
: 0;
37 f3 (dlnode_good __xdata
* __xdata
* obj
)
39 return (*obj
) ? (*obj
)->nxt
: 0;
42 typedef struct dlnode_bad
{
43 struct dlnode_bad __xdata
* prv
;
44 struct dlnode_bad __xdata
* nxt
;
47 typedef dlnode_bad __xdata
* dlist_bad
;
49 __xdata dlnode_bad bad
= { NULL
, &bad
};
50 __xdata dlist_bad bl
= &bad
;
53 f4 (const dlist_bad
* obj
)
55 return (*obj
) ? (*obj
)->nxt
: 0;
59 f5 (__xdata dlist_bad
* obj
)
61 return (*obj
) ? (*obj
)->nxt
: 0;
65 f6 (dlnode_bad __xdata
* const * obj
)
67 return (*obj
) ? (*obj
)->nxt
: 0;
71 f7 (dlnode_bad __xdata
* __xdata
* obj
)
73 return (*obj
) ? (*obj
)->nxt
: 0;
79 ASSERT (f0(&gl
) == &good
);
80 ASSERT (f1(&gl
) == &good
);
81 ASSERT (f2(&gl
) == &good
);
82 ASSERT (f3(&gl
) == &good
);
84 ASSERT (f4(&bl
) == &bad
);
85 ASSERT (f5(&bl
) == &bad
);
86 ASSERT (f6(&bl
) == &bad
);
87 ASSERT (f7(&bl
) == &bad
);