1 /* { dg-do compile } */
2 
3 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
4 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
5 typedef u_int32_t db_pgno_t;
6 typedef struct __db DB;
7 typedef struct __db_env DB_ENV;
8 typedef struct __db_mpoolfile DB_MPOOLFILE;
9 typedef struct __dbc DBC;
10 struct __db {
11     DB_MPOOLFILE *mpf;
12     db_pgno_t meta_pgno;
13     struct __cq_aq {
14     } s_links;
15 };
16 struct __db_env {
17     struct {
18     } xa_txn;
19     u_int32_t flags;
20 };
21 typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
22 typedef struct __dbpginfo {
23     u_int8_t type;
24 } PAGE;
25 int __db_cursor ();
26 int __memp_fget ();
27 int __db_free ();
28 int __db_c_close ();
__db_master_update(mdbp,sdbp,txn,subdb,type,action,newname,flags)29 int __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
30   int txn, subdb, type, action, newname, flags;
31   DB *mdbp, *sdbp;
32 {
33     DB_ENV *dbenv;
34     DBC *dbc, *ndbc;
35     PAGE *p, *r;
36     int modify, ret, t_ret;
37     if ((ret = __db_cursor(mdbp, txn, &dbc,
38 			   (((dbenv)->flags & (0x0000002))
39 			    && modify) ? 35 : 0)) != 0)
40 	goto err;
41     switch (action) {
42 	case MU_REMOVE:
43 	    if ((ret = __memp_fget(mdbp->mpf, &sdbp->meta_pgno, 0, &p)) != 0)
44 		goto err;
45 	    if ((((PAGE *)p)->type) == 9) {
46 		if ((ret = __db_free(dbc, r)) != 0) { }
47 	    }
48 	    if ((ret = __db_free(dbc, p)) != 0) {
49 		p = ((void *)0);
50 		goto err;
51 	    }
52 	    p = ((void *)0);
53     }
54  err:
55     if (ndbc != ((void *)0) && (t_ret = __db_c_close(ndbc)) != 0 && ret == 0)
56 	ret = t_ret;
57     return (ret);
58 }
59 
60