Base: Use explicit pointer syntax for freecad_cast (#20694)

* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
This commit is contained in:
Kacper Donat
2025-04-11 16:11:33 +02:00
committed by GitHub
parent 02bb799209
commit 77e40b9747
73 changed files with 305 additions and 304 deletions

View File

@@ -119,7 +119,7 @@ ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer* _owner,
, _hash(0)
{
if (_owner) {
const DocumentObject* docObj = freecad_cast<const DocumentObject>(_owner);
const DocumentObject* docObj = freecad_cast<const DocumentObject*>(_owner);
if (!docObj) {
FC_THROWM(Base::RuntimeError, "Property must be owned by a document object.");
}
@@ -145,7 +145,7 @@ ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer* _owner, bool lo
, _hash(0)
{
if (_owner) {
const DocumentObject* docObj = freecad_cast<const DocumentObject>(_owner);
const DocumentObject* docObj = freecad_cast<const DocumentObject*>(_owner);
if (!docObj) {
FC_THROWM(Base::RuntimeError, "Property must be owned by a document object.");
}
@@ -166,7 +166,7 @@ ObjectIdentifier::ObjectIdentifier(const Property& prop, int index)
, localProperty(false)
, _hash(0)
{
DocumentObject* docObj = freecad_cast<DocumentObject>(prop.getContainer());
DocumentObject* docObj = freecad_cast<DocumentObject*>(prop.getContainer());
if (!docObj) {
FC_THROWM(Base::TypeError, "Property must be owned by a document object.");
@@ -1364,7 +1364,7 @@ ObjectIdentifier ObjectIdentifier::relativeTo(const ObjectIdentifier& other) con
ObjectIdentifier ObjectIdentifier::parse(const DocumentObject* docObj, const std::string& str)
{
std::unique_ptr<Expression> expr(ExpressionParser::parse(docObj, str.c_str()));
VariableExpression* v = freecad_cast<VariableExpression>(expr.get());
VariableExpression* v = freecad_cast<VariableExpression*>(expr.get());
if (v) {
return v->getPath();
@@ -1853,12 +1853,12 @@ ObjectIdentifier::access(const ResolveResults& result, Py::Object* value, Depend
}
if (prop && prop->getContainer() != obj) {
auto linkTouched =
freecad_cast<PropertyBool>(obj->getPropertyByName("_LinkTouched"));
freecad_cast<PropertyBool*>(obj->getPropertyByName("_LinkTouched"));
if (linkTouched) {
propName = linkTouched->getName();
}
else {
auto propOwner = freecad_cast<DocumentObject>(prop->getContainer());
auto propOwner = freecad_cast<DocumentObject*>(prop->getContainer());
if (propOwner) {
obj = propOwner;
}