cdef int *p
cdef void *v
cdef int a[5]
- cdef int i
- cdef E e
+ cdef int i=0
+ cdef E e=z
p = a
v = a
p = a + i
p = e + a
p = a - i
p = a - e
+
+f()
cdef void f2(char *argv[]):
pass
+f1(NULL)
x = L
U = x
x = U
+
+spam()
spam, eggs
cdef E f() except spam:
- pass
+ return eggs
+
+f()
cdef int _is_aligned(void *ptr):
return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0
+
+_is_aligned(NULL)
#i = typecheck(x, y)
#i = issubtype(x, y)
x = abs
+
+f()
cdef void foo():
- cdef int bool, int1, int2, int3, int4
+ cdef int bool, int1=0, int2=0, int3=0, int4=0
cdef object obj1, obj2, obj3, obj4
obj1 = 1
obj2 = 2
bool = obj1 < 2 < 3
bool = obj1 < 2 < 3 < 4
bool = int1 < (int2 == int3) < int4
+
+foo()
cdef void foo():
- cdef int i1, i2
- cdef char c1, c2
- cdef char *p1, *p2
+ cdef int i1, i2=0
+ cdef char c1=0, c2
+ cdef char *p1, *p2=NULL
i1 = i2
i1 = c1
p1 = p2
i1 = obj1
p1 = obj1
p1 = "spanish inquisition"
-
\ No newline at end of file
+
+foo()
cdef void blarg(void *y, object z):
foo(<Spam>y)
foo(<Spam>z)
+
+blarg(<void*>None, None)
g = 42
cdef void eggs():
- cdef Spam s1, s2
+ cdef Spam s1, s2=a
cdef int i
s1 = s2
s1 = c
i = s1
-
\ No newline at end of file
+
+eggs()
def f():
- cdef int int1, int2, int3
- cdef char char1
- cdef long long1, long2
- cdef float float1, float2
+ cdef int int1, int2=0, int3=1
+ cdef char char1=0
+ cdef long long1, long2=0
+ cdef float float1, float2=0
cdef double double1
int1 = int2 * int3
int1 = int2 / int3
long1 = long2 * char1
float1 = int1 * float2
double1 = float1 * int2
+
+f()
cdef Grail grail
spam(silly)
spam(grail.silly)
+
+eggs()
cdef void f():
cdef void *p
- cdef char *q
+ cdef char *q=NULL
p = q
+f()
cdef extern (int *[42]) spam, grail, swallow
cdef (int (*)()) brian():
- pass
+ return NULL
+
+brian()
cdef Foo f():
blarg = 1 + 2
+
+f()
cdef void f():
cdef unsigned long x
- cdef object y
+ cdef object y=0
x = y
y = x
+
+f()
cdef extern int fnargfn(int ())
cdef void f():
- cdef void *p
+ cdef void *p=NULL
global ifnp, cpa
ifnp = <int (*)()>p
cdef char *g():
pass
+
+f()
+g()
cdef void spam():
cdef object x
del x[17:42]
+
+spam()
cdef object blarg():
pass
+
+foo()
pass
finally:
pass
+
+f()
b
cdef void f():
- cdef E e
- cdef G g
- cdef int i, j
- cdef float f, h
+ cdef E e=a
+ cdef G g=b
+ cdef int i, j=0
+ cdef float f, h=0
i = j | e
i = e | j
i = j ^ e
# f = j ** e # Cython prohibits this
i = e + g
f = h
+
+f()
cdef void foo():
- cdef int bool, int1, int2
- cdef float float1, float2
- cdef char *ptr1, *ptr2
+ cdef int bool, int1=0, int2=0
+ cdef float float1=0, float2=0
+ cdef char *ptr1=NULL, *ptr2=NULL
cdef int *ptr3
bool = int1 == int2
bool = int1 != int2
bool = int1 == float2
bool = ptr1 is ptr2
bool = ptr1 is not ptr2
-
\ No newline at end of file
+
+foo()
pass
cdef void foo():
- cdef float f
+ cdef float f=0
cdef int i
if blarg(<int> f):
pass
+
+foo()
cdef void f():
"This is a pseudo doc string."
+
+f()
cdef char *f():
raise Exception
+
+f()
cdef void f(D d, E e):
d.m(e)
+
+f(D(),E())
grail()
p = tomato()
+eggs()
cdef int silly() except -1:
pass
+
+spam()
+eggs()
+grail()
+tomato()
+brian()
+silly()
cdef int spam() except -1:
eggs = 42
+spam()
spam = superspam
spam.add_tons(42)
superspam.add_tons(1764)
+
+tomato()
cdef int grail():
pass
+
+grail()
cdef void spam():
- cdef int i, j, k
+ cdef int i, j=0, k=0
for i from 0 <= i < 10:
j = k
else:
j = i
else:
j = k
+
+spam()
if val == ENUMVALUE_1:
pass
-
+somefunction(ENUMVALUE_1)
+somefunction(ENUMVALUE_2)
e = white
i = e
i = e + 1
+
+f()
void pub_api_f():
pass
+
+priv_f()
def f(obj1, obj2, obj3):
- cdef int int1, int2, int3
- cdef float flt1, *ptr1
+ cdef int int1, int2=0, int3=0
+ cdef float flt1, *ptr1=NULL
cdef int array1[42]
+ array1[int2] = 0
int1 = array1[int2]
flt1 = ptr1[int2]
array1[int1] = int2
array1[obj2] = int3
obj1[int2] = obj3
obj1[obj2] = 42
-
\ No newline at end of file
+
+f(None, None, None)
cdef void __stdcall f():
pass
+
+f()
def f():
- cdef int i
+ cdef int i=0
global mylist
del mylist[i]
return
cdef float* f2
f2 = f1 + 1
memcpy(f1, f2, 1)
+
+f()
cdef foo x
map = [FOO]
x = map[0]
+
+func()
(<T> obj).a[0] = 1
b = None
+f(NULL)
cdef void g(int x,):
pass
+
+g(0)
cdef void foo():
- cdef int bool, int1, int2
+ cdef int bool, int1=0, int2=0
bool = int1 < int2
bool = int1 > int2
bool = int1 <= int2
bool = int1 >= int2
-
-
+
+foo()
y = 42
cdef void h(object x) nogil:
- cdef void *p
+ cdef void *p=<void*>None
g2(x)
g2(<object>p)
p = <void *>x
e1()
e2()
+
+f(0)
+h(None)
cdef void spam():
eggs = None
+spam()
cdef void f(obj):
- cdef int i
+ cdef int i=0
cdef char *p
p = <char *>i
obj = <object>p
p = <char *>obj
-
\ No newline at end of file
+
+f(None)