Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Oct 22, 2024
1 parent 228e25a commit 52d0d44
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 21 deletions.
8 changes: 5 additions & 3 deletions src/analyser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ Analyser::AnalyserImpl::AnalyserImpl()
mGeneratorProfile->setAbsoluteValueString("abs");
mGeneratorProfile->setNaturalLogarithmString("ln");
mGeneratorProfile->setCommonLogarithmString("log");
mGeneratorProfile->setMinString("min");
mGeneratorProfile->setMaxString("max");
mGeneratorProfile->setRemString("rem");
mGeneratorProfile->setAsinString("arcsin");
mGeneratorProfile->setAcosString("arccos");
Expand Down Expand Up @@ -2440,9 +2442,9 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model)
+ "' is";
description += hasPrimaryVariable ?
" the" :
(equivalentVariableCount == 1) ?
" its corresponding" :
" their corresponding";
((equivalentVariableCount == 1) ?
" its corresponding" :
" their corresponding");
description += " primary variable and will therefore be the one used as an external variable.";

referenceRule = Issue::ReferenceRule::ANALYSER_EXTERNAL_VARIABLE_USE_PRIMARY_VARIABLE;
Expand Down
1 change: 0 additions & 1 deletion src/analyserexternalvariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
#include "libcellml/analyserexternalvariable.h"

#include "analyserexternalvariable_p.h"
#include "commonutils.h"
#include "utilities.h"

namespace libcellml {
Expand Down
1 change: 0 additions & 1 deletion src/annotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ limitations under the License.
#include "libcellml/variable.h"

#include "anycellmlelement_p.h"
#include "commonutils.h"
#include "internaltypes.h"
#include "issue_p.h"
#include "logger_p.h"
Expand Down
5 changes: 2 additions & 3 deletions src/api/libcellml/generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ class LIBCELLML_EXPORT Generator
* Return the equation code for the given @ref AnalyserEquationAst using @ref GeneratorProfile.
*
* @param ast The @ref AnalyserEquationAst for which we want to generate some code.
* @param generatorProfile The @ref GeneratorProfile, if any, to use to generate the equation code. If no
* @param profile The @ref GeneratorProfile, if any, to use to generate the equation code. If no
* @ref GeneratorProfile is provided then the default @ref GeneratorProfile is used.
*
* @return The equation code as a @c std::string.
*/
static std::string equationCode(const AnalyserEquationAstPtr &ast,
const GeneratorProfilePtr &generatorProfile);
static std::string equationCode(const AnalyserEquationAstPtr &ast, const GeneratorProfilePtr &profile);

/**
* @brief Get the equation code for the given @ref AnalyserEquationAst using a default @ref GeneratorProfile.
Expand Down
1 change: 0 additions & 1 deletion src/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ limitations under the License.
#include "libcellml/reset.h"
#include "libcellml/variable.h"

#include "commonutils.h"
#include "component_p.h"
#include "reset_p.h"
#include "utilities.h"
Expand Down
1 change: 0 additions & 1 deletion src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ limitations under the License.
#include "libcellml/model.h"
#include "libcellml/variable.h"

#include "commonutils.h"
#include "utilities.h"

namespace libcellml {
Expand Down
8 changes: 3 additions & 5 deletions src/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ limitations under the License.
#include "libcellml/units.h"
#include "libcellml/version.h"

#include "commonutils.h"
#include "generator_p.h"
#include "generatorprofilesha1values.h"
#include "generatorprofiletools.h"
Expand Down Expand Up @@ -2152,13 +2151,12 @@ std::string Generator::implementationCode() const
return mPimpl->mCode;
}

std::string Generator::equationCode(const AnalyserEquationAstPtr &ast,
const GeneratorProfilePtr &generatorProfile)
std::string Generator::equationCode(const AnalyserEquationAstPtr &ast, const GeneratorProfilePtr &profile)
{
GeneratorPtr generator = libcellml::Generator::create();

if (generatorProfile != nullptr) {
generator->setProfile(generatorProfile);
if (profile != nullptr) {
generator->setProfile(profile);
}

return generator->mPimpl->generateCode(ast);
Expand Down
1 change: 0 additions & 1 deletion src/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ limitations under the License.
#include "libcellml/variable.h"

#include "anycellmlelement_p.h"
#include "commonutils.h"
#include "issue_p.h"
#include "logger_p.h"
#include "utilities.h"
Expand Down
1 change: 0 additions & 1 deletion src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ limitations under the License.
#include "libcellml/units.h"
#include "libcellml/variable.h"

#include "commonutils.h"
#include "component_p.h"
#include "componententity_p.h"
#include "internaltypes.h"
Expand Down
1 change: 0 additions & 1 deletion src/printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ limitations under the License.
#include "libcellml/variable.h"

#include "anycellmlelement_p.h"
#include "commonutils.h"
#include "internaltypes.h"
#include "issue_p.h"
#include "logger_p.h"
Expand Down
1 change: 0 additions & 1 deletion src/units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ limitations under the License.
#include <string>
#include <vector>

#include "commonutils.h"
#include "units_p.h"
#include "utilities.h"

Expand Down
1 change: 0 additions & 1 deletion src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ limitations under the License.
#include "libcellml/units.h"
#include "libcellml/variable.h"

#include "commonutils.h"
#include "xmldoc.h"
#include "xmlutils.h"

Expand Down
1 change: 1 addition & 0 deletions src/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ limitations under the License.
#include "libcellml/types.h"
#include "libcellml/variable.h"

#include "commonutils.h"
#include "internaltypes.h"
#include "xmldoc.h"

Expand Down
1 change: 0 additions & 1 deletion src/validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ limitations under the License.
#include "libcellml/variable.h"

#include "anycellmlelement_p.h"
#include "commonutils.h"
#include "issue_p.h"
#include "logger_p.h"
#include "namespaces.h"
Expand Down

0 comments on commit 52d0d44

Please sign in to comment.