Commit 9ebbdf8a authored by Xavier Thompson's avatar Xavier Thompson

Revert "Remove const qualifiers from generated code for cypclass methods"

This reverts commit b5f0317c.
parent fb11f2d4
...@@ -2693,7 +2693,6 @@ class CFuncDefNode(FuncDefNode): ...@@ -2693,7 +2693,6 @@ class CFuncDefNode(FuncDefNode):
typ.is_const_method = self.is_const_method typ.is_const_method = self.is_const_method
typ.is_static_method = self.is_static_method typ.is_static_method = self.is_static_method
typ.is_cyp_class_method = self.is_cyp_class_method
if 'mutable' in self.modifiers: if 'mutable' in self.modifiers:
error(self.pos, "Functions cannot be 'mutable'") error(self.pos, "Functions cannot be 'mutable'")
......
...@@ -1847,6 +1847,8 @@ class CConstOrVolatileType(BaseType): ...@@ -1847,6 +1847,8 @@ class CConstOrVolatileType(BaseType):
def cv_string(self): def cv_string(self):
cvstring = "" cvstring = ""
if self.is_cyp_class:
return cvstring
if self.is_const: if self.is_const:
cvstring = "const " + cvstring cvstring = "const " + cvstring
if self.is_volatile: if self.is_volatile:
...@@ -1862,8 +1864,6 @@ class CConstOrVolatileType(BaseType): ...@@ -1862,8 +1864,6 @@ class CConstOrVolatileType(BaseType):
def declaration_code(self, entity_code, def declaration_code(self, entity_code,
for_display = 0, dll_linkage = None, pyrex = 0): for_display = 0, dll_linkage = None, pyrex = 0):
cv = self.cv_string() cv = self.cv_string()
if self.is_cyp_class and not for_display:
cv = ""
if for_display or pyrex: if for_display or pyrex:
return cv + self.cv_base_type.declaration_code(entity_code, for_display, dll_linkage, pyrex) return cv + self.cv_base_type.declaration_code(entity_code, for_display, dll_linkage, pyrex)
else: else:
...@@ -2940,14 +2940,12 @@ class CFuncType(CType): ...@@ -2940,14 +2940,12 @@ class CFuncType(CType):
# (used for optimisation overrides) # (used for optimisation overrides)
# is_const_method boolean # is_const_method boolean
# is_static_method boolean # is_static_method boolean
# is_cyp_class_method boolean
is_cfunction = 1 is_cfunction = 1
original_sig = None original_sig = None
cached_specialized_types = None cached_specialized_types = None
from_fused = False from_fused = False
is_const_method = False is_const_method = False
is_cyp_class_method = False
subtypes = ['return_type', 'args'] subtypes = ['return_type', 'args']
...@@ -3298,7 +3296,7 @@ class CFuncType(CType): ...@@ -3298,7 +3296,7 @@ class CFuncType(CType):
if (not entity_code and cc) or entity_code.startswith("*"): if (not entity_code and cc) or entity_code.startswith("*"):
entity_code = "(%s%s)" % (cc, entity_code) entity_code = "(%s%s)" % (cc, entity_code)
cc = "" cc = ""
if self.is_const_method and (not self.is_cyp_class_method or for_display): if self.is_const_method:
trailer += " const" trailer += " const"
return "%s%s(%s)%s" % (cc, entity_code, arg_decl_code, trailer) return "%s%s(%s)%s" % (cc, entity_code, arg_decl_code, trailer)
...@@ -3309,7 +3307,7 @@ class CFuncType(CType): ...@@ -3309,7 +3307,7 @@ class CFuncType(CType):
return self.return_type.declaration_code(declarator_code, for_display, dll_linkage, pyrex) return self.return_type.declaration_code(declarator_code, for_display, dll_linkage, pyrex)
def function_header_code(self, func_name, arg_code): 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" trailer = " const"
else: else:
trailer = "" trailer = ""
......
...@@ -336,9 +336,9 @@ ...@@ -336,9 +336,9 @@
struct ActhonResultInterface : public CyObject { struct ActhonResultInterface : public CyObject {
virtual void pushVoidStarResult(void* result) = 0; virtual void pushVoidStarResult(void* result) = 0;
virtual void* getVoidStarResult() = 0; virtual void* getVoidStarResult() const = 0;
virtual void pushIntResult(int result) = 0; virtual void pushIntResult(int result) = 0;
virtual int getIntResult() = 0; virtual int getIntResult() const = 0;
operator int() { return this->getIntResult(); } operator int() { return this->getIntResult(); }
operator void*() { return this->getVoidStarResult(); } operator void*() { return this->getVoidStarResult(); }
}; };
...@@ -346,8 +346,8 @@ ...@@ -346,8 +346,8 @@
struct ActhonMessageInterface; struct ActhonMessageInterface;
struct ActhonSyncInterface : public CyObject { struct ActhonSyncInterface : public CyObject {
virtual int isActivable() = 0; virtual int isActivable() const = 0;
virtual int isCompleted() = 0; virtual int isCompleted() const = 0;
virtual void insertActivity(ActhonMessageInterface* msg) = 0; virtual void insertActivity(ActhonMessageInterface* msg) = 0;
virtual void removeActivity(ActhonMessageInterface* msg) = 0; virtual void removeActivity(ActhonMessageInterface* msg) = 0;
}; };
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
struct ActhonQueueInterface : public CyObject { struct ActhonQueueInterface : public CyObject {
virtual void push(ActhonMessageInterface* message) = 0; virtual void push(ActhonMessageInterface* message) = 0;
virtual int activate() = 0; virtual int activate() = 0;
virtual int is_empty() = 0; virtual int is_empty() const = 0;
}; };
struct ActhonActivableClass : public CyObject { struct ActhonActivableClass : public CyObject {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment