From 9afe394be9a89ffc5b8b1e5a64ecaa517fd881f9 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 6 Aug 2022 12:41:56 +0100 Subject: [PATCH] adding my fixes to new branch from develop as workflow is caching old expat I think --- .../packages/fbc/extension/FbcExtension.cpp | 12 +++---- .../packages/fbc/extension/FbcExtension.h | 22 ++++++------- .../fbc/extension/FbcReactionPlugin.cpp | 2 +- src/sbml/packages/fbc/sbml/FluxObjective.cpp | 14 ++++---- src/sbml/packages/fbc/sbml/FluxObjective.h | 12 +++---- src/sbml/packages/fbc/sbml/KeyValuePair.cpp | 2 +- .../sbml/UserDefinedConstraintComponent.cpp | 32 +++++++++---------- .../fbc/sbml/UserDefinedConstraintComponent.h | 12 +++---- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/sbml/packages/fbc/extension/FbcExtension.cpp b/src/sbml/packages/fbc/extension/FbcExtension.cpp index 54602d3f96..d0e9559d98 100644 --- a/src/sbml/packages/fbc/extension/FbcExtension.cpp +++ b/src/sbml/packages/fbc/extension/FbcExtension.cpp @@ -701,8 +701,8 @@ LIBSBML_EXTERN const char* FbcVariableType_toString(FbcVariableType_t fvt) { - int min = FBC_FBCVARIABLETYPE_LINEAR; - int max = FBC_FBCVARIABLETYPE_INVALID; + int min = FBC_VARIABLE_TYPE_LINEAR; + int max = FBC_VARIABLE_TYPE_INVALID; if (fvt < min || fvt > max) { @@ -715,7 +715,7 @@ FbcVariableType_toString(FbcVariableType_t fvt) /* * Returns the #FbcVariableType_t enumeration corresponding to the given string - * or @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} if there is + * or @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} if there is * no such match. */ LIBSBML_EXTERN @@ -733,7 +733,7 @@ FbcVariableType_fromString(const char* code) } } - return FBC_FBCVARIABLETYPE_INVALID; + return FBC_VARIABLE_TYPE_INVALID; } @@ -745,8 +745,8 @@ LIBSBML_EXTERN int FbcVariableType_isValid(FbcVariableType_t fvt) { - int min = FBC_FBCVARIABLETYPE_LINEAR; - int max = FBC_FBCVARIABLETYPE_INVALID; + int min = FBC_VARIABLE_TYPE_LINEAR; + int max = FBC_VARIABLE_TYPE_INVALID; if (fvt < min || fvt >= max) { diff --git a/src/sbml/packages/fbc/extension/FbcExtension.h b/src/sbml/packages/fbc/extension/FbcExtension.h index 1053b53c70..32c876e073 100644 --- a/src/sbml/packages/fbc/extension/FbcExtension.h +++ b/src/sbml/packages/fbc/extension/FbcExtension.h @@ -479,9 +479,9 @@ typedef enum */ typedef enum { - FBC_FBCVARIABLETYPE_LINEAR /*!< The fbc fbcvariabletype is @c "linear". */ -, FBC_FBCVARIABLETYPE_QUADRATIC /*!< The fbc fbcvariabletype is @c "quadratic". */ -, FBC_FBCVARIABLETYPE_INVALID /*!< Invalid FbcVariableType value. */ + FBC_VARIABLE_TYPE_LINEAR /*!< The fbc fbcvariabletype is @c "linear". */ +, FBC_VARIABLE_TYPE_QUADRATIC /*!< The fbc fbcvariabletype is @c "quadratic". */ +, FBC_VARIABLE_TYPE_INVALID /*!< Invalid FbcVariableType value. */ } FbcVariableType_t; @@ -494,7 +494,7 @@ typedef enum * "linear", * "quadratic", * "invalid FbcVariableType value", - * or @c NULL if the value is @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, + * or @c NULL if the value is @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, * FbcVariableType_t} or another invalid enumeration value. * * @copydetails doc_returned_unowned_char @@ -510,18 +510,18 @@ FbcVariableType_toString(FbcVariableType_t fvt); /** * Returns the #FbcVariableType_t enumeration corresponding to the given string - * or @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} if there is + * or @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} if there is * no such match. * * @param code the string to convert to a #FbcVariableType_t. * * @return the corresponding #FbcVariableType_t or - * @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} if no match is + * @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} if no match is * found. * * @note The matching is case-sensitive: "linear" will return - * @sbmlconstant{FBC_FBCVARIABLETYPE_LINEAR, FbcVariableType_t}, but "Linear" - * will return @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t}. + * @sbmlconstant{FBC_VARIABLE_TYPE_LINEAR, FbcVariableType_t}, but "Linear" + * will return @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t}. * * @if conly * @memberof Fbc_t @@ -539,9 +539,9 @@ FbcVariableType_fromString(const char* code); * @param fvt the #FbcVariableType_t enumeration to query. * * @return @c 1 (true) if the #FbcVariableType_t is - * @sbmlconstant{FBC_FBCVARIABLETYPE_LINEAR, FbcVariableType_t}, or - * @sbmlconstant{FBC_FBCVARIABLETYPE_QUADRATIC, FbcVariableType_t}; - * @c 0 (false) otherwise (including @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, + * @sbmlconstant{FBC_VARIABLE_TYPE_LINEAR, FbcVariableType_t}, or + * @sbmlconstant{FBC_VARIABLE_TYPE_QUADRATIC, FbcVariableType_t}; + * @c 0 (false) otherwise (including @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, * FbcVariableType_t}). * * @if conly diff --git a/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp b/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp index 32f188982f..d47be04d26 100644 --- a/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp +++ b/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp @@ -185,7 +185,7 @@ FbcReactionPlugin::writeElements (XMLOutputStream& stream) const // dont want to write // so check it actual has something in if (isSetGeneProductAssociation() == true && getLevel() == 3 - && getPackageVersion() == 2 && getGeneProductAssociation()->getAssociation() != NULL) + && getPackageVersion() > 1 && getGeneProductAssociation()->getAssociation() != NULL) { mGeneProductAssociation->write(stream); } diff --git a/src/sbml/packages/fbc/sbml/FluxObjective.cpp b/src/sbml/packages/fbc/sbml/FluxObjective.cpp index 620e81ad24..a51a16b533 100644 --- a/src/sbml/packages/fbc/sbml/FluxObjective.cpp +++ b/src/sbml/packages/fbc/sbml/FluxObjective.cpp @@ -68,7 +68,7 @@ FluxObjective::FluxObjective (unsigned int level, unsigned int version, unsigned , mReaction ("") , mCoefficient (numeric_limits::quiet_NaN()) , mIsSetCoefficient (false) - , mVariableType (FBC_FBCVARIABLETYPE_INVALID) + , mVariableType (FBC_VARIABLE_TYPE_INVALID) { // set an SBMLNamespaces derived object of this package setSBMLNamespacesAndOwn(new FbcPkgNamespaces(level, version, pkgVersion)); @@ -85,7 +85,7 @@ FluxObjective::FluxObjective (FbcPkgNamespaces* fbcns) , mReaction ("") , mCoefficient (numeric_limits::quiet_NaN()) , mIsSetCoefficient (false) - , mVariableType (FBC_FBCVARIABLETYPE_INVALID) + , mVariableType (FBC_VARIABLE_TYPE_INVALID) { // set the element namespace of this object setElementNamespace(fbcns->getURI()); @@ -256,7 +256,7 @@ FluxObjective::isSetCoefficient() const bool FluxObjective::isSetVariableType() const { - return (mVariableType != FBC_FBCVARIABLETYPE_INVALID); + return (mVariableType != FBC_VARIABLE_TYPE_INVALID); } @@ -317,7 +317,7 @@ FluxObjective::setVariableType(const FbcVariableType_t variableType) { if (FbcVariableType_isValid(variableType) == 0) { - mVariableType = FBC_FBCVARIABLETYPE_INVALID; + mVariableType = FBC_VARIABLE_TYPE_INVALID; return LIBSBML_INVALID_ATTRIBUTE_VALUE; } else @@ -347,7 +347,7 @@ FluxObjective::setVariableType(const std::string& variableType) { mVariableType = FbcVariableType_fromString(variableType.c_str()); - if (mVariableType == FBC_FBCVARIABLETYPE_INVALID) + if (mVariableType == FBC_VARIABLE_TYPE_INVALID) { return LIBSBML_INVALID_ATTRIBUTE_VALUE; } @@ -444,7 +444,7 @@ FluxObjective::unsetCoefficient() int FluxObjective::unsetVariableType() { - mVariableType = FBC_FBCVARIABLETYPE_INVALID; + mVariableType = FBC_VARIABLE_TYPE_INVALID; return LIBSBML_OPERATION_SUCCESS; } @@ -1525,7 +1525,7 @@ FluxObjective_getVariableType(const FluxObjective_t * fo) { if (fo == NULL) { - return FBC_FBCVARIABLETYPE_INVALID; + return FBC_VARIABLE_TYPE_INVALID; } return fo->getVariableType(); diff --git a/src/sbml/packages/fbc/sbml/FluxObjective.h b/src/sbml/packages/fbc/sbml/FluxObjective.h index a86cd456ef..47796ac403 100644 --- a/src/sbml/packages/fbc/sbml/FluxObjective.h +++ b/src/sbml/packages/fbc/sbml/FluxObjective.h @@ -235,9 +235,9 @@ class LIBSBML_EXTERN FluxObjective : public SBase * @if clike The value is drawn from the enumeration @ref FbcVariableType_t * @endif * The possible values returned by this method are: - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_LINEAR, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_QUADRATIC, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_LINEAR, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_QUADRATIC, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} */ FbcVariableType_t getVariableType() const; @@ -1167,9 +1167,9 @@ FluxObjective_getCoefficient(const FluxObjective_t * fo); * @if clike The value is drawn from the enumeration @ref FbcVariableType_t * @endif * The possible values returned by this method are: - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_LINEAR, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_QUADRATIC, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_LINEAR, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_QUADRATIC, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} * * @memberof FluxObjective_t */ diff --git a/src/sbml/packages/fbc/sbml/KeyValuePair.cpp b/src/sbml/packages/fbc/sbml/KeyValuePair.cpp index e52beddb24..7fa4118afa 100644 --- a/src/sbml/packages/fbc/sbml/KeyValuePair.cpp +++ b/src/sbml/packages/fbc/sbml/KeyValuePair.cpp @@ -1067,7 +1067,7 @@ KeyValuePair::writeAttributes(XMLOutputStream& stream) const unsigned int version = getVersion(); unsigned int pkgVersion = getPackageVersion(); - if (level == 3 && version == 1 && pkgVersion == 3) + if (level == 3 && pkgVersion == 3) { writeL3V1V3Attributes(stream); } diff --git a/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.cpp b/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.cpp index 7567bd4951..ffb3880e80 100644 --- a/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.cpp +++ b/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.cpp @@ -66,7 +66,7 @@ UserDefinedConstraintComponent::UserDefinedConstraintComponent( , mCoefficient (util_NaN()) , mIsSetCoefficient (false) , mVariable ("") - , mVariableType (FBC_FBCVARIABLETYPE_INVALID) + , mVariableType (FBC_VARIABLE_TYPE_INVALID) { setSBMLNamespacesAndOwn(new FbcPkgNamespaces(level, version, pkgVersion)); } @@ -82,7 +82,7 @@ UserDefinedConstraintComponent::UserDefinedConstraintComponent(FbcPkgNamespaces , mCoefficient (util_NaN()) , mIsSetCoefficient (false) , mVariable ("") - , mVariableType (FBC_FBCVARIABLETYPE_INVALID) + , mVariableType (FBC_VARIABLE_TYPE_INVALID) { setElementNamespace(fbcns->getURI()); loadPlugins(fbcns); @@ -260,7 +260,7 @@ UserDefinedConstraintComponent::isSetVariable() const bool UserDefinedConstraintComponent::isSetVariableType() const { - return (mVariableType != FBC_FBCVARIABLETYPE_INVALID); + return (mVariableType != FBC_VARIABLE_TYPE_INVALID); } @@ -380,7 +380,7 @@ UserDefinedConstraintComponent::setVariableType(const FbcVariableType_t { if (FbcVariableType_isValid(variableType) == 0) { - mVariableType = FBC_FBCVARIABLETYPE_INVALID; + mVariableType = FBC_VARIABLE_TYPE_INVALID; return LIBSBML_INVALID_ATTRIBUTE_VALUE; } else @@ -412,7 +412,7 @@ UserDefinedConstraintComponent::setVariableType(const std::string& { mVariableType = FbcVariableType_fromString(variableType.c_str()); - if (mVariableType == FBC_FBCVARIABLETYPE_INVALID) + if (mVariableType == FBC_VARIABLE_TYPE_INVALID) { return LIBSBML_INVALID_ATTRIBUTE_VALUE; } @@ -514,7 +514,7 @@ UserDefinedConstraintComponent::unsetVariable() int UserDefinedConstraintComponent::unsetVariableType() { - mVariableType = FBC_FBCVARIABLETYPE_INVALID; + mVariableType = FBC_VARIABLE_TYPE_INVALID; return LIBSBML_OPERATION_SUCCESS; } @@ -1060,10 +1060,10 @@ UserDefinedConstraintComponent::readAttributes(const XMLAttributes& attributes, log->logPackageError("fbc", FbcUserDefinedConstraintLOUserDefinedConstraintComponentsAllowedCoreAttributes, pkgVersion, level, version, details, getLine(), getColumn()); } - else if (getErrorLog()->getError((unsigned int)n)->getErrorId() == NotSchemaConformant) - { - getErrorLog()->remove(NotSchemaConformant); - } + else if (getErrorLog()->getError((unsigned int)n)->getErrorId() == NotSchemaConformant) + { + getErrorLog()->remove(NotSchemaConformant); + } } } @@ -1091,10 +1091,10 @@ UserDefinedConstraintComponent::readAttributes(const XMLAttributes& attributes, FbcUserDefinedConstraintComponentAllowedCoreAttributes, pkgVersion, level, version, details, getLine(), getColumn()); } - else if (getErrorLog()->getError((unsigned int)n)->getErrorId() == NotSchemaConformant) - { - getErrorLog()->remove(NotSchemaConformant); - } + else if (getErrorLog()->getError((unsigned int)n)->getErrorId() == NotSchemaConformant) + { + getErrorLog()->remove(NotSchemaConformant); + } } } @@ -1294,7 +1294,7 @@ UserDefinedConstraintComponent::writeAttributes(XMLOutputStream& stream) const unsigned int version = getVersion(); unsigned int pkgVersion = getPackageVersion(); - if (level == 3 && version == 1 && pkgVersion == 3) + if (level == 3 && pkgVersion == 3) { writeL3V1V3Attributes(stream); } @@ -1477,7 +1477,7 @@ UserDefinedConstraintComponent_getVariableType(const { if (udcc == NULL) { - return FBC_FBCVARIABLETYPE_INVALID; + return FBC_VARIABLE_TYPE_INVALID; } return udcc->getVariableType(); diff --git a/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.h b/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.h index bdc407cd5c..ca7a41d5ce 100644 --- a/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.h +++ b/src/sbml/packages/fbc/sbml/UserDefinedConstraintComponent.h @@ -222,9 +222,9 @@ class LIBSBML_EXTERN UserDefinedConstraintComponent : public SBase * @if clike The value is drawn from the enumeration @ref FbcVariableType_t * @endif * The possible values returned by this method are: - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_LINEAR, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_QUADRATIC, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_LINEAR, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_QUADRATIC, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} */ FbcVariableType_t getVariableType() const; @@ -1032,9 +1032,9 @@ UserDefinedConstraintComponent_getVariable(const * @if clike The value is drawn from the enumeration @ref FbcVariableType_t * @endif * The possible values returned by this method are: - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_LINEAR, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_QUADRATIC, FbcVariableType_t} - * @li @sbmlconstant{FBC_FBCVARIABLETYPE_INVALID, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_LINEAR, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_QUADRATIC, FbcVariableType_t} + * @li @sbmlconstant{FBC_VARIABLE_TYPE_INVALID, FbcVariableType_t} * * @memberof UserDefinedConstraintComponent_t */