Skip to content

Commit

Permalink
Comment out unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kwsm committed Jun 16, 2021
1 parent c3143e6 commit d843367
Show file tree
Hide file tree
Showing 85 changed files with 125 additions and 143 deletions.
11 changes: 1 addition & 10 deletions include/openbabel/base.h
Expand Up @@ -28,15 +28,6 @@ GNU General Public License for more details.
#include <iostream>
#include <openbabel/tokenst.h>

#ifdef UNUSED
#elif (__GNUC__ == 4)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif

namespace OpenBabel
{

Expand Down Expand Up @@ -283,7 +274,7 @@ class OBConversion; //used only as pointer
//! \brief Base type does nothing
//! Made virtual around r3535 to simplify code which passes around OBBase*.
//Currently no title data member in base class.
virtual const char *GetTitle(bool UNUSED(replaceNewlines) = true) const { return "";}
virtual const char *GetTitle(bool /*replaceNewlines*/ = true) const { return ""; }
virtual void SetTitle(const char *) {}

//! \name Generic data handling methods (via OBGenericData)
Expand Down
16 changes: 8 additions & 8 deletions include/openbabel/forcefield.h
Expand Up @@ -910,56 +910,56 @@ const double GAS_CONSTANT = 8.31446261815324e-3 / KCAL_TO_KJ; //!< kcal mol^-1
* OBFF_LOGLVL_MEDIUM: energy for individual energy terms \n
* OBFF_LOGLVL_HIGH: energy for individual energy interactions \n
*/
virtual double Energy(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double Energy(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Bond stretching energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Bond(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Bond(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Angle bending energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Angle(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Angle(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Stretch bending energy.
* \par Output to log:
* see Energy()
*/
virtual double E_StrBnd(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_StrBnd(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Torsional energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Torsion(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Torsion(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Out-Of-Plane bending energy.
* \par Output to log:
* see Energy()
*/
virtual double E_OOP(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_OOP(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Van der Waals energy.
* \par Output to log:
* see Energy()
*/
virtual double E_VDW(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_VDW(bool /*gradients*/ = true) { return 0.0f; }
/*! \param gradients Set to true when the gradients need to be calculated
* (needs to be done before calling GetGradient()).
* \return Electrostatic energy.
* \par Output to log:
* see Energy()
*/
virtual double E_Electrostatic(bool UNUSED(gradients) = true) { return 0.0f; }
virtual double E_Electrostatic(bool /*gradients*/ = true) { return 0.0f; }
//@}

/////////////////////////////////////////////////////////////////////////
Expand Down
13 changes: 2 additions & 11 deletions include/openbabel/rotor.h
Expand Up @@ -24,15 +24,6 @@ GNU General Public License for more details.
#include <openbabel/typer.h>
#include <openbabel/bitvec.h>

#ifdef UNUSED
#elif (__GNUC__ == 4)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x) /*@unused@*/ x
#else
# define UNUSED(x) x
#endif

namespace OpenBabel
{
class OBRing;
Expand Down Expand Up @@ -425,7 +416,7 @@ namespace OpenBabel
///@name Deprecated
///@{
/** @deprecated Has no effect. */
void SetDelta(double UNUSED(d)) {}
void SetDelta(double) {}
/** @deprecated Has no effect. */
double GetDelta() { return 10.0; }
/** @deprecated */
Expand All @@ -441,7 +432,7 @@ namespace OpenBabel
/** @deprecated Bad name, see GetTorsionValues() */
std::vector<double> &GetResolution() { return _torsionAngles; }
/** @deprecated */
void SetNumCoords(int UNUSED(nc)) {}
void SetNumCoords(int) {}
///@}

; // Added to workaround https://github.com/swig/swig/issues/1636
Expand Down
2 changes: 1 addition & 1 deletion src/charges/qeq.cpp
Expand Up @@ -157,7 +157,7 @@ namespace OpenBabel
}

//!Returns a triple of numbers: electronegativity (in eV), hardness (in eV), and Gaussian exponent (in bohr^-2)
Eigen::Vector3d QEqCharges::GetParameters(unsigned int Z, int Q)
Eigen::Vector3d QEqCharges::GetParameters(unsigned int Z, int /*Q*/)
{
Eigen::Vector3d P;
//For now, completely ignore the formal charge
Expand Down
2 changes: 1 addition & 1 deletion src/charges/qtpie.cpp
Expand Up @@ -148,7 +148,7 @@ QTPIECharges theQTPIECharges("qtpie"); //Global instance
}
}

Eigen::Vector3d QTPIECharges::GetParameters(unsigned int Z, int Q)
Eigen::Vector3d QTPIECharges::GetParameters(unsigned int Z, int /*Q*/)
{
//Returns a triple of numbers: electronegativity (in eV), hardness (in eV), and Gaussian exponent (in bohr^-2)

Expand Down
6 changes: 3 additions & 3 deletions src/conformersearch.cpp
Expand Up @@ -55,7 +55,7 @@ namespace OpenBabel {

OBConformerFilter::~OBConformerFilter() {}

bool OBStericConformerFilter::IsGood(const OBMol &mol, const RotorKey &key, double *conformer)
bool OBStericConformerFilter::IsGood(const OBMol &mol, const RotorKey & /*key*/, double *conformer)
{
unsigned int a1 = 0, a2 = 0;
unsigned int numAtoms = mol.NumAtoms();
Expand Down Expand Up @@ -104,7 +104,7 @@ namespace OpenBabel {
OBConformerScore::~OBConformerScore() {}

double OBRMSDConformerScore::Score(OBMol &mol, unsigned int index,
const RotorKeys &keys, const std::vector<double*> &conformers)
const RotorKeys & /*keys*/, const std::vector<double*> &conformers)
{
unsigned int numAtoms = mol.NumAtoms();

Expand Down Expand Up @@ -228,7 +228,7 @@ namespace OpenBabel {
}

double OBMinimizingRMSDConformerScore::Score(OBMol &mol, unsigned int index,
const RotorKeys &keys, const std::vector<double*> &conformers)
const RotorKeys & /*keys*/, const std::vector<double*> &conformers)
{
unsigned int numAtoms = mol.NumAtoms();
double *origCoords = mol.GetCoordinates();
Expand Down
4 changes: 2 additions & 2 deletions src/depict/asciipainter.cpp
Expand Up @@ -77,7 +77,7 @@ namespace OpenBabel
return 0.0;
}

void ASCIIPainter::DrawLine(double x1, double y1, double x2, double y2, const std::vector<double> & dashes)
void ASCIIPainter::DrawLine(double x1, double y1, double x2, double y2, const std::vector<double> & /*dashes*/)
{
vector<pair<int, int> > coords;
vector<pair<int, int> >::iterator vp_it;
Expand Down Expand Up @@ -121,7 +121,7 @@ namespace OpenBabel
}
}

OBFontMetrics ASCIIPainter::GetFontMetrics(const std::string &text)
OBFontMetrics ASCIIPainter::GetFontMetrics(const std::string & /*text*/)
{
OBFontMetrics metrics;
// The following line tries to workaround the fact that fontSize is an int
Expand Down
2 changes: 1 addition & 1 deletion src/depict/cairopainter.cpp
Expand Up @@ -99,7 +99,7 @@ namespace OpenBabel
cairo_set_source_rgb(m_cairo, color.red, color.green, color.blue);
}

void CairoPainter::SetFillRadial(const OBColor &start, const OBColor &end)
void CairoPainter::SetFillRadial(const OBColor & /*start*/, const OBColor &end)
{
cairo_set_source_rgb(m_cairo, end.red, end.green, end.blue);
}
Expand Down
4 changes: 2 additions & 2 deletions src/depict/commandpainter.cpp
Expand Up @@ -112,7 +112,7 @@ namespace OpenBabel
m_ofs << "DrawCircle " << x << " " << y << " radius " << r << endl;
}

void CommandPainter::DrawBall(double x, double y, double r, double opacity)
void CommandPainter::DrawBall(double x, double y, double r, double /*opacity*/)
{
m_ofs << "DrawBall " << x << " " << y << " radius " << r << endl;
}
Expand All @@ -122,7 +122,7 @@ namespace OpenBabel
m_ofs << "DrawText " << x << " " << y << " \"" << text << "\"" << endl;
}

OBFontMetrics CommandPainter::GetFontMetrics(const std::string &text)
OBFontMetrics CommandPainter::GetFontMetrics(const std::string& /*text*/)
{
OBFontMetrics metrics;
metrics.fontSize = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/depict/depict.cpp
Expand Up @@ -1066,7 +1066,7 @@ namespace OpenBabel
}
}
void OBDepictPrivateBallAndStick::DrawSimpleBond(OBAtom* beginAtom,
OBAtom* endAtom, int order, bool crossed_bond)
OBAtom* endAtom, int order, bool /*crossed_bond*/)
{
const vector3 begin = beginAtom->GetVector();
const vector3 end = endAtom->GetVector();
Expand Down Expand Up @@ -1222,7 +1222,7 @@ OBBitVec& drawnBonds)
}
}

inline void OBDepictPrivateBallAndStick::DrawAromaticRingBond(OBAtom *prevAtom, OBAtom *beginAtom, OBAtom *endAtom, OBAtom *nextAtom, const vector3 &center, double dist)
inline void OBDepictPrivateBallAndStick::DrawAromaticRingBond(OBAtom *prevAtom, OBAtom *beginAtom, OBAtom *endAtom, OBAtom *nextAtom, const vector3 & /*center*/, double /*dist*/)
{
const vector3 prev = prevAtom->GetVector();
const vector3 begin = beginAtom->GetVector();
Expand Down
2 changes: 1 addition & 1 deletion src/descriptors/cansmidescriptor.cpp
Expand Up @@ -39,7 +39,7 @@ class CanSmiles : public OBDescriptor
bool _noStereo;
};

bool CanSmiles::Compare(OBBase* pOb, istream& optionText, bool noEval, string* param)
bool CanSmiles::Compare(OBBase* pOb, istream& optionText, bool noEval, string* /*param*/)
{
string can;
GetStringValue(pOb, can);
Expand Down
2 changes: 1 addition & 1 deletion src/descriptors/cmpdfilter.cpp
Expand Up @@ -71,7 +71,7 @@ class CompoundFilter : public OBDescriptor
}

///Returns the result of evaluating the conditional expressions in the macrotext
virtual bool Compare(OBBase* pOb, istream&, bool noEval, string* param)
virtual bool Compare(OBBase* pOb, istream&, bool noEval, string* /*param*/)
{
stringstream ss;
ss.str(_macroText);
Expand Down
6 changes: 3 additions & 3 deletions src/descriptors/filters.cpp
Expand Up @@ -32,7 +32,7 @@ class MWFilter : public OBDescriptor {
public:
MWFilter(const char *ID) : OBDescriptor(ID){};
virtual const char *Description() { return "Molecular Weight filter"; };
virtual double Predict(OBBase *pOb, string *param = nullptr) {
virtual double Predict(OBBase *pOb, string * /*param*/ = nullptr) {
OBMol *pmol = dynamic_cast<OBMol *>(pOb);
if (!pmol)
return 0;
Expand All @@ -46,7 +46,7 @@ class RotatableBondsFilter : public OBDescriptor {
public:
RotatableBondsFilter(const char *ID) : OBDescriptor(ID){};
virtual const char *Description() { return "Rotatable bonds filter"; };
virtual double Predict(OBBase *pOb, string *param = nullptr) {
virtual double Predict(OBBase *pOb, string * /*param*/ = nullptr) {
OBMol *pmol = dynamic_cast<OBMol *>(pOb);
if (!pmol)
return 0;
Expand Down Expand Up @@ -152,7 +152,7 @@ class FormulaDescriptor : public OBDescriptor {
virtual const char *Description() { return "Chemical formula"; };

virtual double GetStringValue(OBBase *pOb, std::string &svalue,
std::string *param = nullptr) {
std::string * /*param*/ = nullptr) {
OBMol *pmol = dynamic_cast<OBMol *>(pOb);
if (pmol)
svalue = pmol->GetSpacedFormula(1, ""); // actually unspaced
Expand Down
2 changes: 1 addition & 1 deletion src/descriptors/groupcontrib.cpp
Expand Up @@ -108,7 +108,7 @@ namespace OpenBabel
}


double OBGroupContrib::Predict(OBBase* pOb, string* param)
double OBGroupContrib::Predict(OBBase* pOb, string* /*param*/)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(!pmol)
Expand Down
2 changes: 1 addition & 1 deletion src/descriptors/smartsdescriptors.cpp
Expand Up @@ -45,7 +45,7 @@ namespace OpenBabel
return txt.c_str();
}

double Predict(OBBase* pOb, string* param=nullptr)
double Predict(OBBase* pOb, string* /*param*/ = nullptr)
{
OBMol* pmol = dynamic_cast<OBMol*> (pOb);
if(!pmol)
Expand Down
2 changes: 1 addition & 1 deletion src/dlhandler_unix.cpp
Expand Up @@ -72,7 +72,7 @@ bool DLHandler::getConvDirectory(string& convPath)
}

int DLHandler::findFiles (std::vector <std::string>& file_list,
const std::string& pattern,
const std::string& /*pattern*/,
const std::string& path)
{
vector<string> paths, vs;
Expand Down
2 changes: 1 addition & 1 deletion src/fingerprints/finger2.cpp
Expand Up @@ -65,7 +65,7 @@ class fingerprint2 : public OBFingerprint
For the rest, even when stopped by encountering atoms already visited
0 , atno(1), bo(1)(2), atno(2), bo(2)(3),...atno(n)
**/
virtual std::string DescribeBits(const std:: vector<unsigned int> fp, bool bSet=true)
virtual std::string DescribeBits(const std::vector<unsigned int> /*fp*/, bool /*bSet*/ = true)
{ return _ss.str(); }

virtual unsigned int Flags() { return _flags;};
Expand Down
2 changes: 1 addition & 1 deletion src/fingerprints/fingerecfp.cpp
Expand Up @@ -50,7 +50,7 @@ class fingerprintECFP : public OBFingerprint
virtual bool GetFingerprint(OBBase* pOb, vector<unsigned int>&fp, int nbits=0);

/// \returns fragment info unless SetFlags(OBFingerprint::FPT_NOINFO) has been called before GetFingerprint() called.
virtual std::string DescribeBits(const std:: vector<unsigned int> fp, bool bSet=true)
virtual std::string DescribeBits(const std::vector<unsigned int> /*fp*/, bool /*bSet*/ = true)
{ return _ss.str(); }

virtual unsigned int Flags() { return _flags;};
Expand Down
6 changes: 3 additions & 3 deletions src/forcefield.cpp
Expand Up @@ -2739,7 +2739,7 @@ namespace OpenBabel
delete atom;
}

void OBForceField::SteepestDescentInitialize(int steps, double econv, int method)
void OBForceField::SteepestDescentInitialize(int steps, double econv, int /*method*/)
{
if (!_validSetup)
return;
Expand Down Expand Up @@ -2865,7 +2865,7 @@ namespace OpenBabel
}

void OBForceField::ConjugateGradientsInitialize(int steps, double econv,
int method)
int /*method*/)
{
if (!_validSetup || steps==0)
return;
Expand Down Expand Up @@ -3514,7 +3514,7 @@ namespace OpenBabel
//cout << "E_{kin_corr} = sum( m_i * v_i^2 ) = " << E_kin2 << endl;
}

void OBForceField::MolecularDynamicsTakeNSteps(int n, double T, double timestep, int method)
void OBForceField::MolecularDynamicsTakeNSteps(int n, double T, double timestep, int /*method*/)
{
if (!_validSetup)
return;
Expand Down
4 changes: 2 additions & 2 deletions src/formats/MCDLformat.cpp
Expand Up @@ -176,7 +176,7 @@ class MCDLFormat : public OBMoleculeFormat


/* Create descriptor connectivity string from connectivity table of fragments */
string MCDLFormat::constring(int conntab [MAXBONDS][4], char * tstr)
string MCDLFormat::constring(int conntab [MAXBONDS][4], char * /*tstr*/)
{
int i,j,k,n,nn,icons[6],comma;
char line[82],semis[100];
Expand Down Expand Up @@ -481,7 +481,7 @@ class MCDLFormat : public OBMoleculeFormat



string MCDLFormat::getMCDL(OBMol* pmol, bool includeCoordinates) {
string MCDLFormat::getMCDL(OBMol* pmol, bool /*includeCoordinates*/) {
int i=0;
int j=0;
int k=0;
Expand Down
2 changes: 1 addition & 1 deletion src/formats/acrformat.cpp
Expand Up @@ -67,7 +67,7 @@ namespace OpenBabel
return READONEONLY | NOTWRITABLE;
};

virtual int SkipObjects(int n, OBConversion* pConv)
virtual int SkipObjects(int /*n*/, OBConversion* /*pConv*/)
{
return 0;
};
Expand Down

0 comments on commit d843367

Please sign in to comment.