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
9615ebdd
Commit
9615ebdd
authored
Aug 02, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More variable used problems in buffers fixed
parent
d34a5f7e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+2
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-3
tests/run/bufaccess.pyx
tests/run/bufaccess.pyx
+8
-4
No files found.
Cython/Compiler/Buffer.py
View file @
9615ebdd
...
...
@@ -119,6 +119,7 @@ def used_buffer_aux_vars(entry):
buffer_aux
.
buffer_info_var
.
used
=
True
for
s
in
buffer_aux
.
shapevars
:
s
.
used
=
True
for
s
in
buffer_aux
.
stridevars
:
s
.
used
=
True
if
buffer_aux
.
suboffsetvars
:
for
s
in
buffer_aux
.
suboffsetvars
:
s
.
used
=
True
def
put_unpack_buffer_aux_into_scope
(
buffer_aux
,
mode
,
code
):
...
...
Cython/Compiler/ExprNodes.py
View file @
9615ebdd
...
...
@@ -885,9 +885,6 @@ class NameNode(AtomicExprNode):
self
.
type
=
PyrexTypes
.
error_type
self
.
entry
.
used
=
1
if
self
.
entry
.
type
.
is_buffer
:
# Have an rhs temp just in case. All rhs I could
# think of had a single symbol result_code but better
# safe than sorry. Feel free to change this.
import
Buffer
Buffer
.
used_buffer_aux_vars
(
self
.
entry
)
...
...
@@ -964,6 +961,9 @@ class NameNode(AtomicExprNode):
entry
=
self
.
entry
if
entry
:
entry
.
used
=
1
if
entry
.
type
.
is_buffer
:
import
Buffer
Buffer
.
used_buffer_aux_vars
(
entry
)
if
entry
.
utility_code
:
env
.
use_utility_code
(
entry
.
utility_code
)
...
...
tests/run/bufaccess.pyx
View file @
9615ebdd
...
...
@@ -34,14 +34,18 @@ def testcas(a):
# Buffer acquire and release tests
#
@
testcase
def
nousage
():
"""
>>> True
True
The challenge here is just compilation.
"""
cdef
object
[
int
,
2
]
buf
def
printbuf
():
"""
Just compilation.
"""
cdef
object
[
int
,
2
]
buf
# this used not to compile
print
buf
@
testcase
def
acquire_release
(
o1
,
o2
):
...
...
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