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
9ebbdf8a
Commit
9ebbdf8a
authored
Sep 10, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Remove const qualifiers from generated code for cypclass methods"
This reverts commit
b5f0317c
.
parent
fb11f2d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+0
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-6
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+5
-5
No files found.
Cython/Compiler/Nodes.py
View file @
9ebbdf8a
...
...
@@ -2693,7 +2693,6 @@ class CFuncDefNode(FuncDefNode):
typ
.
is_const_method
=
self
.
is_const_method
typ
.
is_static_method
=
self
.
is_static_method
typ
.
is_cyp_class_method
=
self
.
is_cyp_class_method
if
'mutable'
in
self
.
modifiers
:
error
(
self
.
pos
,
"Functions cannot be 'mutable'"
)
...
...
Cython/Compiler/PyrexTypes.py
View file @
9ebbdf8a
...
...
@@ -1847,6 +1847,8 @@ class CConstOrVolatileType(BaseType):
def
cv_string
(
self
):
cvstring
=
""
if
self
.
is_cyp_class
:
return
cvstring
if
self
.
is_const
:
cvstring
=
"const "
+
cvstring
if
self
.
is_volatile
:
...
...
@@ -1862,8 +1864,6 @@ class CConstOrVolatileType(BaseType):
def
declaration_code
(
self
,
entity_code
,
for_display
=
0
,
dll_linkage
=
None
,
pyrex
=
0
):
cv
=
self
.
cv_string
()
if
self
.
is_cyp_class
and
not
for_display
:
cv
=
""
if
for_display
or
pyrex
:
return
cv
+
self
.
cv_base_type
.
declaration_code
(
entity_code
,
for_display
,
dll_linkage
,
pyrex
)
else
:
...
...
@@ -2940,14 +2940,12 @@ class CFuncType(CType):
# (used for optimisation overrides)
# is_const_method boolean
# is_static_method boolean
# is_cyp_class_method boolean
is_cfunction
=
1
original_sig
=
None
cached_specialized_types
=
None
from_fused
=
False
is_const_method
=
False
is_cyp_class_method
=
False
subtypes
=
[
'return_type'
,
'args'
]
...
...
@@ -3298,7 +3296,7 @@ class CFuncType(CType):
if
(
not
entity_code
and
cc
)
or
entity_code
.
startswith
(
"*"
):
entity_code
=
"(%s%s)"
%
(
cc
,
entity_code
)
cc
=
""
if
self
.
is_const_method
and
(
not
self
.
is_cyp_class_method
or
for_display
)
:
if
self
.
is_const_method
:
trailer
+=
" const"
return
"%s%s(%s)%s"
%
(
cc
,
entity_code
,
arg_decl_code
,
trailer
)
...
...
@@ -3309,7 +3307,7 @@ class CFuncType(CType):
return
self
.
return_type
.
declaration_code
(
declarator_code
,
for_display
,
dll_linkage
,
pyrex
)
def
function_header_code
(
self
,
func_name
,
arg_code
):
if
self
.
is_const_method
and
not
self
.
is_cyp_class_method
:
if
self
.
is_const_method
:
trailer
=
" const"
else
:
trailer
=
""
...
...
Cython/Utility/CyObjects.cpp
View file @
9ebbdf8a
...
...
@@ -336,9 +336,9 @@
struct
ActhonResultInterface
:
public
CyObject
{
virtual
void
pushVoidStarResult
(
void
*
result
)
=
0
;
virtual
void
*
getVoidStarResult
()
=
0
;
virtual
void
*
getVoidStarResult
()
const
=
0
;
virtual
void
pushIntResult
(
int
result
)
=
0
;
virtual
int
getIntResult
()
=
0
;
virtual
int
getIntResult
()
const
=
0
;
operator
int
()
{
return
this
->
getIntResult
();
}
operator
void
*
()
{
return
this
->
getVoidStarResult
();
}
};
...
...
@@ -346,8 +346,8 @@
struct
ActhonMessageInterface
;
struct
ActhonSyncInterface
:
public
CyObject
{
virtual
int
isActivable
()
=
0
;
virtual
int
isCompleted
()
=
0
;
virtual
int
isActivable
()
const
=
0
;
virtual
int
isCompleted
()
const
=
0
;
virtual
void
insertActivity
(
ActhonMessageInterface
*
msg
)
=
0
;
virtual
void
removeActivity
(
ActhonMessageInterface
*
msg
)
=
0
;
};
...
...
@@ -363,7 +363,7 @@
struct
ActhonQueueInterface
:
public
CyObject
{
virtual
void
push
(
ActhonMessageInterface
*
message
)
=
0
;
virtual
int
activate
()
=
0
;
virtual
int
is_empty
()
=
0
;
virtual
int
is_empty
()
const
=
0
;
};
struct
ActhonActivableClass
:
public
CyObject
{
...
...
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