summaryrefslogtreecommitdiff
path: root/tests/compile/const_decl.pyx
blob: 5424c8f906d718e6fad95df3207f09c281225adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# mode: compile

cdef const_args(const int a, const int *b, const (int*) c, int *const d):
    print a
    print b[0]
    b = NULL    # OK, the pointer itself is not const
    c[0] = 4    # OK, the value is not const
    d[0] = 7    # OK, the value is not const

def call_const_args(x):
    cdef int k = x
    const_args(x, &k, &k, &k)