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
b5f0317c
Commit
b5f0317c
authored
Aug 28, 2020
by
Xavier Thompson
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove const qualifiers from generated code for cypclass methods
parent
1eb5ac89
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+6
-4
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+5
-5
No files found.
Cython/Compiler/Nodes.py
View file @
b5f0317c
...
...
@@ -2680,6 +2680,7 @@ 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
self
.
entry
=
env
.
declare_cfunction
(
name
,
typ
,
self
.
pos
,
...
...
Cython/Compiler/PyrexTypes.py
View file @
b5f0317c
...
...
@@ -1840,8 +1840,6 @@ 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
:
...
...
@@ -1857,6 +1855,8 @@ 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
:
...
...
@@ -2926,12 +2926,14 @@ 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'
]
...
...
@@ -3282,7 +3284,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
:
if
self
.
is_const_method
and
(
not
self
.
is_cyp_class_method
or
for_display
)
:
trailer
+=
" const"
return
"%s%s(%s)%s"
%
(
cc
,
entity_code
,
arg_decl_code
,
trailer
)
...
...
@@ -3293,7 +3295,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
:
if
self
.
is_const_method
and
not
self
.
is_cyp_class_method
:
trailer
=
" const"
else
:
trailer
=
""
...
...
Cython/Utility/CyObjects.cpp
View file @
b5f0317c
...
...
@@ -134,9 +134,9 @@
struct
ActhonResultInterface
:
public
CyObject
{
virtual
void
pushVoidStarResult
(
void
*
result
)
=
0
;
virtual
void
*
getVoidStarResult
()
const
=
0
;
virtual
void
*
getVoidStarResult
()
=
0
;
virtual
void
pushIntResult
(
int
result
)
=
0
;
virtual
int
getIntResult
()
const
=
0
;
virtual
int
getIntResult
()
=
0
;
operator
int
()
{
return
this
->
getIntResult
();
}
operator
void
*
()
{
return
this
->
getVoidStarResult
();
}
};
...
...
@@ -144,8 +144,8 @@
struct
ActhonMessageInterface
;
struct
ActhonSyncInterface
:
public
CyObject
{
virtual
int
isActivable
()
const
=
0
;
virtual
int
isCompleted
()
const
=
0
;
virtual
int
isActivable
()
=
0
;
virtual
int
isCompleted
()
=
0
;
virtual
void
insertActivity
(
ActhonMessageInterface
*
msg
)
=
0
;
virtual
void
removeActivity
(
ActhonMessageInterface
*
msg
)
=
0
;
};
...
...
@@ -161,7 +161,7 @@
struct
ActhonQueueInterface
:
public
CyObject
{
virtual
void
push
(
ActhonMessageInterface
*
message
)
=
0
;
virtual
int
activate
()
=
0
;
virtual
int
is_empty
()
const
=
0
;
virtual
int
is_empty
()
=
0
;
};
struct
ActhonActivableClass
:
public
CyObject
{
...
...
Xavier Thompson
@xavier_thompson
mentioned in commit
9ebbdf8a
·
Sep 11, 2020
mentioned in commit
9ebbdf8a
mentioned in commit 9ebbdf8a1b852180e2814b48995ce44bf81f11d1
Toggle commit list
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