OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr24626-2.c] - Blame information for rev 12

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.