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
b23d1c3b
Commit
b23d1c3b
authored
Apr 25, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix array type comparison by considering the size as well as the type
parent
7258ac95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+11
-6
No files found.
Cython/Compiler/PyrexTypes.py
View file @
b23d1c3b
...
...
@@ -2155,12 +2155,6 @@ class CPointerBaseType(CType):
self
.
from_py_function
=
"__Pyx_PyBytes_AsUString"
self
.
exception_value
=
"NULL"
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
CType
):
if
self
.
is_array
and
other
.
is_array
or
self
.
is_ptr
and
other
.
is_ptr
:
return
self
.
base_type
.
same_as
(
other
.
base_type
)
return
False
def
__hash__
(
self
):
return
hash
(
self
.
base_type
)
+
self
.
is_ptr
+
27
# arbitrarily chosen offset
...
...
@@ -2186,6 +2180,12 @@ class CArrayType(CPointerBaseType):
super
(
CArrayType
,
self
).
__init__
(
base_type
)
self
.
size
=
size
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
CType
):
if
self
.
is_array
and
other
.
is_array
and
self
.
size
==
other
.
size
:
return
self
.
base_type
.
same_as
(
other
.
base_type
)
return
False
def
__repr__
(
self
):
return
"<CArrayType %s %s>"
%
(
self
.
size
,
repr
(
self
.
base_type
))
...
...
@@ -2226,6 +2226,11 @@ class CPtrType(CPointerBaseType):
is_ptr
=
1
default_value
=
"0"
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
CType
)
and
other
.
is_ptr
:
return
self
.
base_type
.
same_as
(
other
.
base_type
)
return
False
def
__repr__
(
self
):
return
"<CPtrType %s>"
%
repr
(
self
.
base_type
)
...
...
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