New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update lingo 2 #6819
update lingo 2 #6819
Conversation
src/App/Document.cpp
Outdated
@@ -494,7 +495,7 @@ void Document::exportGraphviz(std::ostream& out) const | |||
} | |||
if(!sgraph) { | |||
if(docObj->isDerivedFrom(OriginFeature::getClassTypeId())) | |||
sgraph = GraphList[static_cast<OriginFeature*>(docObj)->getOrigin()]; | |||
sgraph = GraphList[dynamic_cast<OriginFeature*>(docObj)->getOrigin()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See forum discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way above my pay grade. Will reverse and leave alone until I get my head around all that.
src/App/Document.cpp
Outdated
linked = o->getLinkedObject(false); | ||
else { | ||
if (options & GetLinkArrayElement) { | ||
linked = o->getLinkedObject(true, nullptr, Prop_Output | Prop_Hidden, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the semantic. Before the change the first parameter was false and now it's true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I tried to fix not having defaults in virtual, and messed up, then obviously messed up further trying to restore. Will restore.
src/App/DocumentObjectPyImp.cpp
Outdated
@@ -712,7 +718,7 @@ PyObject* DocumentObjectPy::getPathsByOutList(PyObject *args) | |||
} | |||
} | |||
|
|||
PyObject *DocumentObjectPy::getCustomAttributes(const char* attr) const | |||
PyObject *DocumentObjectPy::getCustomAttributes(const char* attr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot simply remove the const here. The change causes a build failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. It did build here before I lodged, but not there! But yes, will reverse. And be more careful.
src/App/DocumentObjectPyImp.cpp
Outdated
@@ -880,6 +886,6 @@ Py::Boolean DocumentObjectPy::getNoTouch() const { | |||
return Py::Boolean(getDocumentObjectPtr()->testStatus(ObjectStatus::NoTouch)); | |||
} | |||
|
|||
void DocumentObjectPy::setNoTouch(Py::Boolean value) { | |||
void DocumentObjectPy::setNoTouch(const Py::Boolean& value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header DocumentObjectPy.h is a generated file and the value is passed by value.The Py::
classes are a lightweight wrapper for PyObject similar to a smart pointer.
If this should be changed then the generation script must be changed and with it a lot of source files. If we decide to do it then this has to happen in a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK! Will reverse. 'generated file' answers a couple of questions. Will be more cautious in future.
I guess in any case this is better to handle after the 0.20 release? |
Yes. I haven't carefully checked every single line and it would be bad to introduce a possible regression because of an overlooked unintentional change. Also this PR tries to improve too many different things at the same time. IMO it should be split into smaller commits but lets do it after the release. |
@wwmayer I acknowledge this commit (and its mates) may have been over-confident for a newbie, and they are getting stale. Am thinking to delete them and start again, a bit wiser, and grateful for your assistance. Would you give some guidance re the better approach? |
I had a quick look at the changes and they fall into the following categories:
It would be good to split the changes and make one commit for each category. |
Re: explicit on constructors. What is the chance that there is some code in FreeCAD that relies
on implicit conversion and will break? Is there any way to test?
… On 30 Jul 2022, at 9:13 pm, wwmayer ***@***.***> wrote:
Would you give some guidance re the better approach?
I had a quick look at the changes and they fall into the following categories:
constructor/destructor => default, override, explicit, ...
virtual functions => override
static methods
{} initialization
remove redundant void
remove redundant == or != in conditions
replace complex iterator declarations with auto
change of URLs
others (cosmetic changes, ...)
It would be good to split the changes and make one commit for each category.
—
Reply to this email directly, view it on GitHub <#6819 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEXAYND6HQGDVS4UT6Y743VWUE6ZANCNFSM5U3VOTYA>.
You are receiving this because you authored the thread.
|
If you add the keyword |
Like this you mean? /Users/bernie/CLionProjects/FreeCAD/src/App/Application.cpp:766:28: error: no viable overloaded operator[] for type 'std::map<DocumentT, DocTiming>' |
No, this must be something else. There is a problem with the STL implementation of clang under macOS where the key of a map cannot be const. We already had such a case in PropertyExpressionEngine.h where depending on the platform the class member ExpressionMap is declared differently. |
Actually, this is caused by the addition of explicit where implicit relied upon. |
Another round of fixing simple warnings and other minor improvements.
Apologies for having to have multiple prs :(
Thank you for creating a pull request to contribute to FreeCAD! To ease integration, we ask you to conform to the following items. Pull requests which don't satisfy all the items below might be rejected. If you are in doubt with any of the items below, don't hesitate to ask for help in the FreeCAD forum!
App
,Base
,Gui
or one of theMod
subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next onesgit pull --rebase upstream master
./bin/FreeCAD --run-test 0
Fixes typo in Draft Move command text
Draft: Fixed typos
issue #<id>
orfixes #<id>
where<id>
is the issue ID number from our Issues database in case a particular commit solves or is related to an existing issue. Ex:Draft: fix typos - fixes #4805
And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.20 Changelog Forum Thread.