Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions corelib/src/libs/SireBase/countflops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ double FlopsMark::operator-(const FlopsMark &other) const
return (1000.0 * dnflops) / dms;
}

#ifdef SIRE_TIME_ROUTINES
Q_GLOBAL_STATIC_WITH_ARGS(double, benchmarkSum, (0.0))
Q_GLOBAL_STATIC(QMutex, benchmarkMutex)
#endif

/** Perform a simple benchmark to work out what the realistic maximum
FLOPS count for this processor (compiled with this compiler)
Expand Down
14 changes: 7 additions & 7 deletions corelib/src/libs/SireBase/pagecache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@

#include "SireError/errors.h"

#include "SireBase/parallel.h"
#include "SireBase/console.h"
#include "SireBase/atexit.h"
#include "SireBase/console.h"
#include "SireBase/parallel.h"

#include <QAtomicInt>
#include <QDir>
#include <QThread>
#include <QQueue>
#include <QHash>
#include <QMutex>
#include <QTemporaryFile>
#include <QQueue>
#include <QTemporaryDir>
#include <QAtomicInt>
#include <QTemporaryFile>
#include <QThread>

#include <boost/noncopyable.hpp>

Expand Down Expand Up @@ -1074,7 +1074,7 @@ void CacheData::run()

const unsigned int n_bytes = static_cast<unsigned int>(data.size());

if (n_bytes >= page_size)
if (n_bytes >= static_cast<unsigned int>(page_size))
{
// this is bigger than a page, so needs to have its
// own page!
Expand Down
2 changes: 1 addition & 1 deletion corelib/src/libs/SireBase/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Process::Process(const Process &other) : d(other.d)
/** Destructor */
Process::~Process()
{
if (d.unique())
if (d.use_count() == 1)
{
this->kill();
}
Expand Down
4 changes: 2 additions & 2 deletions corelib/src/libs/SireBase/progressbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

#include "progressbar.h"

#include <QAtomicInteger>
#include <QDateTime>
#include <QThread>
#include <QAtomicInteger>

#include <boost/noncopyable.hpp>

Expand Down Expand Up @@ -450,7 +450,7 @@ namespace SireBase
{
QMutexLocker lkr(&mutex);

if (not bar.d.unique())
if (bar.d.use_count() != 1)
bar.d = bar.d->clone();

if (has_finished)
Expand Down
5 changes: 5 additions & 0 deletions corelib/src/libs/SireCAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ set ( SIRECAS_SOURCES

)

# NaN is used to mark missing values, so it must survive -ffast-math.
if (NOT MSVC)
set_source_files_properties(lambdaschedule.cpp PROPERTIES COMPILE_OPTIONS "-fno-finite-math-only")
endif()

add_library (SireCAS ${SIRECAS_SOURCES})

set_target_properties (SireCAS PROPERTIES
Expand Down
4 changes: 2 additions & 2 deletions corelib/src/libs/SireCAS/lambdaschedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ LambdaSchedule::LambdaSchedule(const LambdaSchedule &other)
lever_names(other.lever_names), stage_names(other.stage_names),
default_equations(other.default_equations),
stage_equations(other.stage_equations),
coupled_levers(other.coupled_levers),
stage_weights(other.stage_weights)
stage_weights(other.stage_weights),
coupled_levers(other.coupled_levers)
{
}

Expand Down
7 changes: 7 additions & 0 deletions corelib/src/libs/SireCAS/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ namespace SireCAS

bool operator==(const ExBase &other) const;

/** Exact match so C++20 doesn't find this ambiguous with the
reversed Expression overload */
bool operator==(const Symbol &other) const
{
return this->operator==(static_cast<const ExBase &>(other));
}

bool operator<(const Symbol &other) const;
bool operator>(const Symbol &other) const;
bool operator<=(const Symbol &other) const;
Expand Down
4 changes: 2 additions & 2 deletions corelib/src/libs/SireCluster/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ bool Node::release()

d.reset();

return my_d.unique();
return my_d.use_count() == 1;
}

/** Force the release of this node. This aborts any running
Expand All @@ -243,7 +243,7 @@ void Node::forceRelease()

d.reset();

if (my_d.unique())
if (my_d.use_count() == 1)
{
// just reset this pointer, and we are ok
my_d.reset();
Expand Down
2 changes: 1 addition & 1 deletion corelib/src/libs/SireCluster/nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Nodes::Nodes(const Nodes &other) : d(other.d)
/** Destructor */
Nodes::~Nodes()
{
if (d.unique())
if (d.use_count() == 1)
{
this->removeAll();
}
Expand Down
2 changes: 1 addition & 1 deletion corelib/src/libs/SireIO/netcdffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ NetCDFDataInfo::NetCDFDataInfo(const NetCDFDataInfo &other, const NetCDFHyperSla

for (int i = 0; i < dim_sizes.count(); ++i)
{
if (slab.starts()[i] < 0 or slab.starts()[i] + slab.counts()[i] > dim_sizes[i])
if (slab.starts()[i] + slab.counts()[i] > static_cast<size_t>(dim_sizes[i]))
{
throw SireError::invalid_index(QObject::tr(
"The slab for dimension %1 has the wrong shape (%2, %3) when the "
Expand Down
12 changes: 6 additions & 6 deletions corelib/src/libs/SireIO/perturbationslibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ Molecule PerturbationsLibrary::applyTemplate(const Molecule &molecule) const
SireUnits::Dimension::Charge icharge = pert.getInitCharge(iname);
atom.setProperty(initial_charge_property, icharge);
}
catch (const SireError::invalid_key)
catch (const SireError::invalid_key &)
{
continue;
}
Expand All @@ -1200,7 +1200,7 @@ Molecule PerturbationsLibrary::applyTemplate(const Molecule &molecule) const
SireUnits::Dimension::Charge fcharge = pert.getFinalCharge(iname);
atom.setProperty(final_charge_property, fcharge);
}
catch (const SireError::invalid_key)
catch (const SireError::invalid_key &)
{
continue;
}
Expand All @@ -1210,7 +1210,7 @@ Molecule PerturbationsLibrary::applyTemplate(const Molecule &molecule) const
LJParameter ilj = pert.getInitLJ(iname);
atom.setProperty(initial_LJ_property, ilj);
}
catch (const SireError::invalid_key)
catch (const SireError::invalid_key &)
{
continue;
}
Expand All @@ -1219,7 +1219,7 @@ Molecule PerturbationsLibrary::applyTemplate(const Molecule &molecule) const
LJParameter flj = pert.getFinalLJ(iname);
atom.setProperty(final_LJ_property, flj);
}
catch (const SireError::invalid_key)
catch (const SireError::invalid_key &)
{
continue;
}
Expand All @@ -1229,7 +1229,7 @@ Molecule PerturbationsLibrary::applyTemplate(const Molecule &molecule) const
QString iatype = pert.getInitType(iname);
atom.setProperty(initial_ambertype_property, iatype);
}
catch (const SireError::invalid_key)
catch (const SireError::invalid_key &)
{
continue;
}
Expand All @@ -1238,7 +1238,7 @@ Molecule PerturbationsLibrary::applyTemplate(const Molecule &molecule) const
QString fatype = pert.getFinalType(iname);
atom.setProperty(final_ambertype_property, fatype);
}
catch (const SireError::invalid_key)
catch (const SireError::invalid_key &)
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion corelib/src/libs/SireIO/third_party/xdrfile_trr.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ int read_trr_natoms(char *fn, int *natoms)
int write_trr(XDRFILE *xd, int natoms, int step, float t, float lambda,
matrix box, rvec *x, rvec *v, rvec *f)
{
int *plcholder;
int *plcholder = NULL;
return do_trn(xd, 0, &step, &t, &lambda, box, &natoms, x, v, f, plcholder);
}

Expand Down
4 changes: 0 additions & 4 deletions corelib/src/libs/SireIO/tinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,8 @@ void Tinker::loadParameters(const QString &prmfile)

QTextStream ts(&f);

int linenum = -1;

while (not ts.atEnd())
{
++linenum;

QString line = ts.readLine().simplified();

if (line.isEmpty() or line.startsWith("#"))
Expand Down
4 changes: 2 additions & 2 deletions corelib/src/libs/SireIO/zmatrixmaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void ZmatrixTemplate::setDihedralDelta(const QString &atom, const QString &bond,
// Implementation of ZmatrixResidue
//

ZmatrixResidue::ZmatrixResidue(const QString &name) : ZmatrixTemplate(name)
ZmatrixResidue::ZmatrixResidue(const QString &name) : ZmatrixTemplate(name), rotate(0), translate(0)
{
}

Expand Down Expand Up @@ -593,7 +593,7 @@ Molecule ZmatrixMaker::applyTemplates(Molecule &molecule)
{
linetemplate = restemplate.getZmatrixLineTemplate(atom.name().value());
}
catch (SireError::invalid_key)
catch (const SireError::invalid_key &)
{
/** If this fails, look also in the matching backbone zmatrix*/
ZmatrixTemplate chain = restemplate.getChain(position);
Expand Down
5 changes: 2 additions & 3 deletions corelib/src/libs/SireMM/anglerestraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ QDataStream &operator>>(QDataStream &ds, AngleRestraint &angrest)
/** Null constructor */
AngleRestraint::AngleRestraint()
: ConcreteProperty<AngleRestraint, Property>(),
_ktheta(0), _theta0(0)
_theta0(0), _ktheta(0)
{
}

Expand Down Expand Up @@ -253,8 +253,7 @@ QDataStream &operator>>(QDataStream &ds, AngleRestraints &angrests)
{
SharedDataStream sds(ds);

sds >> angrests.r >> angrests.use_pbc
>> static_cast<Restraints &>(angrests);
sds >> angrests.r >> angrests.use_pbc >> static_cast<Restraints &>(angrests);
}
else
throw version_error(v, "1,2", r_angrests, CODELOC);
Expand Down
28 changes: 14 additions & 14 deletions corelib/src/libs/SireMM/cljatoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1638,13 +1638,13 @@ void CLJAtoms::append(const CLJAtoms &other, int n)

if (n_whole > 0)
{
std::memcpy(&(_x[start_idx]), &(other._x[0]), n_whole * sizeof(MultiFloat));
std::memcpy(&(_y[start_idx]), &(other._y[0]), n_whole * sizeof(MultiFloat));
std::memcpy(&(_z[start_idx]), &(other._z[0]), n_whole * sizeof(MultiFloat));
std::memcpy(&(_q[start_idx]), &(other._q[0]), n_whole * sizeof(MultiFloat));
std::memcpy(&(_sig[start_idx]), &(other._sig[0]), n_whole * sizeof(MultiFloat));
std::memcpy(&(_eps[start_idx]), &(other._eps[0]), n_whole * sizeof(MultiFloat));
std::memcpy(&(_id[start_idx]), &(other._id[0]), n_whole * sizeof(MultiInt));
std::memcpy(static_cast<void *>(&(_x[start_idx])), &(other._x[0]), n_whole * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(&(_y[start_idx])), &(other._y[0]), n_whole * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(&(_z[start_idx])), &(other._z[0]), n_whole * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(&(_q[start_idx])), &(other._q[0]), n_whole * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(&(_sig[start_idx])), &(other._sig[0]), n_whole * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(&(_eps[start_idx])), &(other._eps[0]), n_whole * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(&(_id[start_idx])), &(other._id[0]), n_whole * sizeof(MultiInt));
}

if (n_partial > 0)
Expand Down Expand Up @@ -1888,13 +1888,13 @@ void CLJAtoms::copyIn(const CLJAtoms &other)

const int nelements = other._x.count();

std::memcpy(_x.data(), other._x.constData(), nelements * sizeof(MultiFloat));
std::memcpy(_y.data(), other._y.constData(), nelements * sizeof(MultiFloat));
std::memcpy(_z.data(), other._z.constData(), nelements * sizeof(MultiFloat));
std::memcpy(_q.data(), other._q.constData(), nelements * sizeof(MultiFloat));
std::memcpy(_sig.data(), other._sig.constData(), nelements * sizeof(MultiFloat));
std::memcpy(_eps.data(), other._eps.constData(), nelements * sizeof(MultiFloat));
std::memcpy(_id.data(), other._id.constData(), nelements * sizeof(MultiInt));
std::memcpy(static_cast<void *>(_x.data()), other._x.constData(), nelements * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(_y.data()), other._y.constData(), nelements * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(_z.data()), other._z.constData(), nelements * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(_q.data()), other._q.constData(), nelements * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(_sig.data()), other._sig.constData(), nelements * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(_eps.data()), other._eps.constData(), nelements * sizeof(MultiFloat));
std::memcpy(static_cast<void *>(_id.data()), other._id.constData(), nelements * sizeof(MultiInt));
}

/** Return a copy of these CLJAtoms where the charge and LJ epsilon parameters
Expand Down
2 changes: 1 addition & 1 deletion corelib/src/libs/SireMM/cljboxes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void CLJBox::findGaps()

const QVector<MultiInt> &ids = atms.ID();

const quint32 dummy_id = CLJAtoms::idOfDummy()[0];
const qint32 dummy_id = CLJAtoms::idOfDummy()[0];

for (int i = ids.count() - 1; i >= 0; --i)
{
Expand Down
10 changes: 5 additions & 5 deletions corelib/src/libs/SireMM/cljworkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace SireMM
{
// loop over the old and new atoms
{
const QVector<MultiInt> &ids = deltas.constData()[i].newAtoms().ID();
const QVector<MultiInt> ids = deltas.constData()[i].newAtoms().ID();

for (int j = 0; j < ids.count(); ++j)
{
Expand All @@ -131,7 +131,7 @@ namespace SireMM

// loop over the old and new atoms
{
const QVector<MultiInt> &ids = deltas.constData()[i].oldAtoms().ID();
const QVector<MultiInt> ids = deltas.constData()[i].oldAtoms().ID();

for (int j = 0; j < ids.count(); ++j)
{
Expand Down Expand Up @@ -516,7 +516,7 @@ void CLJWorkspace::returnToMemoryPool()
if (d.get() == 0)
return;

if (not d.unique())
if (d.use_count() != 1)
{
d.reset();
return;
Expand All @@ -541,7 +541,7 @@ void CLJWorkspace::createFromMemoryPool()
{
if (d.get() != 0)
{
if (d.unique())
if (d.use_count() == 1)
{
d->clear();
return;
Expand Down Expand Up @@ -694,7 +694,7 @@ void CLJWorkspace::detach()
{
if (d.get() != 0)
{
if (not d.unique())
if (d.use_count() != 1)
{
std::shared_ptr<detail::CLJWorkspaceData> d2 = d;
d.reset();
Expand Down
6 changes: 3 additions & 3 deletions corelib/src/libs/SireMM/cmapfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@

#include "SireBase/console.h"

#include "SireMol/atommapping.h"
#include "SireMol/atommatcher.h"
#include "SireMol/atomselection.h"
#include "SireMol/moleculeinfodata.h"
#include "SireMol/moleculedata.h"
#include "SireMol/atommapping.h"
#include "SireMol/moleculeinfodata.h"

#include "SireError/errors.h"

Expand Down Expand Up @@ -365,7 +365,7 @@ void CMAPFunctions::set(AtomIdx atom0, AtomIdx atom1, AtomIdx atom2,
quint32 atm3 = atom3.map(info().nAtoms());
quint32 atm4 = atom4.map(info().nAtoms());

if (atm0 == atm1 or atm0 == atm2 or atm0 == atm3 or atm0 == atom4 or
if (atm0 == atm1 or atm0 == atm2 or atm0 == atm3 or atm0 == atm4 or
atm1 == atm2 or atm1 == atm3 or atm1 == atm4 or
atm2 == atm3 or atm2 == atm4 or atm3 == atm4)
throw SireMol::duplicate_atom(QObject::tr("You cannot add a function that acts between the same atoms! "
Expand Down
Loading