From d109e9a31ed25856477642126c85b68bebdf839c Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Wed, 26 Nov 2025 10:53:23 +1300 Subject: [PATCH 1/5] Remove all unnecessary headers according to Qt Creator on macOS. --- src/analyser_p.h | 4 +++- src/analysermodel_p.h | 2 ++ src/anycellmlelement_p.h | 2 ++ src/api/libcellml/analyserequation.h | 3 +++ src/api/libcellml/analyserequationast.h | 1 - src/api/libcellml/analyserexternalvariable.h | 6 +++--- src/api/libcellml/analysermodel.h | 3 +++ src/api/libcellml/analyservariable.h | 2 ++ src/api/libcellml/entity.h | 1 - src/api/libcellml/generator.h | 1 - src/api/libcellml/logger.h | 3 --- src/api/libcellml/parentedentity.h | 2 -- src/api/libcellml/types.h | 2 -- src/api/libcellml/units.h | 1 - src/bindings/interface/generator.i | 1 + src/component.cpp | 6 +++--- src/component_p.h | 2 +- src/componententity.cpp | 3 --- src/entity.cpp | 2 -- src/generator.cpp | 5 +---- src/generatorprofiletools.cpp | 4 ++-- src/importer.cpp | 3 --- src/importsource.cpp | 5 ----- src/logger.cpp | 1 - src/model.cpp | 7 ------- src/printer.cpp | 7 ------- src/reset.cpp | 5 ----- src/types.cpp | 5 ----- src/units.cpp | 1 - src/utilities.cpp | 1 - src/validator.cpp | 2 -- src/variable.cpp | 1 - 32 files changed, 26 insertions(+), 68 deletions(-) diff --git a/src/analyser_p.h b/src/analyser_p.h index da773b43b5..a0ee8e789a 100644 --- a/src/analyser_p.h +++ b/src/analyser_p.h @@ -14,9 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ +#include "libcellml/issue.h" +#include "libcellml/generatorprofile.h" + #include "analysermodel_p.h" #include "internaltypes.h" -#include "issue_p.h" #include "logger_p.h" #include "utilities.h" diff --git a/src/analysermodel_p.h b/src/analysermodel_p.h index 6e3af87fe2..41d3f5e9f5 100644 --- a/src/analysermodel_p.h +++ b/src/analysermodel_p.h @@ -16,6 +16,8 @@ limitations under the License. #pragma once +#include + #include "libcellml/analysermodel.h" namespace libcellml { diff --git a/src/anycellmlelement_p.h b/src/anycellmlelement_p.h index c850e8ea34..9f84ae4d0f 100644 --- a/src/anycellmlelement_p.h +++ b/src/anycellmlelement_p.h @@ -18,6 +18,8 @@ limitations under the License. #include +#include "libcellml/types.h" + namespace libcellml { /** diff --git a/src/api/libcellml/analyserequation.h b/src/api/libcellml/analyserequation.h index 46b63abbcf..7fcb8d367b 100644 --- a/src/api/libcellml/analyserequation.h +++ b/src/api/libcellml/analyserequation.h @@ -16,6 +16,9 @@ limitations under the License. #pragma once +#include +#include + #include "libcellml/analyser.h" namespace libcellml { diff --git a/src/api/libcellml/analyserequationast.h b/src/api/libcellml/analyserequationast.h index 2b805708de..2467de1126 100644 --- a/src/api/libcellml/analyserequationast.h +++ b/src/api/libcellml/analyserequationast.h @@ -17,7 +17,6 @@ limitations under the License. #pragma once #include "libcellml/analyser.h" - #include "libcellml/undefines.h" namespace libcellml { diff --git a/src/api/libcellml/analyserexternalvariable.h b/src/api/libcellml/analyserexternalvariable.h index 12e12f719c..2f37eca126 100644 --- a/src/api/libcellml/analyserexternalvariable.h +++ b/src/api/libcellml/analyserexternalvariable.h @@ -16,12 +16,12 @@ limitations under the License. #pragma once -#include "libcellml/exportdefinitions.h" -#include "libcellml/types.h" - #include #include +#include "libcellml/exportdefinitions.h" +#include "libcellml/types.h" + namespace libcellml { /** diff --git a/src/api/libcellml/analysermodel.h b/src/api/libcellml/analysermodel.h index 51ae378d0d..12806e6764 100644 --- a/src/api/libcellml/analysermodel.h +++ b/src/api/libcellml/analysermodel.h @@ -16,6 +16,9 @@ limitations under the License. #pragma once +#include +#include + #include "libcellml/analyser.h" #ifndef SWIG diff --git a/src/api/libcellml/analyservariable.h b/src/api/libcellml/analyservariable.h index d664a8cc9b..37c304e78e 100644 --- a/src/api/libcellml/analyservariable.h +++ b/src/api/libcellml/analyservariable.h @@ -16,6 +16,8 @@ limitations under the License. #pragma once +#include + #include "libcellml/analyser.h" namespace libcellml { diff --git a/src/api/libcellml/entity.h b/src/api/libcellml/entity.h index 75302ec51d..70c694add6 100644 --- a/src/api/libcellml/entity.h +++ b/src/api/libcellml/entity.h @@ -16,7 +16,6 @@ limitations under the License. #pragma once -#include #include #include "libcellml/exportdefinitions.h" diff --git a/src/api/libcellml/generator.h b/src/api/libcellml/generator.h index d9fb7debb0..320a2b94c9 100644 --- a/src/api/libcellml/generator.h +++ b/src/api/libcellml/generator.h @@ -16,7 +16,6 @@ limitations under the License. #pragma once -#include "libcellml/generatorvariabletracker.h" #include "libcellml/logger.h" namespace libcellml { diff --git a/src/api/libcellml/logger.h b/src/api/libcellml/logger.h index 239020528a..83964164fc 100644 --- a/src/api/libcellml/logger.h +++ b/src/api/libcellml/logger.h @@ -16,9 +16,6 @@ limitations under the License. #pragma once -#include -#include - #include "libcellml/exportdefinitions.h" #include "libcellml/types.h" diff --git a/src/api/libcellml/parentedentity.h b/src/api/libcellml/parentedentity.h index 0d7c3bf761..3aea29674d 100644 --- a/src/api/libcellml/parentedentity.h +++ b/src/api/libcellml/parentedentity.h @@ -16,8 +16,6 @@ limitations under the License. #pragma once -#include - #include "libcellml/entity.h" #include "libcellml/exportdefinitions.h" #include "libcellml/types.h" diff --git a/src/api/libcellml/types.h b/src/api/libcellml/types.h index ca976f1ef8..23362c0d81 100644 --- a/src/api/libcellml/types.h +++ b/src/api/libcellml/types.h @@ -16,9 +16,7 @@ limitations under the License. #pragma once -#include #include -#include #include "libcellml/enums.h" #include "libcellml/exportdefinitions.h" diff --git a/src/api/libcellml/units.h b/src/api/libcellml/units.h index db0a0e98db..35f7b21b9e 100644 --- a/src/api/libcellml/units.h +++ b/src/api/libcellml/units.h @@ -17,7 +17,6 @@ limitations under the License. #pragma once #include -#include #include "libcellml/exportdefinitions.h" #include "libcellml/importedentity.h" diff --git a/src/bindings/interface/generator.i b/src/bindings/interface/generator.i index 68cc1624b7..851b8b2a6f 100644 --- a/src/bindings/interface/generator.i +++ b/src/bindings/interface/generator.i @@ -45,6 +45,7 @@ %{ #include "libcellml/generator.h" +#include "libcellml/generatorvariabletracker.h" %} %pythoncode %{ diff --git a/src/component.cpp b/src/component.cpp index 207d731e6a..0aec377b2d 100644 --- a/src/component.cpp +++ b/src/component.cpp @@ -18,7 +18,6 @@ limitations under the License. #include #include -#include #include #include @@ -108,7 +107,8 @@ ComponentPtr Component::create(const std::string &name) noexcept bool Component::ComponentImpl::performTestWithHistory(History &history, const ComponentConstPtr &component, TestType type) const { if (mComponent->isImport()) { - auto model = mComponent->importSource()->model(); + auto importSource = mComponent->importSource(); + auto model = importSource->model(); if (model == nullptr) { return false; } @@ -118,7 +118,7 @@ bool Component::ComponentImpl::performTestWithHistory(History &history, const Co return false; } - auto h = createHistoryEpoch(component, importeeModelUrl(history, mComponent->importSource()->url())); + auto h = createHistoryEpoch(component, importeeModelUrl(history, importSource->url())); if (checkForImportCycles(history, h)) { return false; } diff --git a/src/component_p.h b/src/component_p.h index 8fddcb3494..4896bc3e10 100644 --- a/src/component_p.h +++ b/src/component_p.h @@ -19,7 +19,7 @@ limitations under the License. #include "libcellml/component.h" #include "componententity_p.h" -#include "utilities.h" +#include "internaltypes.h" namespace libcellml { diff --git a/src/componententity.cpp b/src/componententity.cpp index 7b2c0cd6ae..de8e28184a 100644 --- a/src/componententity.cpp +++ b/src/componententity.cpp @@ -21,11 +21,8 @@ limitations under the License. #include #include "libcellml/component.h" -#include "libcellml/model.h" -#include "libcellml/units.h" #include "component_p.h" -#include "utilities.h" namespace libcellml { diff --git a/src/entity.cpp b/src/entity.cpp index fd58d32b39..abd65dd9fa 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -16,8 +16,6 @@ limitations under the License. #include "libcellml/entity.h" -#include - #include "entity_p.h" namespace libcellml { diff --git a/src/generator.cpp b/src/generator.cpp index 8b184649ee..aa02ffd0ab 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -17,23 +17,20 @@ limitations under the License. #include "libcellml/generator.h" #include -#include #include "libcellml/analyserequation.h" #include "libcellml/analyserequationast.h" #include "libcellml/analysermodel.h" #include "libcellml/analyservariable.h" -#include "libcellml/component.h" +#include "libcellml/generatorvariabletracker.h" #include "libcellml/units.h" #include "libcellml/version.h" #include "analyserequation_p.h" -#include "analysermodel_p.h" #include "commonutils.h" #include "generator_p.h" #include "generatorprofilesha1values.h" #include "generatorprofiletools.h" -#include "generatorvariabletracker_p.h" #include "utilities.h" #include "libcellml/undefines.h" diff --git a/src/generatorprofiletools.cpp b/src/generatorprofiletools.cpp index f1efeef802..bc9fe8615e 100644 --- a/src/generatorprofiletools.cpp +++ b/src/generatorprofiletools.cpp @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ +#include "generatorprofiletools.h" + #include #include #include #include "libcellml/generatorprofile.h" -#include "generatorprofiletools.h" - namespace libcellml { // The below code is used to compute the SHA-1 value of a string, based on the diff --git a/src/importer.cpp b/src/importer.cpp index de54f925f7..b0e336b28b 100644 --- a/src/importer.cpp +++ b/src/importer.cpp @@ -17,13 +17,10 @@ limitations under the License. #include "libcellml/importer.h" #include -#include #include #include #include -#include -#include "libcellml/component.h" #include "libcellml/importsource.h" #include "libcellml/model.h" #include "libcellml/parser.h" diff --git a/src/importsource.cpp b/src/importsource.cpp index dd6b16e540..4d929fd006 100644 --- a/src/importsource.cpp +++ b/src/importsource.cpp @@ -16,12 +16,7 @@ limitations under the License. #include "libcellml/importsource.h" -#include -#include -#include - #include "libcellml/importedentity.h" -#include "libcellml/model.h" #include "libcellml/types.h" #include "entity_p.h" diff --git a/src/logger.cpp b/src/logger.cpp index a4594b73f2..faae97d415 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -16,7 +16,6 @@ limitations under the License. #include "libcellml/logger.h" -#include #include #include "libcellml/issue.h" diff --git a/src/model.cpp b/src/model.cpp index 7f89305ded..53a3820b40 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -17,12 +17,6 @@ limitations under the License. #include "libcellml/model.h" #include -#include -#include -#include -#include -#include -#include #include #include "libcellml/component.h" @@ -32,7 +26,6 @@ limitations under the License. #include "commonutils.h" #include "component_p.h" -#include "componententity_p.h" #include "internaltypes.h" #include "model_p.h" #include "units_p.h" diff --git a/src/printer.cpp b/src/printer.cpp index db5ca8727c..6a39d3a5f5 100644 --- a/src/printer.cpp +++ b/src/printer.cpp @@ -16,20 +16,13 @@ limitations under the License. #include "libcellml/printer.h" -#include -#include #include -#include -#include #include #include -#include "libcellml/component.h" #include "libcellml/importsource.h" #include "libcellml/issue.h" -#include "libcellml/model.h" #include "libcellml/reset.h" -#include "libcellml/units.h" #include "libcellml/variable.h" #include "anycellmlelement_p.h" diff --git a/src/reset.cpp b/src/reset.cpp index 07339bb192..d334688d9b 100644 --- a/src/reset.cpp +++ b/src/reset.cpp @@ -16,11 +16,6 @@ limitations under the License. #include "libcellml/reset.h" -#include -#include - -#include "libcellml/variable.h" - #include "reset_p.h" #include "utilities.h" diff --git a/src/types.cpp b/src/types.cpp index c011be60ae..d04b69440e 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -18,14 +18,9 @@ limitations under the License. #include -#include "libcellml/units.h" -#include "libcellml/variable.h" - #include "anycellmlelement_p.h" #include "internaltypes.h" -#include - namespace libcellml { /** diff --git a/src/units.cpp b/src/units.cpp index e91ff7113b..2cddc08111 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -22,7 +22,6 @@ limitations under the License. #include #include #include -#include #include #include #include diff --git a/src/utilities.cpp b/src/utilities.cpp index 6b6fc6db81..b589391739 100644 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -32,7 +32,6 @@ limitations under the License. #include "libcellml/component.h" #include "libcellml/importsource.h" #include "libcellml/model.h" -#include "libcellml/namedentity.h" #include "libcellml/reset.h" #include "libcellml/units.h" #include "libcellml/variable.h" diff --git a/src/validator.cpp b/src/validator.cpp index 10cf488738..55a1db1186 100644 --- a/src/validator.cpp +++ b/src/validator.cpp @@ -25,9 +25,7 @@ limitations under the License. #include #include -#include "libcellml/component.h" #include "libcellml/importsource.h" -#include "libcellml/model.h" #include "libcellml/reset.h" #include "libcellml/units.h" #include "libcellml/variable.h" diff --git a/src/variable.cpp b/src/variable.cpp index e23408d65b..5644b63219 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -19,7 +19,6 @@ limitations under the License. #include #include #include -#include #include #include "libcellml/units.h" From 1012983197fd080a47ef8f54eb2ddbeb5b9b8646 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Thu, 27 Nov 2025 13:15:07 +1300 Subject: [PATCH 2/5] Fix order in includes in analyser_p.h. --- src/analyser_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyser_p.h b/src/analyser_p.h index a0ee8e789a..f888861de4 100644 --- a/src/analyser_p.h +++ b/src/analyser_p.h @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "libcellml/issue.h" #include "libcellml/generatorprofile.h" +#include "libcellml/issue.h" #include "analysermodel_p.h" #include "internaltypes.h" From e76fa9f60df4b5155ef42d396d80c6723c949c55 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Thu, 27 Nov 2025 13:28:25 +1300 Subject: [PATCH 3/5] Add iterator include for std::back_inserter to model.cpp. --- src/model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/model.cpp b/src/model.cpp index 53a3820b40..56e18d6ad9 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -17,6 +17,7 @@ limitations under the License. #include "libcellml/model.h" #include +#include #include #include "libcellml/component.h" From b2568533ebbe955b35fe9f3a8f364c2471840ce2 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Thu, 27 Nov 2025 14:04:50 +1300 Subject: [PATCH 4/5] Revert import source access in performTestWithHistory --- src/component.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/component.cpp b/src/component.cpp index 0aec377b2d..c2c7fe1468 100644 --- a/src/component.cpp +++ b/src/component.cpp @@ -107,8 +107,7 @@ ComponentPtr Component::create(const std::string &name) noexcept bool Component::ComponentImpl::performTestWithHistory(History &history, const ComponentConstPtr &component, TestType type) const { if (mComponent->isImport()) { - auto importSource = mComponent->importSource(); - auto model = importSource->model(); + auto model = mComponent->importSource()->model(); if (model == nullptr) { return false; } @@ -118,7 +117,7 @@ bool Component::ComponentImpl::performTestWithHistory(History &history, const Co return false; } - auto h = createHistoryEpoch(component, importeeModelUrl(history, importSource->url())); + auto h = createHistoryEpoch(component, importeeModelUrl(history, mComponent->importSource()->url())); if (checkForImportCycles(history, h)) { return false; } From d58eac106993fd33ffc4e344b6b9d615ada806f0 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Thu, 27 Nov 2025 14:31:13 +1300 Subject: [PATCH 5/5] Forgot autosave isn't on in editor, this commit actually fixes the conflict in generator.h. --- src/api/libcellml/generator.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/api/libcellml/generator.h b/src/api/libcellml/generator.h index 42da7e600b..7e9b7915de 100644 --- a/src/api/libcellml/generator.h +++ b/src/api/libcellml/generator.h @@ -16,10 +16,7 @@ limitations under the License. #pragma once -<<<<<<< HEAD -======= #include "libcellml/generatorprofile.h" ->>>>>>> main #include "libcellml/logger.h" namespace libcellml {