Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
07aaffae
Commit
07aaffae
authored
6 years ago
by
mattip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: fix test to use correct macros, functions for c-level getters
parent
a6ec7fb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
tests/run/ext_attr_getter.srctree
tests/run/ext_attr_getter.srctree
+15
-15
No files found.
tests/run/ext_attr_getter.srctree
View file @
07aaffae
...
@@ -38,23 +38,23 @@ typedef struct {
...
@@ -38,23 +38,23 @@ typedef struct {
} FooStructOpaque;
} FooStructOpaque;
#define PyFoo_GET0
(a) a.
f0
#define PyFoo_GET0
M(a) ((FooStructNominal*)a)->
f0
#define PyFoo_GET1
(a) a.
f1
#define PyFoo_GET1
M(a) ((FooStructNominal*)a)->
f1
#define PyFoo_GET2
(a) a.
f2
#define PyFoo_GET2
M(a) ((FooStructNominal*)a)->
f2
int PyFoo_Get0
(FooStructNominal
f)
int PyFoo_Get0
F(FooStructOpaque *
f)
{
{
return
f.
f0;
return
((FooStructNominal*)f)->
f0;
}
}
int PyFoo_Get1
(FooStructNominal
f)
int PyFoo_Get1
F(FooStructOpaque *
f)
{
{
return
f.
f1;
return
((FooStructNominal*)f)->
f1;
}
}
int PyFoo_Get2
(FooStructNominal
f)
int PyFoo_Get2
F(FooStructOpaque *
f)
{
{
return
f.
f2;
return
((FooStructNominal*)f)->
f2;
}
}
#ifdef __cplusplus
#ifdef __cplusplus
...
@@ -124,19 +124,19 @@ cdef extern from "foo.h":
...
@@ -124,19 +124,19 @@ cdef extern from "foo.h":
ctypedef class foo_extension.Foo [object FooStructOpaque, check_size ignore]:
ctypedef class foo_extension.Foo [object FooStructOpaque, check_size ignore]:
@property
@property
cdef int field0(self):
cdef int field0(self):
return PyFoo_GET0(self)
return PyFoo_GET0
M
(self)
@property
@property
cdef int field1(self):
cdef int field1(self):
return PyFoo_Get1(self)
return PyFoo_Get1
F
(self)
@property
@property
cdef int field2(self):
cdef int field2(self):
return PyFoo_GET2(self)
return PyFoo_GET2
M
(self)
int PyFoo_GET0(Foo); # this is actually a macro !
int PyFoo_GET0
M
(Foo); # this is actually a macro !
int PyFoo_Get1(Foo);
int PyFoo_Get1
F
(Foo);
int PyFoo_GET2(Foo); # this is actually a macro !
int PyFoo_GET2
M
(Foo); # this is actually a macro !
def sum(Foo f):
def sum(Foo f):
# Note - not a cdef function but compiling the f.__getattr__('field0')
# Note - not a cdef function but compiling the f.__getattr__('field0')
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment