Base: cosmetic changes

This commit is contained in:
wmayer
2022-05-12 17:49:55 +02:00
parent 354052e8f5
commit cbc0bfc24d
3 changed files with 4 additions and 8 deletions

View File

@@ -86,7 +86,6 @@ int QuantityPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyErr_Clear(); // set by PyArg_ParseTuple()
PyObject *object;
if (PyArg_ParseTuple(args,"O!",&(Base::QuantityPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
*self = *(static_cast<Base::QuantityPy*>(object)->getQuantityPtr());
return 0;
}
@@ -94,7 +93,6 @@ int QuantityPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyErr_Clear(); // set by PyArg_ParseTuple()
double f = DOUBLE_MAX;
if (PyArg_ParseTuple(args,"dO!",&f,&(Base::UnitPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
*self = Quantity(f,*(static_cast<Base::UnitPy*>(object)->getUnitPtr()));
return 0;
}
@@ -187,7 +185,6 @@ PyObject* QuantityPy::getValueAs(PyObject *args)
if (!quant.isValid()) {
PyObject *object;
if (PyArg_ParseTuple(args,"O!",&(Base::QuantityPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
quant = * static_cast<Base::QuantityPy*>(object)->getQuantityPtr();
}
}
@@ -196,7 +193,6 @@ PyObject* QuantityPy::getValueAs(PyObject *args)
PyObject *object;
PyErr_Clear();
if (PyArg_ParseTuple(args,"O!",&(Base::UnitPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
quant.setUnit(*static_cast<Base::UnitPy*>(object)->getUnitPtr());
quant.setValue(1.0);
}
@@ -207,7 +203,6 @@ PyObject* QuantityPy::getValueAs(PyObject *args)
double value;
PyErr_Clear();
if (PyArg_ParseTuple(args,"dO!",&value, &(Base::UnitPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
quant.setUnit(*static_cast<Base::UnitPy*>(object)->getUnitPtr());
quant.setValue(value);
}

View File

@@ -67,7 +67,6 @@ int UnitPy::PyInit(PyObject* args, PyObject* /*kwd*/)
// get quantity
if (PyArg_ParseTuple(args,"O!",&(Base::QuantityPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
*self = static_cast<Base::QuantityPy*>(object)->getQuantityPtr()->getUnit();
return 0;
}
@@ -75,7 +74,6 @@ int UnitPy::PyInit(PyObject* args, PyObject* /*kwd*/)
// get unit
if (PyArg_ParseTuple(args,"O!",&(Base::UnitPy::Type), &object)) {
// Note: must be static_cast, not reinterpret_cast
*self = *(static_cast<Base::UnitPy*>(object)->getUnitPtr());
return 0;
}

View File

@@ -45,7 +45,10 @@ using namespace zipios;
// ---------------------------------------------------------------------------
Writer::Writer()
: indent(0),forceXML(false),fileVersion(1)
: indent(0)
, indBuf{}
, forceXML(false)
, fileVersion(1)
{
indBuf[0] = '\0';
}