[Cython] Fix compilation issue when using Clang
Cherry-pick of trunk r2663.
This commit is contained in:
parent
2628cb760c
commit
c865843d8a
2 changed files with 9 additions and 3 deletions
|
|
@ -725,7 +725,7 @@ cdef class ReactionPathDiagram:
|
||||||
cdef Kinetics kinetics
|
cdef Kinetics kinetics
|
||||||
cdef str element
|
cdef str element
|
||||||
cdef pybool built
|
cdef pybool built
|
||||||
cdef CxxStringStream _log
|
cdef CxxStringStream* _log
|
||||||
|
|
||||||
# free functions
|
# free functions
|
||||||
cdef string stringify(x)
|
cdef string stringify(x)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
cdef class ReactionPathDiagram:
|
cdef class ReactionPathDiagram:
|
||||||
|
def __cinit__(self, *args, **kwargs):
|
||||||
|
self._log = new CxxStringStream()
|
||||||
|
|
||||||
|
def __dealloc__(self):
|
||||||
|
del self._log
|
||||||
|
|
||||||
def __init__(self, Kinetics kin, str element):
|
def __init__(self, Kinetics kin, str element):
|
||||||
"""
|
"""
|
||||||
Create a reaction path diagram for the fluxes of the element *element*
|
Create a reaction path diagram for the fluxes of the element *element*
|
||||||
|
|
@ -6,7 +12,7 @@ cdef class ReactionPathDiagram:
|
||||||
*kin*.
|
*kin*.
|
||||||
"""
|
"""
|
||||||
self.kinetics = kin
|
self.kinetics = kin
|
||||||
self.builder.init(self._log, deref(kin.kinetics))
|
self.builder.init(deref(self._log), deref(kin.kinetics))
|
||||||
self.element = element
|
self.element = element
|
||||||
self.built = False
|
self.built = False
|
||||||
|
|
||||||
|
|
@ -163,7 +169,7 @@ cdef class ReactionPathDiagram:
|
||||||
return representations of the diagram, e.g. write_dot().
|
return representations of the diagram, e.g. write_dot().
|
||||||
"""
|
"""
|
||||||
self.builder.build(deref(self.kinetics.kinetics),
|
self.builder.build(deref(self.kinetics.kinetics),
|
||||||
stringify(self.element), self._log,
|
stringify(self.element), deref(self._log),
|
||||||
self.diagram, True)
|
self.diagram, True)
|
||||||
self.built = True
|
self.built = True
|
||||||
if verbose:
|
if verbose:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue